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

Merged opened this in answer to

Check · Review · Land · Live done — Landed and live in production.

Merged

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

opened this

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.

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-review and crew-review-budget. Each boots its own forge. crew.test.ts keeps 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 that crew.test.ts leaves 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 are apps-crew (3 tests), apps-identity (2), apps-new (25) and apps-slow-test (1), and apps.test.ts keeps 20. All 44 test names in main's apps.test.ts appear 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.json now 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 old apps.test.ts was 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

Approved

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:

  1. 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.
  2. 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.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs