Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_runner: print formatted errors on summary #56911

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

pmarchini
Copy link
Member

Following this discussion: #56662 (comment)

This PR should address #56902

@pmarchini pmarchini requested a review from cjihrig February 4, 2025 09:37
@nodejs-github-bot
Copy link
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 Feb 4, 2025
Copy link

codecov bot commented Feb 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.21%. Comparing base (2bd5694) to head (9e21914).
Report is 15 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #56911      +/-   ##
==========================================
+ Coverage   89.16%   89.21%   +0.04%     
==========================================
  Files         665      665              
  Lines      192602   192511      -91     
  Branches    37050    37045       -5     
==========================================
+ Hits       171732   171747      +15     
+ Misses      13678    13606      -72     
+ Partials     7192     7158      -34     
Files with missing lines Coverage Δ
lib/internal/test_runner/reporter/spec.js 96.61% <100.00%> (+0.41%) ⬆️

... and 51 files with indirect coverage changes

ArrayPrototypePush(results, formattedErr);
}
callback(null, ArrayPrototypeJoin(results, '\n'));
callback(null, this.#formatFailedTestResults());
Copy link
Contributor

Choose a reason for hiding this comment

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

We shouldn't still need this, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

in theory no but since it's part of _flush, I think it shouldn't be a big deal to have it there as well.
Wdyt?

Copy link
Contributor

Choose a reason for hiding this comment

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

In non-watch mode, wouldn't it cause the errors to be printed here and for the summary event?

Copy link
Member Author

Choose a reason for hiding this comment

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

nope as on each "print" we're cleaning this.#failedTests = []; // Clean up the failed tests.
But still we can remove it

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah ok. I guess the question is, "is this expected to do anything?" My thoughts are no, so we should probably remove it.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've just checked, and I was wrong.

Removing _flush breaks the following tests:

image

lib/internal/test_runner/reporter/spec.js Show resolved Hide resolved
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.

3 participants