Skip to content

test_runner: print coverage and diagnostics with dot reporter - #61891

Open
madkate42 wants to merge 2 commits into
nodejs:mainfrom
madkate42:fix-dot-reporter-coverage
Open

test_runner: print coverage and diagnostics with dot reporter#61891
madkate42 wants to merge 2 commits into
nodejs:mainfrom
madkate42:fix-dot-reporter-coverage

Conversation

@madkate42

@madkate42madkate42 commented Feb 19, 2026

Copy link
Copy Markdown

Summary

When using the dot reporter with coverage thresholds, coverage failure messages and the coverage report were not displayed. The dot reporter only handled test:pass and test:fail events, ignoring test:diagnostic and test:coverage events.

This change adds handlers for these events, displaying:

  • Diagnostic messages (including coverage threshold errors)
  • The coverage report table

after the test dots complete.

Fixes: #60884
Refs: #52655

Test plan

  • Added tests in test/parallel/test-runner-coverage-thresholds.js for dot reporter coverage failures
  • Existing dot reporter tests continue to pass

 diagnostics with dot reporter
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/test_runner

@nodejs-github-botnodejs-github-bot added needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem. labels Feb 19, 2026
@madkate42
madkate42 deleted the fix-dot-reporter-coverage branch February 19, 2026 21:15
@madkate42
madkate42 restored the fix-dot-reporter-coverage branch February 19, 2026 21:29
@madkate42madkate42 reopened this Feb 19, 2026
fixture,
]);

const stdout = result.stdout.toString();

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.

Could you please add a snapshot test too?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

great catch, thank you, added in this commit.
let me know if this could be improved!

@codecov

codecovBot commented Feb 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 71.42857% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.77%. Comparing base (5a8f845) to head (3be8bad).
⚠️ Report is 1294 commits behind head on main.

Files with missing linesPatch %Lines
lib/internal/test_runner/reporter/dot.js71.42%6 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@## main #61891 +/- ##
==========================================
- Coverage 91.70% 89.77% -1.93% 
==========================================
Files 337 674 +337 Lines 140026 204906 +64880 Branches 21745 39385 +17640 ==========================================
+ Hits 128410 183964 +55554 - Misses 11393 13233 +1840 - Partials 223 7709 +7486 
Files with missing linesCoverage Δ
lib/internal/test_runner/reporter/dot.js90.00% <71.42%> (-10.00%)⬇️

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

@pmarchinipmarchini 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.

The tests are failing and the failures seem to be related!

@SudhansuBandha

SudhansuBandha commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

The failures appear to be due to outdated snapshots.

Running:
python tools/test.py test-runner
updates the snapshot and all tests pass locally.

@JakobJingleheimerJakobJingleheimer added the duplicate Issues and PRs that are duplicates of other issues or PRs. label Mar 8, 2026
@JakobJingleheimer

JakobJingleheimer commented Mar 8, 2026

Copy link
Copy Markdown
Member

Duplicate of#61423

@JakobJingleheimerJakobJingleheimer marked this as a duplicate of #61423Mar 11, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

duplicateIssues and PRs that are duplicates of other issues or PRs.needs-ciPRs that need a full CI run.test_runnerIssues and PRs related to the test runner subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test_runner: print failed coverage reports with dot runner

5 participants

@madkate42@nodejs-github-bot@SudhansuBandha@JakobJingleheimer@pmarchini