You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug][CI]: cold-spawn warm-up coverage accepts an unused import or comment as execution proof #5060
An unused import, comment or string literal therefore satisfies the guard after the real beforeAll call is removed. The measured child then pays the cold module-graph cost again while the coverage test remains green.
Expected behaviour
Verify an actual top-level warm-up registration/invocation for every warmed: true disposition. Use the existing Bun syntax scanner or another structured check to require a call to warmColdSpawn or warmModuleGraph; string presence is not execution evidence.
Required regressions
unused import only fails;
comment/string literal only fails;
imported helper with no call fails;
a valid beforeAll registration with a warm-up call passes; and
an unwarmed disposition still requires its documented reason and forbids an active call.
Scope clarification
The separate automated suggestion that Bun.Transpiler.scanImports misses re-export edges does not reproduce on the bundled runtime: named, star and namespace re-exports all appear as import-statement entries. This issue tracks only the verified invocation-oracle gap.
Fixed on dev by #5080, merged as the commit above.
The guard no longer asks whether a file's text contains the warm-up module path. It recognises a small set of exact shapes and refuses everything else by line number:
hook-statement describe(...)* > beforeAll(async () => { ... await W(...); ... })
hook-return describe(...)* > beforeAll(() => { return W(...); })
hook-expression describe(...)* > beforeAll(() => W(...)) and its awaited form
module-top-level await W(...); as a whole statement at the top level
W has to come from a direct named import of the helper, aliases followed, and describe and beforeAll have to be direct named imports of bun:test that are not rebound anywhere in the file. A hook inside describe.skip or a conditional describe is a registration in shape only and is refused, because that suite never runs.
The first draft went the other way and tried to model the grammar generally. Review found it accepted register(() => beforeAll(async () => { await W(options); })), where the hook is never registered, and accepted a locally shadowed const beforeAll = () => {}. Both are false passes, which is the exact failure this guard exists to remove, so the accept-set was narrowed instead. TypeScript 7.0.2 publishes no in-process parser, so the alternative was reconstructing scoping from tokens where every wrong guess is a false pass.
Shapes that do warm at run time are refused too — a namespace import, a barrel re-export, an alias through a variable, a call in a scope the judge does not model. That is deliberate rather than a backlog: a refusal is loud, located, and a legitimate file needing one records it in its disposition, which keeps the refusal itself under test.
What this does not claim: a structural check does not prove execution. The helper still prints one completion line per warmed graph on every hosted run, and that remains the separate execution oracle.
CI at the exact head 151e52ac3c was green on every leg. No local suite was run.
Activity
fix(tests): judge cold-spawn warm-up registration structurally (#5080)
lidge-jun commentedon Sep 19, 2026
Fixed on
devby #5080, merged as the commit above.The guard no longer asks whether a file's text contains the warm-up module path. It recognises a small set of exact shapes and refuses everything else by line number:
W has to come from a direct named import of the helper, aliases followed, and
describeandbeforeAllhave to be direct named imports ofbun:testthat are not rebound anywhere in the file. A hook insidedescribe.skipor a conditional describe is a registration in shape only and is refused, because that suite never runs.The first draft went the other way and tried to model the grammar generally. Review found it accepted
register(() => beforeAll(async () => { await W(options); })), where the hook is never registered, and accepted a locally shadowedconst beforeAll = () => {}. Both are false passes, which is the exact failure this guard exists to remove, so the accept-set was narrowed instead. TypeScript 7.0.2 publishes no in-process parser, so the alternative was reconstructing scoping from tokens where every wrong guess is a false pass.Shapes that do warm at run time are refused too — a namespace import, a barrel re-export, an alias through a variable, a call in a scope the judge does not model. That is deliberate rather than a backlog: a refusal is loud, located, and a legitimate file needing one records it in its disposition, which keeps the refusal itself under test.
What this does not claim: a structural check does not prove execution. The helper still prints one completion line per warmed graph on every hosted run, and that remains the separate execution oracle.
CI at the exact head
151e52ac3cwas green on every leg. No local suite was run.