Skip to content

test_runner: add support for --test-coverage-include-all - #64830

Closed
avivkeller wants to merge 2 commits into
nodejs:mainfrom
avivkeller:test-coverage-include-all
Closed

test_runner: add support for --test-coverage-include-all#64830
avivkeller wants to merge 2 commits into
nodejs:mainfrom
avivkeller:test-coverage-include-all

Conversation

@avivkeller

@avivkeller avivkeller commented Jul 29, 2026

Copy link
Copy Markdown
Member

Add s a CLI option to include source files that were never loaded by the test run in the coverage
report, where they are reported as having zero coverage. Candidate files are searched for in the current working directory, and are subject to the same --test-coverage-include and --test-coverage-exclude filtering as the rest of the report.

Fixes: #58887

As discussed during today's @nodejs/test_runner meeting with @ljharb and @JakobJingleheimer

Signed-off-by: avivkeller <me@aviv.sh>
@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 Jul 29, 2026
Comment thread doc/api/cli.md Outdated
Comment thread doc/node.1 Outdated
Co-authored-by: Aviv Keller <me@aviv.sh>
@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 23.21429% with 43 lines in your changes missing coverage. Please review.
βœ… Project coverage is 90.12%. Comparing base (b2a024b) to head (8a951bb).
⚠️ Report is 48 commits behind head on main.

Files with missing lines Patch % Lines
lib/internal/test_runner/coverage.js 12.24% 43 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #64830      +/-   ##
==========================================
- Coverage   90.15%   90.12%   -0.04%     
==========================================
  Files         744      746       +2     
  Lines      242542   242819     +277     
  Branches    45690    45741      +51     
==========================================
+ Hits       218672   218836     +164     
- Misses      15362    15463     +101     
- Partials     8508     8520      +12     
Files with missing lines Coverage Ξ”
lib/internal/test_runner/runner.js 94.44% <100.00%> (+0.01%) ⬆️
lib/internal/test_runner/utils.js 66.35% <100.00%> (+0.09%) ⬆️
src/node_options.cc 76.62% <100.00%> (-0.08%) ⬇️
src/node_options.h 98.01% <100.00%> (+0.50%) ⬆️
lib/internal/test_runner/coverage.js 59.57% <12.24%> (-2.96%) ⬇️

... and 84 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.

@avivkeller avivkeller added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Jul 30, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 30, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@avivkeller avivkeller added semver-minor PRs that contain new features and should be released in the next minor version. commit-queue Add this label to land a pull request using GitHub Actions. labels Jul 30, 2026
@nodejs-github-bot nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Jul 31, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator
Commit Queue failed
- Loading data for nodejs/node/pull/64830
βœ”  Done loading data for nodejs/node/pull/64830
----------------------------------- PR info ------------------------------------
Title      test_runner: add support for --test-coverage-include-all (#64830)
Author     Aviv Keller <me@aviv.sh> (@avivkeller)
Branch     avivkeller:test-coverage-include-all -> nodejs:main
Labels     c++, semver-minor, lib / src, author ready, needs-ci
Commits    2
 - test_runner: add support for --test-coverage-include-all
 - Apply suggestions from code review
Committers 2
 - avivkeller <me@aviv.sh>
 - GitHub <noreply@github.com>
PR-URL: https://github.com/nodejs/node/pull/64830
Fixes: https://github.com/nodejs/node/issues/58887
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/64830
Fixes: https://github.com/nodejs/node/issues/58887
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
--------------------------------------------------------------------------------
   β„Ή  This PR was created on Wed, 29 Jul 2026 21:19:50 GMT
   βœ”  Approvals: 2
   βœ”  - Moshe Atlow (@MoLow): https://github.com/nodejs/node/pull/64830#pullrequestreview-4815157653
   βœ”  - Chemi Atlow (@atlowChemi): https://github.com/nodejs/node/pull/64830#pullrequestreview-4818548199
   ✘  GitHub CI is still running
   β„Ή  Last Full PR CI on 2026-07-30T15:53:22Z: https://ci.nodejs.org/job/node-test-pull-request/75310/
- Querying data for job/node-test-pull-request/75310/
βœ”  Build data downloaded
   βœ”  Last Jenkins CI successful
--------------------------------------------------------------------------------
   βœ”  Aborted `git node land` session in /home/runner/work/node/node/.ncu
https://github.com/nodejs/node/actions/runs/30667054569

avivkeller added a commit that referenced this pull request Jul 31, 2026
Signed-off-by: avivkeller <me@aviv.sh>
PR-URL: #64830
Fixes: #58887
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
@avivkeller

Copy link
Copy Markdown
Member Author

Landed in b7d29fe

@avivkeller avivkeller closed this Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++. commit-queue-failed An error occurred while landing this pull request using GitHub Actions. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. semver-minor PRs that contain new features and should be released in the next minor version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Report 0% coverage for untested files in a project (i.e., files matching some glob)

4 participants