test(bundle): opt the node --check spawn out of NODE_V8_COVERAGE so the suite survives coverage.autoAttachSubprocess - #236
Open
hivecommons-hive[bot] wants to merge 1 commit into
Conversation
Node re-injects the parent's NODE_V8_COVERAGE into any child whose env lacks the key, and `node --check dist/index.js` aborts under it on Node 26 (WeakRef: invalid target in the source-map cache). Once vitest runs with coverage.autoAttachSubprocess the worker carries that variable and the bundle validity test fails. Pass an explicit empty value so the syntax check runs without coverage. Signed-off-by: quality <quality@hive.kubestellar.io>
Contributor
Author
|
Important Held for human review by the hive's ACMM level gate. This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Non-outreach agents are held at ACMM L3–L5; the Hive will automatically remove the |
Contributor
Author
|
/kind cleanup 🐝 Hive Agent: — hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
This was referenced Sep 30, 2026
Open
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Test Improvement
__tests__/bundle/bundle.test.tsonly — the one pushable piece of #235 that is not blocked by another open PR.is a syntactically valid bundle with no unresolved modulesrunsnode --check dist/index.jsviaspawnSyncwith the inherited env. Node re-injects the parent'sNODE_V8_COVERAGEinto any child whoseenvobject lacks that key, and on Node 26.10node --checkaborts under it:Today nothing sets the variable on the vitest worker, so the test passes. The moment
coverage.autoAttachSubprocess: trueis enabled (the vitest 5 option that makes the bundle e2e child's V8 coverage reach the report — see #235) the worker carriesNODE_V8_COVERAGEand this test is the only one in the suite that fails. Destructuring the key out ofprocess.envdoes not work, because Node re-adds it; an explicit empty string is the documented opt-out.Change:
spawnSync(..., { encoding: 'utf8', env: { ...process.env, NODE_V8_COVERAGE: '' } })plus a two-line comment.Verified on
main@ c48bd6d, Node v26.10.0:npx vitest run --coverage→ 69 files / 1447 tests pass,All files 99.83 | 98.35 | 100 | 99.82(unchanged)npx vitest run --coverage --coverage.autoAttachSubprocess→ 69 files / 1447 tests pass (without this change: 1 failed, the--checktest)npx eslint __tests__/bundle/bundle.test.tscleanDisjoint from every open hold-gated PR (#217, #219, #221, #223, #225, #227, #229, #230, #232, #234): none touch
__tests__/bundle/.Related Issue
Refs #235 (needs-human: the remaining deliverables —
coverage.autoAttachSubprocess: trueinvitest.config.mjs, which is occupied by #230 until it lands, and atsc --sourceMap→ncc -schain sodist/index.jshits remap tosrc/, which is a build-script change outside the quality lane — are laid out in the issue comment posted with this PR)Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88