gotestsum
gotestsum copied to clipboard
junitxml: failure count and include build errors
Currently the failure count is the len(failures), however if there was an error in package main that failure is not included in the count of failures.
Also build errors are not included in the failures.
This Go issue seems related: https://github.com/golang/go/issues/23037
Also build errors are not included in the failures.
This is a substantial pain point for me. I have something that must link against a particular library; when that test fails to run in CI because it can't find the lib, gotestsum exits with 1 and does not write anything useful to stdout, stderr, or to the xml file. This means that I have to detect this condition, and run bare go test
before I get useful output.
does not write anything useful to stdout, stderr
Hmm, that's surprising. Any build errors should be reported as errors. Would you mind opening an issue about this? Could you include the output of go test
(or an example of what it looks like).
Hmm, that's surprising. Any build errors should be reported as errors.
@dnephin seems that's my fault :flushed:. I thought I'd tested with a full version of gotestsum and had the same result, but if I try that now it works.
I knew my job of ripping out extras like human-readable output (to minimize vendored deps) was pretty rough, but it had appeared to be functional.
The build errors are sent to stderr by go test
, so they don't appear in the testjson. They are captured here: https://github.com/gotestyourself/gotestsum/blob/master/testjson/execution.go#L345-L356