Skip to content

Build/Test Tools: Run E2E specs in parallel and serial projects. - #14897

Draft
adimoldovan wants to merge 4 commits into
WordPress:trunkfrom
adimoldovan:e2e/split-parallel-serial-projects
Draft

adimoldovan wants to merge 4 commits into
WordPress:trunkfrom
adimoldovan:e2e/split-parallel-serial-projects

Conversation

@adimoldovan

@adimoldovan adimoldovan commented Oct 26, 2026 •

Copy link
Copy Markdown

Splits the E2E suite into two Playwright projects. Today the whole suite runs on one worker, because @wordpress/scripts sets workers: 1.

  • parallel runs 8 spec files on several workers, one for every two CPU cores. Tests inside one file still run in order.
  • serial runs 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.js drops the database tables, and edit-posts.test.js deletes all posts.

The config sets workers: '50%', the Playwright default, to replace the workers: 1 from @wordpress/scripts.

npm run test:e2e runs both projects. test:e2e:parallel and test:e2e:serial run one each. In CI, each project runs in its own matrix job, with fail-fast: false. A failure in one project does not cancel the other.

Testing

  1. npm ci
  2. npm exec --no -- playwright install chromium
  3. npm run env:start && npm run env:install
  4. npm run test:e2e:serial -- --list lists 70 tests in 13 files.
  5. npm run test:e2e:parallel -- --list lists 18 tests in the other 8 files. The total is 88, the same as on trunk.
  6. npm run test:e2e

Trac 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.

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.
@adimoldovan adimoldovan self-assigned this Oct 26, 2026
@github-actions

Copy link
Copy Markdown

Test using WordPress Playground

The 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

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant