Skip to content

CI: shard the UI tests across machines and merge the blob reports - #11

Merged
niranjankagri merged 2 commits into
mainfrom
ci/playwright-sharding
Nov 4, 2026
Merged

niranjankagri merged 2 commits into
mainfrom
ci/playwright-sharding

Conversation

@niranjankagri

Copy link
Copy Markdown
Owner

Adds Playwright sharding to CI.

What changes

  • shards job (7 jobs): API tests in one job, each browser's UI tests split with --shard=1/2 and --shard=2/2. Each uploads a blob report.
  • tests job, one per project (Tests (api), Tests (chromium), Tests (firefox), Tests (webkit)): merges that project's blob reports with playwright merge-reports --reporter junit,json and runs src/ci/check-merged-results.mts, which fails the job if a shard is missing or a test failed.
  • report job: still merges all blob reports into one HTML report.

Why it is built this way

  • The "Protect main" ruleset requires Tests (<project>). Those check names stay the same, so the ruleset doesn't need to change.
  • The junit-<project> and playwright-json-<project> artifacts that Quality Intelligence imports keep their names and content.

Checked locally

  • Chromium run as 2 shards (12 + 12 tests), then merged: the same 24 test keys as the unsharded main run 41627424324, with retry attempts kept (TC-116 shows as flaky, as before).
  • Gate script: passes when all shards are present with no failures; fails on a missing shard, on a failed test, and when there are no blobs at all.
  • npm run check green.

The trade-off: 7 jobs × 2 workers instead of 4 × 2 against the public demo shop. The README explains how to change the shard count.

🤖 Generated with Claude Code

niranjankagri and others added 2 commits November 4, 2026 10:45
Each browser's UI tests now run on 2 machines (--shard=1/2, 2/2), the API
tests stay in one job: 7 shard jobs instead of 4 project jobs. A Tests
(<project>) job per project merges that project's blob reports into the same
JUnit XML and JSON report an unsharded run wrote, so the ruleset's required
checks and the artifacts Quality Intelligence imports keep their names.
src/ci/check-merged-results.mts fails that job when a shard is missing or a
test failed. The final job still merges all blob reports into one HTML report.

Checked locally: chromium as 2 shards merged -> the same 24 test keys as the
unsharded main run 41627424324, retry attempts kept (TC-116 flaky).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The logged-in test user's profile address is already in the billing form,
so Proceed was enabled at once. When GET /postcode-lookup answered late
(CI), the order went out with the profile address (Stephansplatz 1, Vienna)
and POST /invoices answered 422 "The city does not belong to the selected
country". enterBillingAddress now waits for the lookup of the complete
address and for its street to be in the form.

Reproduced locally by delaying the lookup 3 s: old steps -> the same 422 with
the profile address in the body; fixed page object -> order confirmed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@niranjankagri

Copy link
Copy Markdown
Owner Author

CI failure: TC-116 (chromium) was a real test bug, not a flake. The billing form starts out holding the logged-in user's profile address, so Proceed is enabled right away. When GET /postcode-lookup answers late, the order is sent with the profile address (Stephansplatz 1, Vienna) and POST /invoices answers 422. This was reproduced locally by delaying the lookup by 3 s. Fix in 7bca7e6: enterBillingAddress now waits for the lookup and for its street to be in the form.

@niranjankagri
niranjankagri merged commit bf61ce7 into main Nov 4, 2026
24 of 26 checks passed
@niranjankagri
niranjankagri deleted the ci/playwright-sharding branch November 4, 2026 05:49
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