Repository navigation
test(machine-profile): split the contract test in two to shorten the integration lane - #4552
Conversation
…integration lane server/machine-profile.contract.test.ts ran alone on one integration shard for ~172 s while the other seven ended at ~162 s. Its cases move unchanged into machine-profile-lifecycle.contract.test.ts (42) and machine-profile-api.contract.test.ts (63); the setup both use moves into machine-profile.test-helpers.ts. The timings table names the two halves, and the entryCommand convention skips *.test-helpers.ts as it skips *.test.ts: a test helper runs from a checkout, never in the compiled binary.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 4 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
Merged through Test-only move (split of server/machine-profile.contract.test.ts). CodeRabbit hit its review limit on this head; reviews that ran: a gate review by omo-native-gate-reviewer (APPROVE, re-checked move-only, cleanup per file and the conventions exemption) at a1e3fca's parent, per the test-bundles-b3-b6 lane brief (owner OK 2026-11-24). Head adds only a merge of origin/main. |
|
Measured in this PR's CI (Integration tests job): |
What
Test bundle B6 of the test-suite plan (T8):
server/machine-profile.contract.test.ts(105 tests, ~172 s in CI) alone decided when the integration lane ended. It is split, move-only, into two files of about equal runtime:server/machine-profile-lifecycle.contract.test.ts(42 tests): start and refusal rules, state-folder ownership, folder and socket safety, an ordinary server beside a profile.server/machine-profile-api.contract.test.ts(63 tests; git sees it as the rename): herdr socket selection,/api/sessionand/api/machines, who can reach the profile, how failed herdr calls are worded.server/machine-profile.test-helpers.ts: the setup both halves use, moved unchanged withexportadded (likeserver/websocket.test-helpers.ts). Helpers only one half uses stay in that half.scripts/ci-test-timings.json: the old entry (152) becomesmachine-profile-api77 andmachine-profile-lifecycle67, by the measured ratio.scripts/ci-tests.tsalready routes every*.contract.test.tsto the integration suite.server/conventions.test.ts: the "start the server only through entryCommand" rule skips*.test-helpers.tsas it already skips*.test.ts. Movinglaunch()into the shared helper tripped it; a test helper runs from a checkout and is never compiled into the binary, which is what the rule protects.No production code changes.
Evidence
Same tests, same results. The original file on the unchanged base (origin/main 1d71a71) through
bun run check run(its own herdr session), against both new files run at the same time, each on its own session:The (result, test name) pairs match exactly. The skip is the Windows-only test. The 4 failures fail identically on the base and only on this PC: herdr session discovery skips sockets under the required
TMPDIRin~/.cache(throwawayPath); they pass in CI (main run 45279571403 had 0 failures).Time (local, loaded P620)
Integration lane. Replaying main run 45279571403's per-file times through the runner's longest-first queue (8 shards): before 171.7 s (the real run ended at 172.0 s, with the old file alone keeping shard 1 busy for 171.7 s while the other shards ended about 161.6 s); after about 162.0 s. The floor is now the total work over 8 shards (161.8 s); the next longest file is
server/pending-input.contract.test.tsat 154.1 s, so no single file decides the lane's end any more. This PR's own Integration job gives the measured after-time.Move-only.
git diff --color-moved=zebra origin/main...HEADmarks 535 of 572 added and 535 of 553 removed lines as moved; the rest are imports,exportkeywords, one copiedafterEachcleanup line, a comment on where the Windows test lives, the two timings entries and the conventions filter. No test body changed.Validation
bun run typecheck: ok.scripts/ci-test-timings.test.ts,server/conventions.test.ts: pass.bun run check fast(P620, 225 s): typecheck, build, generated files ok; unit 24,886 pass, 160 skip, 1 fail:scripts/conventions.test.ts"waits marked fixed" onscripts/relay-new-pc-press-regression.ts:180, which fails onorigin/mainitself (1d71a71) and is fixed by test(relay): the new-PC press check polls for a join instead of a fixed wait #4547; this PR does not touch that file. The branch takes main in once test(relay): the new-PC press check polls for a join instead of a fixed wait #4547 lands.