feat(test-runner): add --shuffle to run tests in random order - #42877
Conversation
Test results for "tests 1"8 flaky52096 passed, 1241 skipped Merge workflow run. |
Test results for "MCP"3 failed 8702 passed, 1474 skipped Merge workflow run. |
|
Hi, I'm the Playwright bot and I took a look at the red CI here. 🟢 All three MCP failures are pre-existing flakes — the PR is clearEach one has a history of failing on other SHAs and PRs in the aggregated CI results, and none of them touch the code this PR changes: DetailsPre-existing flake / infra
Why the diff can't reach them The runner change is gated on Triaged by the Playwright bot - agent run |
Yury Semikhatsky (yury-s)
left a comment
There was a problem hiding this comment.
Don't forget to add it to api review items.
| } | ||
|
|
||
| if (testRun.config.configCLIOverrides.shuffle) | ||
| shuffleTestGroups(phaseTestGroups, testRun.config.configCLIOverrides.shuffle); |
There was a problem hiding this comment.
Tests with beforeAll/afterAll can be placed in the same group and won't be shuffled with this approach. Maybe it's okay but perhaps you want to shuffle them too?
9234738
into
microsoft:main
Summary
npx playwright test --shuffle [seed]randomizes the order in which test groups are dispatched: files, and individual tests in parallel mode. Serial suites and phase/dependency ordering are preserved.metadata.shuffleSeed; pass it back to reproduce the order.Fixes #9297
Fixes #7040
Fixes #12512