[quality] coverage gate exits 0 when the test run is killed by a signal (tests/tools/coverage-report.mjs:680 `?? 1` is untested)
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 84/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript, node.js
- Domain
- testing
Research direction
Start with tests/coverage-report-cli.test.mjs and its existing nonzero-status case, then inspect tests/tools/coverage-report.mjs around line 680. Run npm run test:unit:coverage while developing; done means a signal-terminated node --test run reaches the “Tests failed” path, exits 1, and the coverage tool reports 100.00% regions.
Written by the indexing model from the issue text.
Description
Finding
tests/tools/coverage-report.mjs is the tool behind npm run test:unit:coverage:check, the gate CI runs on every PR. Its one uncovered
region is the fallback that decides the exit code when the spawned suite did
not exit normally:
678 if (result.status !== 0) {
679 console.error('\nTests failed; coverage above is reported for context.');
680 process.exit(result.status ?? 1);
681 }
spawnSync reports a child terminated by a signal as status: null, not as a
number — and process.exit(null) exits 0. So without the ?? 1 the
reporter would print "Tests failed; coverage above is reported for context."
and then report success. A unit run cut short by the OOM killer or a job
timeout would satisfy the coverage gate on no evidence at all, and the only
trace would be a line on stderr that nothing reads when the job is green.
Nothing currently pins that. tests/coverage-report-cli.test.mjs covers the
sibling path — a suite that fails and exits 1 — but a numeric status never
reaches the ?? 1 arm. Deleting ?? 1 today leaves the whole suite green.
Evidence and provenance
- Unit:
npm run test:unit:coverage(TZ=UTC node tests/tools/coverage-report.mjs,
node v26.10.0) run locally 2026-10-04 atmainrev900592breports
tests/tools/coverage-report.mjsat100.00%lines /99.63%regions, with
line680as the sole uncovered region. - End-to-end: not applicable, and no claim is made. This file is a repository
test tool; it is not part of the site bundle and does not appear in the
End-to-end coveragereport (jobEnd-to-end coverage, run
37164361552,
artifacte2e-coverageid 11289266192, rev900592b), which measures
src/**only.
Recommendation
Add one case to tests/coverage-report-cli.test.mjs that drives the reporter
over a suite which kills node --test itself, so spawnSync returns
status: null, and assert the reporter exits 1 via the "Tests failed" path.
Three details make it deterministic:
process.ppidinside a test file is thenode --testrunner the reporter
spawned, one level below the reporter, so the suite can kill the runner
without touching the process under test.- SIGKILL, not SIGTERM: the runner handles SIGTERM and exits 1, which is the
numeric path already covered. - The killed runner flushes no profile and its orphan dies with it, so the
suite must callv8.takeCoverage()before the kill. Otherwise the reporter
stops atNo coverage data was recorded.and never reaches the exit path
under test — which also exits 1, so the assertion has to exclude it.
Completion criteria
-
tests/coverage-report-cli.test.mjscovers the signal-terminated run - Removing
?? 1fromtests/tools/coverage-report.mjs:680fails that test -
tests/tools/coverage-report.mjsreports 100.00% regions
Priority
- Impact: high (the gate can report success on a run that never finished)
- Effort: low
🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5n31 | SHA: 900592b
— hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.88
- Dominant language
- JavaScript
- Stars
- 0
- Forks
- 2
- Avg merge
- 8h 22m
- Merged PRs (30d)
- 600
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from cncf/endusers
-
[quality] initials() drops a letter when a name carries leading whitespacePossibly taken @hivecommons-hive claimed this today. Openagent/quality hive/claimed-by-scanner stage/040-covered-by-pr testing
Difficulty 1/5 1-3 hours Newbie friendliness 86/100
cncf/endusers#1639 · 2 comments ·
Maintainers usually reply within 1 day
-
[guide] SECURITY.md Scope omits composite actions from the CodeQL scan descriptionPossibly taken @hivecommons-hive claimed this today. Openagent/guide documentation hive/claimed-by-guide stage/040-covered-by-pr
Difficulty 1/5 Under an hour Newbie friendliness 25/100
cncf/endusers#1637 · 1 comment ·
Maintainers usually reply within 1 day
-
[quality] Nothing guards the camelCase JSX DOM prop convention #1603 established in the footerPossibly taken @hivecommons-hive claimed this today. Openagent/quality hive/claimed-by-quality stage/040-covered-by-pr testing
Difficulty 2/5 1-3 hours Newbie friendliness 20/100
cncf/endusers#1633 · 1 comment ·
Maintainers usually reply within 1 day
-
[scanner] a11y: member directory card button accessible name does not contain its visible text (WCAG 2.5.3)Possibly taken @hivecommons-hive claimed this today. Openagent/scanner bug hive/claimed-by-scanner stage/040-covered-by-pr
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
cncf/endusers#1630 · 1 comment ·
Maintainers usually reply within 1 day
-
[quality] test the e2e reporter's unexecuted-chunk arm, its only untested regionPossibly taken @hivecommons-hive claimed this today. Openagent/quality hive/claimed-by-quality stage/040-covered-by-pr testing
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
cncf/endusers#1625 · 5 comments ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Spomky-Labs/pwa-bundle#476 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
c1overzz/dsh-bili-scroll#35 ·
Maintainers usually reply within 1 day
-
needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
pbakaus/impeccable#1077 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day