Repository navigation
Build/Test Tools: Run tests in one E2E spec file in parallel. - #15929
adimoldovan wants to merge 2 commits into
Conversation
Turn on `fullyParallel` for the `parallel` project, so Playwright can run tests from the same file at the same time. Scope the classic menus to each test. Lock the tests that write the theme's menu locations or the privacy policy page setting, as this data cannot be scoped. See #66392.
… in order. See #66392.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the change enabling same-file concurrency in the E2E parallel project.
No open issues 🎉
What changed in this PR
Enables tests within the same spec file to run concurrently in the E2E suite’s parallel project, while leaving serial and all unchanged.
Changes:
- Enables
fullyParallelfor theparallelproject. - Isolates classic-menu test data and adds locks for shared menu-location and privacy-page settings.
- Updates guidance on same-file test collisions and describe-group locks.
| File | Description |
|---|---|
tests/e2e/utils/locks.js |
Adds menu-location and privacy-page lock constants. |
tests/e2e/specs/privacy.test.js |
Locks tests that change the privacy-page setting. |
tests/e2e/specs/classic-menus.test.js |
Uses unique menu names, scoped cleanup, and a menu-location lock. |
tests/e2e/README.md |
Documents same-file concurrency and lock behavior. |
tests/e2e/playwright.config.js |
Enables full parallelism in the parallel project. |
Review effort: Balanced
lancewillett
left a comment
There was a problem hiding this comment.
The targeted menu/privacy runs passed all 12 executions with four workers, three repetitions and zero retries. Scoped menu cleanup preserved an unrelated menu and its secondary location. Removing only the privacy lock reproduced competing-setting failures; restoring it passed.
The configuration keeps the serial and all projects unchanged, and the existing shared-setting locks cover the affected writes. All four E2E CI jobs passed, with no reported retries. No blockers found.
AI review · gpt-6
Enable `fullyParallel` for the parallel project. Scope classic menu fixtures to each test and lock shared menu-location and privacy-page settings. Developed in: #15929 Props adrianmoldovanwp. See #66392. git-svn-id: https://develop.svn.wordpress.org/trunk@65439 602fd350-edb4-49c9-b593-d223f7449a82
|
PR #15929 landed in https://core.trac.wordpress.org/changeset/65439 |
Enable `fullyParallel` for the parallel project. Scope classic menu fixtures to each test and lock shared menu-location and privacy-page settings. Developed in: WordPress/wordpress-develop#15929 Props adrianmoldovanwp. See #66392. Built from https://develop.svn.wordpress.org/trunk@65439 git-svn-id: http://core.svn.wordpress.org/trunk@64578 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Trac ticket: https://core.trac.wordpress.org/ticket/66392
The
parallelproject ran the tests in one spec file in order, so only tests in different files ran at the same time. This PR turns onfullyParallelfor that project, so tests in the same file also run at the same time. Theserialandallprojects do not change.Two specs had tests that broke each other when they ran at the same time:
classic-menus.test.jsdeleted every menu before each test. Each test now creates menus with a unique name and deletes only those. Both tests hold a newNAV_MENU_LOCATIONSlock, because all menu locations are one shared theme setting. Assigning a menu and deleting any menu both write it.privacy.test.js, two runs of the privacy page test both wrote thepage_for_privacy_policysetting. One run then read the other run's page ID. The test now holds a newPRIVACY_POLICY_PAGElock, because one setting cannot be scoped to a test.The README now says that tests in one file can also collide.
Testing Instructions
npm run test:e2e -- --project=parallel --shuffle --repeat-each=3. All tests pass.grep -rn "{ lock:" tests/e2e/specs/. Each lock uses a constant fromtests/e2e/utils/locks.js.Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Code change, test runs and this description.
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.