Skip to content

test_runner: add --test-coverage flag#63507

Open
mcollina wants to merge 1 commit into
nodejs:mainfrom
mcollina:test-runner-test-coverage-flag
Open

test_runner: add --test-coverage flag#63507
mcollina wants to merge 1 commit into
nodejs:mainfrom
mcollina:test-runner-test-coverage-flag

Conversation

@mcollina
Copy link
Copy Markdown
Member

@mcollina mcollina commented May 23, 2026

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

Signed-off-by: Matteo Collina <matteo.collina@gmail.com>
@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 related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels May 23, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.14%. Comparing base (8d3245e) to head (88f237c).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #63507      +/-   ##
==========================================
- Coverage   90.14%   90.14%   -0.01%     
==========================================
  Files         718      718              
  Lines      227984   227985       +1     
  Branches    42835    42832       -3     
==========================================
- Hits       205522   205516       -6     
- Misses      14235    14241       +6     
- Partials     8227     8228       +1     
Files with missing lines Coverage Δ
lib/internal/process/pre_execution.js 98.03% <100.00%> (+0.24%) ⬆️
lib/internal/test_runner/runner.js 93.62% <100.00%> (+<0.01%) ⬆️
lib/internal/test_runner/utils.js 65.23% <100.00%> (ø)
src/node_options.cc 76.67% <100.00%> (+0.02%) ⬆️

... and 33 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
### `--experimental-test-coverage`
### `--test-coverage`

<!-- YAML
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.

The changelog should reflect the stability change and name change

Comment thread doc/api/test.md
@@ -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?

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 related to general changes in the lib or src directory. 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

3 participants