ci: run unit tests once, outside the dev-infra test matrix by matthieusieben · Pull Request #6045 · bluesky-social/atproto
Pull request (OPEN) · PR #6045 ci: run unit tests once, outside the dev-infra test matrix · @matthieusieben Why
Each of the 8 Test (k/8) shards ran every package's suite via pnpm -r test . That command is topologically sorted (pnpm's default --sort ), so in every shard:
the ~40 unit packages ran first (12–55s),
then pds alone (it waits for its dependencies' tests),
then bsky ∥ ozone , which start the same second pds finishes.
Shard critical path = unit packages → pds → max(bsky, ozone). Per-shard breakdown from run 45984477522 (seconds):
shard
unit pkgs done
pds
bsky
ozone
test step
1
44
96
171
207
331
2
55
67
181
438
532
3
24
96
128
267
387
4
30
40
122
266
336
5
37
71
178
152
286
6
39
40
246
241
326
7
12
32
207
267
311
8
20
55
131
109
206
(Per-package vitest startup is ~0.6s, so it isn't the cost. The cost is the ordering, and each unit package running 8 times.)
What
Test (unit) job (ubuntu-latest, no docker, no puppeteer): pnpm test:unit (root vitest.config.ts projects), plus a temporary step for the jest packages that don't need dev-infra ( api , common-web , crypto , did , identity , lexicon , repo , xrpc-server ).
Test (k/8) matrix now runs pnpm test:integration : only bsky , bsync , ozone , pds , sync , with --no-sort --workspace-concurrency=Infinity , so pds, bsky and ozone start at t=0. Expected critical path ≈ max(pds, bsky, ozone) per shard.
Removes test:withFlags (CI-only alias).
Testing skill: documents that the two root scripts cover disjoint sets and a new tested package must join one of them. Also removes the stale note that lexicon-resolver is missing from vitest.config.ts .
Every package with a test script is in exactly one of: root vitest projects, the temporary jest step, or the test:integration filter (checked locally).
What to look for in this PR's CI run
Slowest Test (k/8) vs ~530s today. Shard 2 is bounded by ozone ( report-close-reports.test.ts alone takes 235s). The ozone fix is a separate PR.
Whether running pds, bsky and ozone concurrently on the 4-vCPU runner slows each of them (CPU contention).
Test (unit) duration. It runs in parallel with the matrix.
Follow-ups
Once the jest → vitest migration of the non-infra packages lands, delete the temporary jest step. Those packages then run under pnpm test:unit .
Not handled here: a new package with tests can silently fall outside both sets. A verify: check could catch it if we want one.
🤖 Generated with Claude Code Ouvrir sur GitHub →