-
Notifications
You must be signed in to change notification settings - Fork 118
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
Feat: add optional configurable tests summary #303
Comments
Thanks for suggesting this! Using gotestsum \
--jsonfile tmp.json.log \
--hide-summary all \
--post-run-command "gotestsum --format testname --raw-command -- cat tmp.json.log" Unfortunately, that does not currently work because the jsonfile is closed after I'd like to fix that bug. Once fixed the command above should solve that use case, although it is still quite verbose. It might be interesting to add a new flag to enable that behaviour. Another approach would be to run
|
This is pretty neat! Thanks, I wasn't aware of this. The small problem with this is that I'll get all the output from e.g. As for the workarounds: this is what would work for me:
but a problem with this is that I'm running that from a Any advice 😅 ? |
If I understand correctly, I think fixing the bug I mentioned above (writing the jsonfile before calling post-run-command) should fix the issue with errors. The post-run-command is run even on error, so you don't have to run it as a separate command. In another issue (#258 (comment)) there was a proposal to add something like It sounds like that flag would remove the need for the My hope is that fixing the jsonfile bug, and adding a way to print only the non-output events would get this working the way you want. |
That would be something I'm looking for. Being able to get top n slowest tests would be a cherry on top but that can also be achieved by some |
Currently it does "all tests slower than threshold", rather than "slowest n tests". It shouldn't be too difficult to add a new flag to output "n slowest" instead. |
With #306 adding the new
I'll look to do a release soon with those changes. |
That's cool! Thanks @dnephin. Would it be possible to integrate the slowest tests report printing within the
The name of the flag ( |
Ya, I think it's worth still considering a new flag. I'll re-open this issue to see if others are interested. I'm not sure how common it is to want to see the slowest tests on every run. Do you want to use this for local development or in CI? |
I believe both. CI to keep a history of what were the N slowest tests and locally to verify a fix that one might work on |
Use case
I have a set of pretty long integration tests and I want to retain the output from them in pretty much the
standard-verbose
fashion (that's what I use for now on CI).Since the output is so long and I intend to keep it, it's hard to go through the log and find each individual
PASS: TestXXX (12.34s)
entry.Proposed solution
It would be really nice if
gotestsum
could add a toggle (opt-in probably) to print a summary of all tests with their run times.This way we could use
standard-verbose
format but also get the summary at the end.Considered alternatives
Parse
--jsonfile
and use--post-run-command
with a custom written script that will do the aboveThe text was updated successfully, but these errors were encountered: