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

dot test-reporter includes more info #53031

Open
romainmenke opened this issue May 16, 2024 · 8 comments
Open

dot test-reporter includes more info #53031

romainmenke opened this issue May 16, 2024 · 8 comments
Labels
feature request Issues that request new features to be added to Node.js. stale test_runner Issues and PRs related to the test runner subsystem.

Comments

@romainmenke
Copy link

Version

22.2.0

Platform

all platforms

Subsystem

No response

What steps will reproduce the bug?

  • run any test with node --test-reporter dot
  • expect to see only dots and X
  • see stack traces instead

How often does it reproduce? Is there a required condition?

Always

What is the expected behavior? Why is that the expected behavior?

See only dots and X

What do you see instead?

Stack traces and helpful debug info

Additional information

See : #51769


We rely on the previous way the dot reporter worked.
All the new output is actually breaking for us.

We picked the dot reporter for self tests on another test suite exactly because it omits debug info.

The lack of debug info and stack traces makes it a perfect smell test that runs the same on any platform.

Because this was changed in a minor node version we now have a broken main :D

I am unsure how to proceed.
Is there a way to restore the old behavior of the dot reporter?

@romainmenke
Copy link
Author

I've internalized the previous version of the dot runner given how small and simple it was.
https://github.com/csstools/postcss-plugins/blob/main/packages/postcss-tape/test/_dot-reporter.cjs

Feel free to close this issue.

@RedYetiDev
Copy link
Member

RedYetiDev commented May 16, 2024

This behavior was changed in #52655, does that answer your question?

@nodejs/test_runner is there a way to revert the behavior via a CLI flag or similar?

@RedYetiDev RedYetiDev added feature request Issues that request new features to be added to Node.js. test_runner Issues and PRs related to the test runner subsystem. labels May 16, 2024
@RedYetiDev
Copy link
Member

Marking as feature-request, as it appears this is requesting a way to disable the new dot reporter.

@romainmenke
Copy link
Author

romainmenke commented May 17, 2024

Now that this is labeled as a feature request I should explain better why I saw value in the previous implementation of the dot reporter.


We author a lot of PostCSS plugins and also have our own test suite for PostCSS plugins.
This test suite is built on top of node:test.

To test this test suite itself we decided to use the dot reporter exactly because it only gives feedback on passes and failures.

This makes it easy to verify that failing tests fail in the expected way.
We are only interested in the sequence of passes and failures and the final exit code.

Information like stack traces is not helpful for our purposes because these can be different for each user and environment.

The lack of detailed information in the dot reporter also gave us the impression that it would be stable across node versions.

With the recent changes it is both unstable between node versions (because it is a new addition) and it is unstable between users.

This makes it impossible to record test runner output and compare new runs against previous recordings.

@marco-ippolito
Copy link
Member

I would have approached it differently, having no stack trace by default (if you use dot you usually don't want the output to be verbose) and opt in with a flag --debug flag or --verbose (like phpunit).
Not sure if it's a good idea to change the behavior again, at this point I'd add a flag skip stack traces

@MoLow
Copy link
Member

MoLow commented May 22, 2024

would have approached it differently, having no stack trace by default (if you use dot you usually don't want the output to be verbose) and opt in with a flag --debug flag or --verbose (like phpunit).
Not sure if it's a good idea to change the behavior again, at this point I'd add a flag skip stack traces

no reason for it to be a flag. it can be two separate reporters. the only question is if they should both reside in core, or should one be in user-land?
I am ok with having dot and dot-verbose reporters, or alternatively dot and dot-compact

@romainmenke
Copy link
Author

Not sure if it's a good idea to change the behavior again

Changing it back has the benefit that it restores the previous behavior.
That makes it possible to test over multiple node versions (all the way back to node 18 if I recall correctly) and have consistent output.

Introducing a new dot-compact doesn't have this benefit.

@RedYetiDev RedYetiDev moved this from Awaiting Triage to Triaged in Node.js feature requests Jun 27, 2024
Copy link
Contributor

There has been no activity on this feature request for 5 months. To help maintain relevant open issues, please add the never-stale Mark issue so that it is never considered stale label or close this issue if it should be closed. If not, the issue will be automatically closed 6 months after the last non-automated comment.
For more information on how the project manages feature requests, please consult the feature request management document.

@github-actions github-actions bot added the stale label Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issues that request new features to be added to Node.js. stale test_runner Issues and PRs related to the test runner subsystem.
Projects
Development

No branches or pull requests

4 participants