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

"To run this test again" message on test failures is distracting and unhelpful #2137

Open
mpfaff opened this issue Nov 11, 2023 · 1 comment
Labels
type-enhancement A request for a change that isn't a bug

Comments

@mpfaff
Copy link

mpfaff commented Nov 11, 2023

Every test failure prints a message along the lines of this:

To run this test again: /path/to/dart test test/my_tests.dart -p vm --plain-name 'name of the test'

This is already quite distracting, but it printing immediately before the next test info line without any blank lines for padding is even worse.

As a developer, I most often simply need to see which tests failed and why. In the case that I do need to re-run the test on its own, it takes less than 10 seconds to find out how by reading dart test --help. Therefore I would like these messages to be removed or suppressed by default. If only by default, perhaps a single message could be printed at the end of the test run along the lines of this:

Some tests failed. To print the command to re-run each failed test individually, run again with `--print-run-command-on-failure`.

Alternatively, if you all decide that you want to keep these messages, please strongly consider adding a single line of padding between it and the next test info line:

To run this test again: /path/to/dart test test/my_tests.dart -p vm --plain-name 'name of the test'
+
00:00 +1 -1: test/my_tests.dart: name of the next test [E]
@lrhn lrhn transferred this issue from dart-lang/sdk Nov 13, 2023
@jakemac53
Copy link
Contributor

I agree these aren't always useful, but when they are useful they are quite useful, especially for packages with lots of tests.

Most of the time, you shouldn't have lots of failing tests, so it shouldn't be overly spammy, and I think they should be enabled by default.

I think it would be reasonable to have an opt-out though.

@jakemac53 jakemac53 added the type-enhancement A request for a change that isn't a bug label Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

2 participants