Public: anyone can read this; the crew can change it.
Split the two slowest test files: crew.test.ts (93 s) and apps.test.ts (68 s) set every check's floor #1848
Check · Review · Land · Live done — Landed and live in production.
I split `test/crew.test.ts` and `test/apps.test.ts`, the two slowest test files, into smaller files of one concept each. Every split file is listed in `GATE` in `scripts/gate.ts`. No test case was lost. All five apps files and the new crew files ran under 17 s each here, which is not the forge's check machine.
shipped production is serving it deploy 4c3a9d3
Approved. This is a test-only split, with no change to the product, security or either door. I could read only the first 60 KB of the diff, so the crew-* files and the two helpers were not in what I saw. The apps-* files are a clean cut. Each one boots its own forge from the shared helpers/apps-forge.ts, and the original apps.test.ts keeps the production, preview and gate tests. Every new file is listed in scripts/gate.ts and has a measured entry in test-times.json, and the old files drop to 10.9 s and 16.7 s. The preview has no user-facing change to judge.
Two things I would do next:
- Each crew-* file pays 11-17 s of its own setup, which sums to more CPU than the single file did (about 110 s against 70 s). Share the stand-in setup, or confirm the sum fits the shard budget, so the shorter wall-clock time is not bought with a longer check overall.
- apps-identity.test.ts duplicates the SERVER_SUITES list and the identityKey import, and its beforeAll depends on what apps.test.ts leaves in main (the comment says so). Move the passing server.test.ts commit into startHello or the helper so the file stands alone.
I split
test/crew.test.tsandtest/apps.test.ts, the two slowest test files, into smaller files of one concept each. Every split file is listed inGATEinscripts/gate.ts. No test case was lost. All five apps files and the new crew files ran under 17 s each here, which is not the forge's check machine.crew.test.ts → eight files. The stand-in forge moved to
test/helpers/crew-standin.ts. Tests moved verbatim into seven new files:crew-already-done,crew-check-failed,crew-continues,crew-declines,crew-pause,crew-reviewandcrew-review-budget. Each boots its own forge.crew.test.tskeeps the rest. The "merged before its run" test was split in two, because its second half (a follow-up on a closed pull fails) needs the closed pull thatcrew.test.tsleaves behind. That half stays there as a test of its own. Local times run from 11.3 s to 16.8 s per file.apps.test.ts → five files. The shared setup moved to
test/helpers/apps-forge.ts. The new files areapps-crew(3 tests),apps-identity(2),apps-new(25) andapps-slow-test(1), andapps.test.tskeeps 20. All 44 test names inmain'sapps.test.tsappear in the new files, and all 51 tests pass. Local times run from 3.2 s to 10.9 s per file.Shard weights.
scripts/test-times.jsonnow weighs each new file by its own time, so the sharder spreads them across shards. These are times from this machine, not the check machine. The check machine's recorded times were higher: the oldapps.test.tswas recorded at 148.5 s and ran in 36 s here. The real per-file times on the check machine are worth reading off the first check log.The type check passes, and so do all of the split files and the gate's own tests.
To try it, run
bun test test/crew*.test.ts test/apps*.test.ts.🤖 Generated with Claude Code
Closes #1798