Skip to content

test_runner: display diagnostic messages in dot reporter#64331

Open
armorbreak001 wants to merge 1 commit into
nodejs:mainfrom
armorbreak001:fix/test-runner-dot-diagnostics
Open

test_runner: display diagnostic messages in dot reporter#64331
armorbreak001 wants to merge 1 commit into
nodejs:mainfrom
armorbreak001:fix/test-runner-dot-diagnostics

Conversation

@armorbreak001

Copy link
Copy Markdown

Problem

When running tests with both the dot reporter (--test-reporter dot) and coverage enabled, if coverage setup or collection fails, the process exits with a non-zero status code but shows no output explaining why. The user only sees test dots and then an unexplained failure.

Proposed Fix

Collect test:diagnostic events in the dot reporter and display them after the test results (similar to how failed tests are shown). This ensures coverage warnings and other diagnostic messages are visible.

Changes

lib/internal/test_runner/reporter/dot.js:

  • Added diagnostics[] array to collect diagnostic events
  • Handle test:diagnostic type in the event loop
  • Display diagnostics section after failed tests section (yellow ! prefix)

Before

.....X....X......
Failed tests:
  ...
$ echo $?
1
# No indication of WHY it failed if coverage was the issue

After

.....X....X......
Failed tests:
  ...

Diagnostics:

! Warning: Code coverage could not be enabled. ...
! Warning: Could not report code coverage. ...
$ echo $?
1

Approach

  • Follows the same pattern as existing failed tests collection/display
  • Uses yellow color to differentiate from red failures
  • Minimal change — only adds diagnostic event handling
  • Consistent with how spec reporter already handles diagnostics

Fixes: #60884

When using the dot reporter with coverage enabled, coverage failures
would silently exit with an error code but show no output explaining
the failure. This change collects and displays diagnostic messages
(including coverage warnings) after the test dots, similar to how
failed tests are displayed.

Fixes: nodejs#60884
Signed-off-by: armorbreak001 <contact@agentvote.cc>
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/test_runner

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem. labels Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run. test_runner Issues 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

2 participants