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

@avivkelleravivkeller 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-botnodejs-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 threaddoc/api/cli.md Outdated
Comment threaddoc/node.1 Outdated
Co-authored-by: Aviv Keller <me@aviv.sh>
@codecov

codecovBot 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 linesPatch %Lines
lib/internal/test_runner/coverage.js12.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 linesCoverage Δ
lib/internal/test_runner/runner.js94.44% <100.00%> (+0.01%)⬆️
lib/internal/test_runner/utils.js66.35% <100.00%> (+0.09%)⬆️
src/node_options.cc76.62% <100.00%> (-0.08%)⬇️
src/node_options.h98.01% <100.00%> (+0.50%)⬆️
lib/internal/test_runner/coverage.js59.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.

@avivkelleravivkeller 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-actionsgithub-actionsBot 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

@avivkelleravivkeller 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-botnodejs-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: #64830Fixes: #58887
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
@avivkeller

Copy link
Copy Markdown
MemberAuthor

Landed in b7d29fe

aduh95 pushed a commit that referenced this pull request Aug 3, 2026
Signed-off-by: avivkeller <me@aviv.sh>
PR-URL: #64830Fixes: #58887
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
aduh95 pushed a commit that referenced this pull request Aug 4, 2026
Signed-off-by: avivkeller <me@aviv.sh>
PR-URL: #64830Fixes: #58887
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
nodejs-github-bot added a commit that referenced this pull request Aug 4, 2026
Notable changes:
build:
* (SEMVER-MINOR) perfetto-sdk (Chengzhong Wu) #64565
crypto:
* (SEMVER-MINOR) support loading private keys through STORE loaders (Filip Skokan) #63949
* update root certificates to NSS 3.125 (Node.js GitHub Bot) #64746
doc:
* (SEMVER-MINOR) formalize fn/name as part of TestOptions API (Christopher Hiller) #64946
lib:
* (SEMVER-MINOR) add perfetto support (Chengzhong Wu) #64565
module:
* (SEMVER-MINOR) implement Symbol.dispose in ModuleHooks (Remco Haszing) #63928
net:
* (SEMVER-MINOR) add experimental net/promises API (Ethan Arrowood) #63965
src:
* (SEMVER-MINOR) add perfetto trace agent (Chengzhong Wu) #64565
* (SEMVER-MINOR) rename legacy trace event headers (Chengzhong Wu) #64565
* (SEMVER-MINOR) fix trace macro compatibility (Chengzhong Wu) #64565
test_runner:
* (SEMVER-MINOR) add support for --test-coverage-include-all (avivkeller) #64830
PR-URL: #65027
aduh95 pushed a commit that referenced this pull request Aug 4, 2026
Notable changes:
crypto:
* (SEMVER-MINOR) support loading private keys through STORE loaders (Filip Skokan) #63949
* update root certificates to NSS 3.125 (Node.js GitHub Bot) #64746
lib:
* (SEMVER-MINOR) add perfetto support (Chengzhong Wu) #64565
module:
* (SEMVER-MINOR) implement `Symbol.dispose` in ModuleHooks (Remco Haszing) #63928
net:
* (SEMVER-MINOR) add experimental `node:net/promises` API (Ethan Arrowood) #63965
test_runner:
* (SEMVER-MINOR) add support for `--test-coverage-include-all` (avivkeller) #64830
PR-URL: #65027
aduh95 pushed a commit that referenced this pull request Aug 5, 2026
Signed-off-by: avivkeller <me@aviv.sh>
PR-URL: #64830Fixes: #58887
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
aduh95 added a commit that referenced this pull request Aug 5, 2026
Notable changes:
crypto:
* (SEMVER-MINOR) support loading private keys through STORE loaders (Filip Skokan) #63949
* update root certificates to NSS 3.125 (Node.js GitHub Bot) #64746
lib:
* (SEMVER-MINOR) add perfetto support (Chengzhong Wu) #64565
module:
* (SEMVER-MINOR) implement `Symbol.dispose` in ModuleHooks (Remco Haszing) #63928
test_runner:
* (SEMVER-MINOR) add support for `--test-coverage-include-all` (avivkeller) #64830
PR-URL: #65027
aduh95 added a commit that referenced this pull request Aug 5, 2026
Notable changes:
crypto:
* (SEMVER-MINOR) support loading private keys through STORE loaders (Filip Skokan) #63949
* update root certificates to NSS 3.125 (Node.js GitHub Bot) #64746
lib:
* (SEMVER-MINOR) add perfetto support (Chengzhong Wu) #64565
module:
* (SEMVER-MINOR) implement `Symbol.dispose` in ModuleHooks (Remco Haszing) #63928
test_runner:
* (SEMVER-MINOR) add support for `--test-coverage-include-all` (avivkeller) #64830
PR-URL: #65027
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs 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-failedAn error occurred while landing this pull request using GitHub Actions.lib / srcIssues and PRs related to general changes in the lib or src directory.needs-ciPRs that need a full CI run.semver-minorPRs 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

@avivkeller@nodejs-github-bot@MoLow@atlowChemi