Repository navigation
Build/Test Tools: Run the post list E2E specs in parallel. - #15901
adimoldovan wants to merge 7 commits into
Conversation
Four specs deleted every post or read the whole post list, so they ran in the serial project. Each test now creates, finds and deletes only its own posts. The Empty Trash tests move to their own serial spec, because emptying the trash deletes every trashed post. `userFactory` teardown now force-deletes all of the user's posts, not only auto-drafts, so Quick Draft posts do not stay in the trash. See #66392.
There was a problem hiding this comment.
🟡 Changes recommended
Fixture teardown deletes only the first 100 posts, so users with more posts leave content behind after deletion, violating the cleanup guarantee.
1 open issue
What changed in this PR
This PR prepares post-list E2E specs for parallel execution by isolating test data and keeping destructive, site-wide trash operations in the serial project.
Changes:
- Replace shared post cleanup with fixture-created posts and title-, ID-, or author-scoped checks.
- Move four specs to the parallel project and extract the Empty Trash group into a serial-only spec.
- Expand user-fixture cleanup to force-delete users’ posts and update the documentation.
| File | Description |
|---|---|
tests/e2e/specs/empty-trash.test.js |
Holds the extracted serial-only trash tests. |
tests/e2e/specs/empty-trash-restore-trashed-posts.test.js |
Removes the group requiring global post cleanup. |
tests/e2e/specs/edit-posts.test.js |
Uses fixture-owned posts and scoped list checks. |
tests/e2e/specs/dashboard.test.js |
Isolates Quick Draft tests by user and author. |
tests/e2e/specs/cache-control-headers-directives.test.js |
Uses a fixture-created post and its actual URL. |
tests/e2e/README.md |
Documents expanded user-fixture cleanup. |
tests/e2e/playwright.config.js |
Updates serial exclusions to enable parallel execution. |
tests/e2e/fixtures/user.js |
Broadens post cleanup before deleting fixture users. |
Review effort: Balanced
…first 100. 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:
|
…llel # Conflicts: # tests/e2e/README.md
lancewillett
left a comment
There was a problem hiding this comment.
The scoped post reads and serial Empty Trash split look sound. One evidence question remains on the broader user-fixture cleanup, noted inline.
Small naming follow-up: the first edit-posts test now checks empty search results rather than an empty site; please update its name accordingly.
AI review · gpt-6
…llel # Conflicts: # tests/e2e/playwright.config.js
|
Renamed in 55eb096. |
The shared user fixture keeps its trunk teardown. The Quick Draft tests now force-delete their user's drafts, which user deletion would move to the trash. See #66392.
lancewillett
left a comment
There was a problem hiding this comment.
Thanks for narrowing saved-draft cleanup to Quick Draft and restoring the shared user fixture. That addresses my remaining concern.
The 20 affected parallel tests passed locally with four workers and zero retries. The existing Quick Draft comparison confirmed that its saved draft is removed while unrelated content survives; failure probes confirmed cleanup errors remain visible. The two moved Empty Trash tests were not rerun locally, but both serial CI jobs passed. All four E2E CI jobs and the refreshed Copilot review are clear.
AI review · gpt-6
Scope post fixtures and list assertions to each test, and keep Empty Trash tests serial. Clean up saved drafts within Quick Draft's own tests. Developed in: #15901 Props adrianmoldovanwp. See #66392. git-svn-id: https://develop.svn.wordpress.org/trunk@65412 602fd350-edb4-49c9-b593-d223f7449a82
Scope post fixtures and list assertions to each test, and keep Empty Trash tests serial. Clean up saved drafts within Quick Draft's own tests. Developed in: WordPress/wordpress-develop#15901 Props adrianmoldovanwp. See #66392. Built from https://develop.svn.wordpress.org/trunk@65412 git-svn-id: http://core.svn.wordpress.org/trunk@64551 1a063a9b-81f0-0310-95a4-ce76da25c4cd
|
PR #15901 landed in https://core.trac.wordpress.org/changeset/65412 |

Trac ticket: https://core.trac.wordpress.org/ticket/66392
cache-control-headers-directives.test.js,dashboard.test.js,edit-posts.test.jsandempty-trash-restore-trashed-posts.test.jsran in theserialproject. Their tests deleted every post, or checked the whole post list, so a test on another worker could break them.Each test in these specs that needs posts now creates its own, finds them by link, unique title or author, and deletes them when it ends. The specs move to the
parallelproject.postFactoryand a unique title, then search the post list for that title. The empty-list test now searches for a random UUID, so it checks an empty search result instead of an empty site.edit.php?author=<id>) then show only that user's drafts.empty-trash.test.js, which stays inserial. Emptying the trash deletes every trashed post, so no scope can make these tests safe in parallel.Each Quick Draft test force-deletes its user's drafts when it ends. Without this, deleting the user would move the drafts to the trash.
Testing Instructions
npm run test:e2e -- cache-control edit-posts empty-trash dashboard. All 22 tests pass.npm run test:e2e -- --project=serial empty-trash. Both tests pass.npm run test:e2e -- --project=parallel --shuffle --repeat-each=3 cache-control edit-posts empty-trash-restore dashboard. All tests pass.npm run env:cli -- post list --post_type=post --post_status=any,trash --fields=post_title,post_status. No post hasQuick Draft test titleor a title from these specs followed by a UUID.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.