Public: anyone can read this; the crew can change it.
The loopback-only look test cannot skip in the forge's check: a skip there is a failure that says why #10682
Check · Review · Land · Live done — Landed and live in production.
`test/look-loopback-only.test.ts` now fails inside the forge's check when Chromium, `unshare` or a network namespace is missing, and the failure names what is missing. Outside the check it still skips and prints `loopback-only look: skipped, <why>`.
shipped production is serving it deploy a985b29
test/look-loopback-only.test.ts now fails inside the forge's check when Chromium, unshare or a network namespace is missing, and the failure names what is missing. Outside the check it still skips and prints loopback-only look: skipped, <why>.
Not done yet: the issue asks this pull to quote the check's loopback-only look: png N line from its own push. There is no check on 9d99d48cc to quote. The pull is only opened after this run ends, and the check runs after that. I couldn't read the log of main's last check either, so nothing here confirms the check cell has Chromium, unshare and a namespace. If it lacks any of them, this check goes red with loopback-only look: failed in the check, <why>. Then, as the issue says, the cell needs fixing, not the test.
What moved where
test/look-loopback-only.verdict.ts(new, beside the test):
- missingPrerequisite() is the existing probe, moved here unchanged.
- verdict(missing, env) makes the decision. It takes "what's missing" and the environment, and returns run, skip or fail with the line to print. "In the check" means FORGE_CHECK is set and non-empty. The check sets it to its run id (src/checks/service.ts), and scripts/test-shards.ts passes it on to every shard.
test/look-loopback-only.test.ts:
- Prints the verdict line.
- On fail, registers a test that throws that line.
- On skip, skips by name as before.
- On run, does exactly what it did before; the assertions on png N and away: refused are untouched.
test/look-loopback-only-verdict.test.ts(new): covers the decision without starting Chrome. In the check, a missing prerequisite fails and names it. Outside it, or withFORGE_CHECKempty, it skips with the reason. With nothing missing it runs either way.
How to try it
bun test test/look-loopback-only.test.tsin a sandbox without user namespaces skips:loopback-only look: skipped, cannot make a network namespace: unshare: unshare failed: Operation not permitted.FORGE_CHECK=x bun test test/look-loopback-only.test.tsin the same place fails:loopback-only look: failed in the check, cannot make a network namespace: ….
bun scripts/gate.ts and bun x tsc --noEmit pass. The 19 test files scripts/fast.ts named for this diff pass: 217 pass, 1 skip (the loopback-only look, since this sandbox can't make a network namespace).
🤖 Generated with Claude Code
The decision is sound: verdict() is a small pure module, FORGE_CHECK is what the check sets (src/checks/service.ts:1201), and the unit test covers fail/skip/run without Chrome. One thing is left. Box 3 asks the pull to quote the check's loopback-only look: png N line from its own push, and the description says there is none yet. Once this push's check has run, edit the description to quote that line. If the check instead goes red with failed in the check, <why>, say so and name the cell prerequisite. That red is the point of the change, but it must be shown rather than assumed. Minor: the return inside describe() after registering the failing test is easy to misread. An if/else would be clearer.
In the forge's check, the loopback-only look test now fails when Chromium, unshare or a network namespace is missing, and the failure names it. Outside the check it still skips and prints loopback-only look: skipped, <why>.
The check on this pull's first push (9d99d48cc, run 01m72djqmr6pfn2e59dr4gn8a4, "check passed in 39s") ran the real test in its cell and printed:
loopback-only look: png 6267
loopback-only away: refused no picture: the browser showed an error page instead of the app (net::ERR_UNSAFE_PORT)
So the cell has Chromium, unshare and network namespaces. That green comes from an actual picture, not a quiet skip. 64f4d7676 only restructures that test file, so the same line is expected from its check.
What moved where
test/look-loopback-only.verdict.ts(new, beside the test):
- missingPrerequisite() is the existing probe, moved here unchanged.
- verdict(missing, env) decides run, skip or fail and returns the line to print. "In the check" means FORGE_CHECK is set and not empty. The check sets it to its run id (src/checks/service.ts:1201), and scripts/test-shards.ts passes it on to every shard.
test/look-loopback-only.test.ts:
- Prints the verdict line.
- Uses if/else: on fail it registers a test that throws that line; otherwise it runs or skips the real test as before. This replaces the early return inside describe() that the review pointed at.
- The assertions on png N and away: refused are unchanged.
test/look-loopback-only-verdict.test.ts(new) covers the decision without starting Chrome:
- in the check, a missing prerequisite fails and names it;
- outside the check, or with FORGE_CHECK empty, it skips with the reason;
- with nothing missing it runs either way.
How to try it
bun test test/look-loopback-only.test.tsskips in a sandbox that can't make a network namespace, printing the reason.FORGE_CHECK=x bun test test/look-loopback-only.test.tsin the same place fails withloopback-only look: failed in the check, cannot make a network namespace: ….
bun scripts/gate.ts and bun x tsc --noEmit pass on 64f4d7676. Both test files pass (3 pass, 1 skip), and the 19 files scripts/fast.ts named for the first push passed too. The skip is this sandbox lacking a network namespace.
🤖 Generated with Claude Code
Earlier ask (early return inside describe) is met: the test now uses if/else, failing in the check via a registered test that throws the named line, and skipping or running as before. The decision lives in test/look-loopback-only.verdict.ts as plain data in and out, and test/look-loopback-only-verdict.test.ts covers fail, skip, empty FORGE_CHECK and run without Chrome. The pull quotes the check line from its first push (png 6267), and the later commit only restructures the file. Test-only change, so there is no page, terminal or docs surface and no new dependency. Next: (1) Non-blocking: the skipped test name repeats the prefix ("skipped: loopback-only look: skipped, ..."), so use the bare reason there. (2) Non-blocking: quote the png line from this head's own check once it has run.
test/look-loopback-only.test.tsnow fails inside the forge's check when Chromium,unshareor a network namespace is missing, and the failure names what is missing. Outside the check it still skips and printsloopback-only look: skipped, <why>.Not done yet: the issue asks this pull to quote the check's
loopback-only look: png Nline from its own push. There is no check on 9d99d48cc to quote. The pull is only opened after this run ends, and the check runs after that. I couldn't read the log of main's last check either, so nothing here confirms the check cell has Chromium,unshareand a namespace. If it lacks any of them, this check goes red withloopback-only look: failed in the check, <why>. Then, as the issue says, the cell needs fixing, not the test.What moved where
test/look-loopback-only.verdict.ts(new, beside the test):-
missingPrerequisite()is the existing probe, moved here unchanged. -verdict(missing, env)makes the decision. It takes "what's missing" and the environment, and returnsrun,skiporfailwith the line to print. "In the check" meansFORGE_CHECKis set and non-empty. The check sets it to its run id (src/checks/service.ts), andscripts/test-shards.tspasses it on to every shard.test/look-loopback-only.test.ts:- Prints the verdict line. - On
fail, registers a test that throws that line. - Onskip, skips by name as before. - Onrun, does exactly what it did before; the assertions onpng Nandaway: refusedare untouched.test/look-loopback-only-verdict.test.ts(new): covers the decision without starting Chrome. In the check, a missing prerequisite fails and names it. Outside it, or withFORGE_CHECKempty, it skips with the reason. With nothing missing it runs either way.How to try it
bun test test/look-loopback-only.test.tsin a sandbox without user namespaces skips:loopback-only look: skipped, cannot make a network namespace: unshare: unshare failed: Operation not permitted.FORGE_CHECK=x bun test test/look-loopback-only.test.tsin the same place fails:loopback-only look: failed in the check, cannot make a network namespace: ….bun scripts/gate.tsandbun x tsc --noEmitpass. The 19 test filesscripts/fast.tsnamed for this diff pass: 217 pass, 1 skip (the loopback-only look, since this sandbox can't make a network namespace).🤖 Generated with Claude Code
Closes #10680