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
cmd/go: 'go test' output-hiding behavior is under-documented #21461
Comments
I agree we need better documentation. I want to support the current behavior, in that it makes it easy to casually add |
@ianlancetaylor no, t.Log calls are hidden unless
|
@ianlancetaylor I guess my response doesn't correspond to
In my original post, what I intended to suggest is that it would be less confusing if |
Sorry, I was supporting hiding the output of passing tests. I agree that it should be consistent. |
@ianlancetaylor to be precise, are you suggesting that |
Yes. (I can see a counter-argument, but that is my vote.) |
New output for go help test, added since this bug was filed:
I think this is now documented. |
I stumbled upon this issue while using flags passed to the When running
I get a list of all packages, with OK, ?, or fail indication, and no other output, neither from But when running
I get output from all I'm using the flag for flow control, in particular to control whether something gets comtpiled, or not - i don't really want to affect the verbosity of the output, yet I get flooded with output... A minimal working example to reproduce the described behavior consists of the following to files, in an otherwise empty directory:
results in outputs:
and
Is this expected behavior? Personally, I think it should not be ; ) It might be a good idea to add something about this in the docs either way. |
@valentin-krasontovitsch This issue is closed, and, we believe, fixed. The Go project does not use the issue tracker for discussion; please ask your question on a forum: https://golang.org/wiki/Questions . Thanks. |
Well, in my humble opinion the issue persists: the behavior I'm describing is (as far as I can see) undocumented. That I formulate this as a question and not a claim is simply due to the fact that I don't want to claim knowledge of all of the documentation, and cannot exclude to have overlooked something ... Please advise -
Let me try to make a clear statement, as my comment indeed seems to be missing this: The (difference in) logging behavior of running Of course, if you have a link at hand pointing me to the right spot of the documentation, I would really appreciate it... |
I can only repeat what I said above: this issue is closed and, we believe, fixed. This is not the place for further discussion. Please open a new issue or discuss this on a forum. Thanks. I'm not even sure what you expect from |
Some tests were disabling logs and some were not. Based on the discussion in heketi#792, changing everywhere to default logging. As per golang/go#21461, the logs won't pollute the output if all tests pass. If a test fails then all logs from the package are shown. This is something which can be fixed later. It would be useful to limit logs of that particular test instead of package. Signed-off-by: Raghavendra Talur <rtalur@redhat.com>
Some tests were disabling logs and some were not. Based on the discussion in #792, changing everywhere to default logging. As per golang/go#21461, the logs won't pollute the output if all tests pass. If a test fails then all logs from the package are shown. This is something which can be fixed later. It would be useful to limit logs of that particular test instead of package. Signed-off-by: Raghavendra Talur <rtalur@redhat.com>
Using 1.9rc1 / amd64, but it's not particular to any version.
The fact that
go test
hides output from passing tests if you give it a package selector argument is surprising and is not properly documented.The closest I can find to documentation of this difference is at the beginning of
go help test
:In particular, "detailed output for each failed package" hints that there might be a difference between the way output for failed and passed packages are handled, but the documentation should be explicit about when output is hidden from the user.
At a philosophical level, I think it's harmful to hide the output at all. Best practice seems to be writing tests that don't print stuff on success, so the hiding behavior just makes it take longer to discover and fix these bad tests.
I have also observed the behavior of sometimes hiding the output and sometimes not -- depending on how the test was invoked -- to be a source of confusion for
go test
users.The text was updated successfully, but these errors were encountered: