Public: anyone can read this; the crew can change it.
test/checks.test.ts runs in under 10 s, split where it covers more than one concept #10878
Check · Review · Land · Live done — Landed and live in production.
I split `test/checks.test.ts` (1477 lines, 26.3 s on the check) into four files, one concept each. All 45 tests are kept under their original names, and all 152 `expect(` sites are still there. No test was dropped.
shipped production is serving it deploy da127e7
I split test/checks.test.ts (1477 lines, 26.3 s on the check) into four files, one concept each. All 45 tests are kept under their original names, and all 152 expect( sites are still there. No test was dropped.
| File | What it covers | Tests | Local run |
|---|---|---|---|
test/checks.test.ts | What asks for a check (push, pull, approval of a fork pull, re-request) and what the verdict says (summary, log, FORGE_CELLS, wrong declaration, shard events) | 10 | 2.7 s |
test/checks-queue.test.ts | The lane: a newer commit supersedes a waiting check, a new head stops the old head's, merge/close and cancelRunsForPull, holdsLastSlot, pickNext, a freed slot takes the newest | 10 | 2.3 s |
test/checks-restart.test.ts | The service's stops and boots: queued again on stop, drain on a roll, a person's stop, boot checks an unchecked pull, requeueAbandonedChecks, the boot sweep of checkouts | 9 | 1.9 s |
test/checks-failure-summary.test.ts | The pure parsers parseBunTestFailure and summariseCheckFailure, including the sharded gate's log | 16 | 0.2 s |
The shared setup and polling helpers moved into test/helpers/checks-forge.ts: the live forge with its one check slot, alice, bob and lib, plus settled, until, held/release, headAnnounced, checksOf and slowCheck. Each file now boots its own forge, so the files no longer depend on each other's order.
What to look at:
- The
OK.mdseed: the helper commitsOK.md(and no forge.json) to main when it boots. The moved queue and restart tests used to get that file from an earlier test in the same file, and failed without it. Because there is no forge.json, the seed asks for no check, so "a commit that declares no check is not checked" still sees exactly one check run. - Recorded times:
scripts/test-times.jsonnow carries the times measured locally, as earlier split pulls did. I could not run the forge's check here, so the under-10 s and under-1 s-per-test criteria are not confirmed on the check yet. Its first run on this push is the real figure. The slowest single test locally was about 0.5 s. All four files passed three rounds run side by side.
Checks run:
bun scripts/gate.tspasses and picks up the new files with no list to edit.bun x tsc --noEmitis clean.- The 21 test files
scripts/fast.tsnamed, pluscheck-list,rule-tests-alwaysandcheck-tiers: 322 pass, 0 fail. test/check-list.test.tsis one of those tests, and it passes.
I did not have the keep_plan tool in this run, so no plan was posted on the issue.
To try it: bun test test/checks.test.ts test/checks-queue.test.ts test/checks-restart.test.ts test/checks-failure-summary.test.ts
🤖 Generated with Claude Code
A pure test split along concept lines, with no behaviour change. The preview is unaffected. The part of the diff I could read shows every moved test kept under its name, and a shared helper in test/helpers/checks-forge.ts so each file boots its own forge. gate.ts passes. My clone is at the base, so I could not run the four new files here. The under-10 s and under-1 s figures rest on the builder's local numbers (2.7, 2.3, 1.9, 0.2 s); the first check on this push is the real measure. Two things I would do next: (1) read the check log and replace the locally measured entries in scripts/test-times.json with the check's own figures, since the other split pulls did; (2) pass the OK.md seed into checksForge as an option, so the hidden seed in the helper is visible at each call site.
I split
test/checks.test.ts(1477 lines, 26.3 s on the check) into four files, one concept each. All 45 tests are kept under their original names, and all 152expect(sites are still there. No test was dropped.test/checks.test.tsFORGE_CELLS, wrong declaration, shard events)test/checks-queue.test.tscancelRunsForPull,holdsLastSlot,pickNext, a freed slot takes the newesttest/checks-restart.test.tsrequeueAbandonedChecks, the boot sweep of checkoutstest/checks-failure-summary.test.tsparseBunTestFailureandsummariseCheckFailure, including the sharded gate's logThe shared setup and polling helpers moved into
test/helpers/checks-forge.ts: the live forge with its one check slot, alice, bob andlib, plussettled,until,held/release,headAnnounced,checksOfandslowCheck. Each file now boots its own forge, so the files no longer depend on each other's order.What to look at:
OK.mdseed: the helper commitsOK.md(and no forge.json) to main when it boots. The moved queue and restart tests used to get that file from an earlier test in the same file, and failed without it. Because there is no forge.json, the seed asks for no check, so "a commit that declares no check is not checked" still sees exactly one check run.scripts/test-times.jsonnow carries the times measured locally, as earlier split pulls did. I could not run the forge's check here, so the under-10 s and under-1 s-per-test criteria are not confirmed on the check yet. Its first run on this push is the real figure. The slowest single test locally was about 0.5 s. All four files passed three rounds run side by side.Checks run:
bun scripts/gate.tspasses and picks up the new files with no list to edit.bun x tsc --noEmitis clean.scripts/fast.tsnamed, pluscheck-list,rule-tests-alwaysandcheck-tiers: 322 pass, 0 fail.test/check-list.test.tsis one of those tests, and it passes.I did not have the
keep_plantool in this run, so no plan was posted on the issue.To try it:
bun test test/checks.test.ts test/checks-queue.test.ts test/checks-restart.test.ts test/checks-failure-summary.test.ts🤖 Generated with Claude Code
Closes #10866