Repository navigation
Build/Test Tools: Run E2E specs in parallel and serial projects. - #14897
Draft
adimoldovan wants to merge 4 commits into
Draft
adimoldovan wants to merge 4 commits into
adimoldovan wants to merge 4 commits into
Conversation
The E2E suite runs on one worker. Split it into two Playwright projects: - `parallel` runs 15 spec files on several workers. - `serial` runs the 6 specs that break the site for other tests, on one worker. Each project has its own npm script. CI runs each project in a separate matrix job, so a failure in one project does not hide the results of the other.
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. |
The base config from `@wordpress/scripts` sets `workers: 1` for the whole run, so the `parallel` project ran on one worker. Set `workers: '50%'` at the top level. This is the Playwright default. Move the 7 specs that delete all posts or media to `serial`. On several workers, they delete content that tests on other workers use.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Splits the E2E suite into two Playwright projects. Today the whole suite runs on one worker, because
@wordpress/scriptssetsworkers: 1.parallelruns 8 spec files on several workers, one for every two CPU cores. Tests inside one file still run in order.serialruns the other 13 spec files on one worker. These specs break the site for other tests or delete content that other tests use. For example,install.test.jsdrops the database tables, andedit-posts.test.jsdeletes all posts.The config sets
workers: '50%', the Playwright default, to replace theworkers: 1from@wordpress/scripts.npm run test:e2eruns both projects.test:e2e:parallelandtest:e2e:serialrun one each. In CI, each project runs in its own matrix job, withfail-fast: false. A failure in one project does not cancel the other.Testing
npm cinpm exec --no -- playwright install chromiumnpm run env:start && npm run env:installnpm run test:e2e:serial -- --listlists 70 tests in 13 files.npm run test:e2e:parallel -- --listlists 18 tests in the other 8 files. The total is 88, the same as ontrunk.npm run test:e2eTrac ticket: TBD
Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Config, scripts, workflow change, test runs and this description. I reviewed the result.
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.