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

Show list of failed tests in the final summary #1720

Closed
wants to merge 1 commit into from

Conversation

gmpassos
Copy link
Contributor

This is a small change that adds the listing of the failed tests (path + name) in the final summary of the tests.

This is very helpful, since when we have a failed test we need to scroll back many tests outputs to find the one that have failed.

With this extra information in the final summary we have the exact information that we need when a test fails.

@jakemac53
Copy link
Contributor

In general, for the compact reporter, we expect the output to really only contain test failures plus a final summary line already, so I am not sure how much this helps there?

I think for the expanded reporter this might make more sense, as it has a lot more noise in the output.

cc @natebosch

@natebosch
Copy link
Member

I agree that this is not very useful in the compact reporter.

I think it would be OK to add it at the end of the expanded reporter. Or we could make it a separate reporter. #829

@gmpassos
Copy link
Contributor Author

This is a very useful feature. Some times it takes a significant amount of time to find the failed tests in the output. And when a test fails, this is the main information that you need.

For me the output is still compact, since it's only showing extra information for failed tests (one line for each one).

@jakemac53
Copy link
Contributor

@gmpassos is the issue you are having that the test failures themselves are emitting a lot of output? So then you have to scroll up past a lot of stack traces/etc in order to find all the failed tests?

@gmpassos
Copy link
Contributor Author

Is not about a lot of stack traces, but a lot of outputs in the console.

Depending of the library it produces outputs in the console as a normal use case.

@jakemac53
Copy link
Contributor

You could run your tests inside of a zone that intercepts all print/stdout/stderr calls with a call to printOnFailure or similar? That would eliminate this type of output for passing tests, which seems to be the larger issue.

@gmpassos
Copy link
Contributor Author

I (and any dev) just want to run "dart test" for any kind of test for any kind of library, for any kind of package using the same paradigm to code it.

So, I have pushed a simple pull request to add a very helpful feature for any Dart developer.

This information shouldn't be rocket science to have access to it. Should be only "dart test" since when you have a failed test, you need to know which test you need to fix (ASAP). Developer time is gold, BTW.

@kevmoo
Copy link
Member

kevmoo commented Jun 16, 2022

You could run your tests inside of a zone that intercepts all print/stdout/stderr calls with a call to printOnFailure or similar? That would eliminate this type of output for passing tests, which seems to be the larger issue.

@jakemac53 – better to wrap the...JSON reporter things, right? That's what IDEs do. All the info is there in a highly structured format.

Honestly, I had a chat w/ previous engineering ownership about exporting the logging types and supported decode so a user could create a type Stream API to support better tooling

@natebosch
Copy link
Member

The compact reporter is definitely not where I'd want to put this, at least not by default. I don't want to increase the noise for tests that don't have spammy output in order to make it easier for tests that do.

I could imagine a few different approaches but I'm not sure I'll have the bandwidth to push on them.

  • Add support for passing configuration to reporters (I don't think there is any configuration today, is there?) and make this an option on both the compact and expanded reporter. Off by default.
  • Add support for running multiple reporters to stdout, and implement Add a quieter reporter that only prints information for failures #829
  • Add a separate non-reporter feature like --print-failure-summary which can output failures independently of the reporter that was used (It would be invalid to use this flag with the json reporter).

@gmpassos
Copy link
Contributor Author

I vote to be able to pass parameters/configuration to the reporter, specially for the summary output.

Regards.

@mosuem
Copy link
Member

mosuem commented Mar 12, 2024

Closing this as it is stale. Feel free to reopen in case you still want to land it!

@mosuem mosuem closed this Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants