go test hides the exit status of the test binary
What version of Go are you using (
The text was updated successfully, but these errors were encountered:
That seems like a reasonable concern, but I think we should address it more directly. Perhaps we could have
Or, perhaps the behavior noted in #38382 is actually the solution here: at the moment, it seems that you can detect an incomplete test run by the presence of a
Although, that still leaves the problem of detecting programs that panic (or invoke
@bcmills thank you for the quick reply.
There is already a clear pattern for handling this in the Go toolchain (and other software):
That seems quite coherent to me. The user is requesting one thing "run all of these tests", if that request is not satisfied (all tests are not run), then indicating it with the exit code seems appropriate. It doesn't matter that some packages did run all tests.
I considered that, but it seems like doing so would be a lot more involved, could be significantly more error prone (because there are many cases to handle), and may not actually provide any more value than the simple solution.
#38382 describes an abnormal case. Most of the time, when a test panics, it does include an
This seems like the correct behaviour. It is the package that is incomplete, not the test.
How is that a better solution than simply not hiding the relevant exit code? That seems to be a lot more involved and error prone. There are many things that can change the list of tests, environment variables, build tags, or even command line flags.
On a separate note, could you comment on why the current behaviour is correct? Why should