-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
proposal: testing: add -vf
(verbose when fail) flag to go test
command
#59201
Comments
I like the idea of this, but I believe the current implementation of For example, the Lines 1024 to 1034 in e0c6958
I think what you are proposing would require a change in approach where all of the functions must buffer log information etc in memory and discard it if the test runs to completion without failing, which might be reasonable but seems quite different than the current approach where (again, assuming I'm reading the code correctly) the log functions seem to just write directly to the output stream when verbose mode is enabled. Do you have a different idea of how this would be implemented, or is buffering in memory what you were assuming? (If I've misunderstood how the |
It's already the case that any messages printed through So I'm not clear on what this proposal is for. Can you give a small example? Thanks. |
Thanks @ianlancetaylor, you are right. I haven't noticed |
@ianlancetaylor is there a way of having |
Problem
For large golang codebase running test can produce overwhelming test results. Developers may not care about output of all tests unless test has failed.
Solution
With new option for
go test
command, flag-vf
(verbose when fail), developer would be able to run tests, but with verbose output of tests only if it has failed. This would reduce total test result output only to bare minimum.Open questions
io.Writer
intesting.T
struct which could be used to collect all outputs of tests in order to conditionally print entire test outputs.The text was updated successfully, but these errors were encountered: