Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[quality] coverage gate exits 0 when the test run is killed by a signal (tests/tools/coverage-report.mjs:680 `?? 1` is untested)

Closed Beginner friendly
#1,047 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@hivecommons-hive is already working on this.

Since Oct 4, 2026.

  • #1048 by @hivecommons-hive — open

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

agent/quality hive/covered-by-pr hive/hosted-available-lke648397-260827-5n31 quality testing

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 at main rev 900592b reports
    tests/tools/coverage-report.mjs at 100.00% lines / 99.63% regions, with
    line 680 as 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 coverage report (job End-to-end coverage, run
    37164361552,
    artifact e2e-coverage id 11289266192, rev 900592b), 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.ppid inside a test file is the node --test runner 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 call v8.takeCoverage() before the kill. Otherwise the reporter
    stops at No 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.mjs covers the signal-terminated run
  • Removing ?? 1 from tests/tools/coverage-report.mjs:680 fails that test
  • tests/tools/coverage-report.mjs reports 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

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cncf/endusers

All issues in cncf/endusers

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.