ci: reduce Cypress parallelism from 6 shards to 2#40717
Conversation
|
Bito Automatic Review Skipped - Files Excluded |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #40717 +/- ##
==========================================
- Coverage 64.07% 64.07% -0.01%
==========================================
Files 2663 2663
Lines 143505 143505
Branches 32993 32993
==========================================
- Hits 91951 91950 -1
- Misses 49952 49953 +1
Partials 1602 1602
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@rusackas looks like some tests are't running and also we should see if we need to reduce the number of shards for playwright. I think currently playwright only runs on 1 shard. Something else is maybe update the cypress-matrix and run more tests per shard? |
Cypress is the largest consumer of CI runner minutes, but the suite it runs is now tiny: only 5 spec files / 31 test cases remain under cypress/e2e (the rest have migrated to Playwright and React Testing Library). Each matrix job still pays the full per-shard setup cost — Python, Postgres, test-data import, Node, npm install, instrumented asset build, Cypress install (~8-10 min) — before running its slice of those few specs. On master that means 6 shards x 2 app_roots = 12 Cypress jobs (~143 runner -minutes for the whole E2E workflow), and with only 5 specs the round-robin split leaves one shard empty — so a couple of those jobs spin up a full environment and run zero specs. The setup overhead, not the tests, dominates the cost. Cut the shard count to 2 (keeping PARALLELISM in sync with the round-robin split in scripts/cypress_run.py). Net jobs: pull_request 6 -> 2, push 12 -> 3 (2x "" + 1 smoke "/app/prefix"). Coverage is unchanged; every spec still runs, just with far less duplicated setup. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
68fa574 to
4280e0f
Compare
|
Robot comment incoming, but I think we can cut to 2 shards, since there's a lot less Cypress than there used to be. But it seems we're running all the things, unless you can point to anything missing that the bots aren't spotting. I had it look at how tests are loaded, and the 6-shard CI runs, to make sure we're catching everything here. |
|
Thanks @sadpandajoe — dug into this and nothing's being dropped, but the numbers are illuminating. There are only 5 Cypress spec files / 31 test cases left in the repo (the rest migrated to Playwright + RTL — e.g. #39071, #38924, #38368, #35938). On master today the matrix is 6 shards × 2 app_roots = 12 Cypress jobs, and with only 5 specs the round-robin leaves a shard empty — so a couple of those 12 jobs spin up the full env (Python + Postgres + Node + asset build, ~8–10 min) and run zero specs, and the rest run ~1 spec each. The whole E2E workflow burns ~143 runner-minutes to execute 31 short tests — almost entirely setup overhead. Per your "more tests per shard" point — exactly. I've cut this to 2 shards (
Good eye — though Playwright isn't sharded by Bigger picture: with only 5 specs left, it's probably worth finishing their migration to Playwright and retiring the Cypress job entirely. Out of scope here, but flagging it. |
SUMMARY
Cypress is the single largest consumer of CI runner-minutes — but the suite it
runs is now tiny. Only 5 spec files / 31 test cases remain under
cypress/e2e; the rest have been migrated to Playwright and React TestingLibrary. Yet every matrix job still pays the full per-shard setup cost — Python,
Postgres, test-data import, Node,
npm ci, instrumented asset build, Cypressinstall (~8–10 min) — before running its slice of those few specs.
On master that's 6 shards × 2 app_roots = 12 Cypress jobs (~143 runner-minutes
for the whole E2E workflow), and with only 5 specs the round-robin split
(
scripts/cypress_run.py) leaves a shard empty — so a couple of those jobs spinup a full environment and run zero specs. The setup overhead, not the tests,
dominates.
This cuts the shard count to 2 (
PARALLELISM: 2, kept in sync with theround-robin split — the two values must match). The push-only
/app/prefixvariant is smoke-tested on a single shard via
matrix.exclude.Net job counts:
""+ 1 smoke/app/prefix)Coverage is unchanged — every spec still runs (round-robin distributes all of
them across the shards), just with far less duplicated setup.
TESTING INSTRUCTIONS
CI-only change. On this PR, confirm exactly 2
cypress-matrixjobs run(app_root
""), all green. The/app/prefixsmoke shard only appears onpushevents to
master/release branches.ADDITIONAL INFORMATION
🤖 Generated with Claude Code