Skip to content

test_runner: add --test-coverage flag - #63507

Open
mcollina wants to merge 2 commits into
nodejs:mainfrom
mcollina:test-runner-test-coverage-flag
Open

mcollina wants to merge 2 commits into
nodejs:mainfrom
mcollina:test-runner-test-coverage-flag

Conversation

@mcollina

@mcollina mcollina commented May 23, 2026 •

Copy link
Copy Markdown
Member

Summary

  • add a stable --test-coverage flag and keep --experimental-test-coverage as an alias
  • update the test runner, docs, and config schema to use the stable flag as the canonical name
  • filter the legacy alias from child run() propagation so coverage is not re-enabled in child tests

Testing

python3 tools/test.py \
  test/parallel/test-runner-flag-propagation.js \
  test/parallel/test-runner-coverage.js \
  test/parallel/test-runner-coverage-thresholds.js \
  test/parallel/test-runner-coverage-source-map.js \
  test/parallel/test-runner-coverage-default-exclusion.mjs \
  test/parallel/test-runner-cli.js \
  test/parallel/test-config-file.js \
  test/test-runner/test-output-typescript-coverage.mjs \
  test/test-runner/test-output-coverage-with-mock.mjs

Fix: #63506

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/config
  • @nodejs/test_runner

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs involving general changes in the lib/ or src/ directories. needs-ci PRs that need a full CI run. labels May 23, 2026
@codecov

codecov Bot commented May 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.50%. Comparing base (df2ea49) to head (14a1fd3).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #63507      +/-   ##
==========================================
- Coverage   90.51%   90.50%   -0.02%     
==========================================
  Files         797      797              
  Lines      278252   278257       +5     
  Branches    53472    53463       -9     
==========================================
- Hits       251868   251832      -36     
- Misses      16761    16806      +45     
+ Partials     9623     9619       -4     
Files with missing lines Coverage Δ
lib/internal/process/pre_execution.js 96.50% <100.00%> (-0.01%) ⬇️
lib/internal/test_runner/runner.js 95.14% <100.00%> (+<0.01%) ⬆️
lib/internal/test_runner/utils.js 66.30% <100.00%> (+0.13%) ⬆️
src/node_options.cc 81.92% <100.00%> (+0.09%) ⬆️

... and 32 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread doc/api/cli.md Outdated
Comment thread doc/api/test.md Outdated
@@ -847,7 +847,7 @@ and configuration files are inherited by the child processes.

> Stability: 1 - Experimental

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isnt it stable?

@MoLow MoLow left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mcollina
mcollina force-pushed the test-runner-test-coverage-flag branch from 88f237c to af488c6 Compare June 1, 2026 07:15
@mcollina
mcollina force-pushed the test-runner-test-coverage-flag branch 2 times, most recently from 14a1fd3 to 8f6a783 Compare October 20, 2026 20:47
mcollina and others added 2 commits October 20, 2026 20:49
Signed-off-by: Matteo Collina <matteo.collina@gmail.com>
Update the --test-coverage changelog to reflect that the flag was promoted
to stable in addition to being renamed from --experimental-test-coverage.

Signed-off-by: Matteo Collina <matteo.collina@gmail.com>
Assisted-by: pi
@mcollina
mcollina force-pushed the test-runner-test-coverage-flag branch from 8f6a783 to 5b20090 Compare October 20, 2026 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs involving general changes in the lib/ or src/ directories. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test_runner: tracking issue for code coverage stabilization

4 participants