Skip to content

ci(e2e): assign spec directories to shards by measured duration - #3410

Merged
tyler-dane merged 3 commits into
mainfrom
ci/e2e-shards-by-duration
Sep 5, 2026
Merged

ci(e2e): assign spec directories to shards by measured duration#3410
tyler-dane merged 3 commits into
mainfrom
ci/e2e-shards-by-duration

Conversation

@tyler-dane

Copy link
Copy Markdown
Contributor

Fixes: no issue. Fourth fix from the CI audit (#3407, #3408, #3409).

What and why

Playwright's --shard=n/4 splits by test count, and a spec file goes to the shard that contains its first test, so large files spill. The audit measured shard 4 (oauth, onboarding, timed) at 2m16s of tests as the critical path of every e2e run while shard 3 (calendars, life, navigation) finished its tests in 26s. Total test time is about 6 minutes, so an even split is about 1m30s per shard.

This replaces --shard with a hand-assigned directory list per shard, sized from the measured shard timings and the per-file ratios inside each shard:

Shard Directories Tests Estimated tests step
1 accessibility, allday 32 ~92s
2 booking 48 ~90s
3 timed, oauth 18 ~93s
4 onboarding, calendars, life, navigation, attendees 33 ~91s

The four lists select 32 + 48 + 18 + 33 = 131 tests, the full suite, with no directory in two lists (checked with playwright test --list). The price of a hand list is that a new e2e/ directory could silently never run in CI. packages/scripts/src/testing/e2e-shards.test.ts is that price: it fails when a directory with specs is missing from every list or appears in two, and it fails when the run step stops passing the list to Playwright. Verified by removing e2e/oauth from the matrix locally: the test fails with the missing directory in the diff.

Shard job names change from e2e-shard (1) to e2e-shard (1, e2e/accessibility e2e/allday). The required e2e gate is unchanged, so no ruleset change.

Also records the measured after numbers for #3407 (Install Bun 3s to 7s per shard, no tail) and #3408 in docs/CI-CD/ci-audit-2026-09.md.

Verify

Selected packages: scripts
Checks run: type-check, lint, knip
Checks skipped: (none)
Failed: test:scripts:fast
VERDICT: FAIL

The three failures are the same as in #3407 and #3408: agent-loop-next.sh uses mapfile, which macOS /bin/bash 3.2 lacks; not touched by this diff, passes on Linux. The new contract test, all other scripts tests, type-check, lint, and knip pass locally. This PR's own e2e run is the first measurement of the new split; CI on Linux is the arbiter.

🤖 Generated with Claude Code

Playwright's --shard splits by test count and a file lands where its first
test falls. In the 2026-09 audit that left shard 4 (timed, onboarding) at
2m16s of tests as the run's critical path while shard 3 finished in 26s.
Hand-assigned directory lists sized from the measured shard timings put
each shard near 90s, about 40s off every e2e run.

A contract test fails when an e2e/ directory with specs is missing from
every list or appears in two, so a new directory cannot silently skip CI.

Records the after numbers for #3407 and #3408 in the audit doc.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@tyler-dane tyler-dane added the agent-automerge Agent-loop finished; merge-guard may squash-merge label Sep 5, 2026
@tyler-dane
tyler-dane enabled auto-merge September 5, 2026 14:59
tyler-dane and others added 2 commits September 5, 2026 09:03
First run measured timed at 110s with oauth against booking at 78s.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
actionlint reads directives from the script body, not the YAML above it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@tyler-dane
tyler-dane added this pull request to the merge queue Sep 5, 2026
Merged via the queue into main with commit eb8523b Sep 5, 2026
23 checks passed
@tyler-dane
tyler-dane deleted the ci/e2e-shards-by-duration branch September 5, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-automerge Agent-loop finished; merge-guard may squash-merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant