test(coverage-report): cover main()'s three unexecuted CLI paths - #719
Closed
hivecommons-hive[bot] wants to merge 1 commit into
Closed
hivecommons-hive[bot] wants to merge 1 commit into
hivecommons-hive[bot] wants to merge 1 commit into
Conversation
Adds tests/coverage-report-cli.test.mjs, covering the reporter CLI paths that tests/coverage-report.test.mjs cannot reach: it deletes NODE_V8_COVERAGE from the reporter subprocess, so the reporter's own execution is never recorded and only paths with an exit code of their own can be asserted on. Covers parseArgs' passthrough of a bare node --test argument (76-78), the "Not reported" notice for records made against loader-generated text (570-578), and the non-zero exit when the spawned suite fails (580-583). Line coverage of tests/tools/coverage-report.mjs moves 96.21 -> 98.35 and region coverage 93.10 -> 94.40. Closes #718 Signed-off-by: hivecommons-hive[bot] <hivecommons-hive@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 |
This was referenced Sep 27, 2026
Member
|
Superseded by #750, which consolidates this and 14 other test-only coverage PRs into a single reviewable change (commit cherry-picked unmodified, authorship and DCO preserved). |
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
Adds
tests/coverage-report-cli.test.mjs, covering the three paths inmain()oftests/tools/coverage-report.mjsthat no test executed.tests/coverage-report.test.mjsalready drives the reporter as a subprocess, but itsrunReporterhelper deletesNODE_V8_COVERAGEfrom the child environment, so nothing the reporter process does is recorded — only paths with an exit code of their own can be asserted on. The helper here keepsNODE_V8_COVERAGEand deletes onlyNODE_TEST_CONTEXT. That is safe: the reporter always overridesNODE_V8_COVERAGEfor thenode --testrun it spawns, so the grandchild still writes to its own directory and the counts merged into the suite come only from the reporter itself.What the three tests pin
--separator is passed through tonode --testrather than read as a flag, and narrows the run to exactly that one suiteNot reported (N)notice — the only signal that a file's coverage was recorded against loader-generated text and is missing from the table — and the count in the notice matches the files it listsTests failed; coverage above is reported for context., still renders the table, and does not report a--checkfailure, proving the suite failure takes precedence over the gatesThe failing fixture is written under
os.tmpdir()and removed in afinally, so it can never be picked up by a normalnode --testrun.Scope
Files:
tests/coverage-report-cli.test.mjs(new, only file touched).Functions:
main()andparseArgs()intests/tools/coverage-report.mjs, lines 76-78, 570-578, 580-583.Deliberately disjoint from the open region-coverage PRs:
collect()'s merge and record-skip paths (437-438, 447-448, 470-473) belong to #702, and thetryRemapJsx/decodeMappingsJSX-remap regions (409-410 and others) are claimed by no PR and are left for a separate change.Verification
tests/tools/coverage-report.mjsmoves from96.21 | 93.10to98.35 | 94.40(line | region); all-files line coverage moves from 99.09% to 99.14%.Related Issue
Closes #718
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.88