test_runner: print coverage and diagnostic info with dot reporter#61423
Open
mag123c wants to merge 3 commits intonodejs:mainfrom
Open
test_runner: print coverage and diagnostic info with dot reporter#61423mag123c wants to merge 3 commits intonodejs:mainfrom
mag123c wants to merge 3 commits intonodejs:mainfrom
Conversation
Collaborator
|
Review requested:
|
When using the dot reporter with coverage enabled, coverage threshold failures and coverage reports were not printed, only an exit code was returned. This made it impossible to know why the test run failed. This change adds handling for test:diagnostic and test:coverage events to the dot reporter, matching the behavior of the spec reporter. Fixes: nodejs#60884
83840c7 to
313a274
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #61423 +/- ##
==========================================
+ Coverage 88.53% 89.75% +1.22%
==========================================
Files 704 674 -30
Lines 208883 204090 -4793
Branches 40333 39231 -1102
==========================================
- Hits 184926 183176 -1750
+ Misses 15934 13248 -2686
+ Partials 8023 7666 -357
🚀 New features to boost your workflow:
|
Member
|
Hey @mag123c, could you please add some tests? |
atlowChemi
approved these changes
Jan 20, 2026
pmarchini
reviewed
Jan 31, 2026
| assert(!findCoverageFileForPid(result.pid)); | ||
| }); | ||
|
|
||
| test(`test failing ${coverage.flag} with dot reporter`, () => { |
Member
There was a problem hiding this comment.
NIT: I would suggest adding a snapshot test too, like as we have done in test/test-runner/test-output-coverage-width-100-uncovered-lines.mjs 👀
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds coverage and diagnostic output to the dot reporter in test_runner.
Currently, when using dot reporter with coverage enabled, if coverage threshold fails, the program exits with code 1 but prints nothing about why it failed. Users have no way to know what went wrong. The spec reporter already handles this correctly.
Changes:
test:diagnosticevents (coverage threshold failure messages)test:coverageevents (coverage report table)Now dot reporter behaves consistently with spec reporter for coverage output.
Fixes: #60884