-
Notifications
You must be signed in to change notification settings - Fork 18k
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: output of go test varies by mode #23258
Comments
From
Note the "if a package test passes, go test prints only the final 'ok' summary line". I think that explains what's happening here. |
The documentation seems insufficient in this case; even after reading it, it seems like a stretch that a user would expect local directory mode to include output that package list mode does not. In addition, the docs here almost seem like there should be a new paragraph starting with the second sentence of the third paragraph you quoted: "If a package test passes...", because otherwise part of that paragraph applies to both local directory mode and package list mode (e.g. the description of |
I was simply pointing out the docs that explain what is going on. If you think the docs could be improved, feel free to reopen and repurpose the issue and send a CL to do the appropriate changes. |
Is that preferred over aligning the behavior of local directory mode and package list mode? |
If you'd prefer that route, you could write a proposal to try to change the behavior of |
What version of Go are you using (
go version
)?go version go1.9.2 darwin/amd64
(the same occurs with
go version go1.10beta1 darwin/amd64
)Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?macOS 10.13.2
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
What did you do?
I executed
go test
andgo test .
on a package whose tests will cause output to be written to stderr via thelog
package:What did you expect to see?
I expected the output of local directory mode, (i.e.
go test
) to be identical to the output of package list mode (i.e.go test .
andgo test github.com/bhcleek/play/test
) with the exception of the elapsed time.What did you see instead?
In addition to the test summary line, local directory mode output
hello, world
to stderr andPASS
to stdout. Package list mode output only the test summary line.The text was updated successfully, but these errors were encountered: