Build/Test Tools: Make the WordPress installation E2E test repeatable - #13377
Build/Test Tools: Make the WordPress installation E2E test repeatable#13377devsupportlogicrays wants to merge 1 commit into
Conversation
Drop leftover wp_e2e_* tables before and after the install suite, fail hard if cleanup queries return false, and retry navigation after the wp-config prefix swap so consecutive runs reach install.php reliably. Co-authored-by: Cursor <cursoragent@cursor.com>
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @ahirgithub. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
Description
tests/e2e/specs/install.test.jsrewrites$table_prefixtowp_e2e_so WordPress enters the install wizard, but it never dropped the tables that install creates. After the first green run, leftoverwp_e2e_*tables make every later run treat the site as already installed, so the test never reaches/wp-admin/install.php.This change:
dropTestInstallTables()helper that drops the standard single-site tables underTEST_TABLE_PREFIXviawp eval/$wpdb(avoids shelling out to themysqlclient).beforeEachand again inafterEachteardown, so stale tables cannot short-circuit the wizard on the first attempt.$wpdb->query()returnsfalse, so failed cleanup cannot leave the suite green.page.goto('/')withexpect(...).toPass()so navigation itself retries after the host-sidewp-config.phprewrite (Docker bind-mount lag)..check()in the install form fill.This builds on the approach discussed in #13302 and incorporates the review feedback there (helper extraction, cleanup before the prefix change, and failing on false query results).
Testing Instructions
npm run env:start).install.phpwithout manualDROP TABLEcleanup.TEST_INSTALL_TABLESand confirm the helper exits non-zero.Trac ticket: https://core.trac.wordpress.org/ticket/65982
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.