gotestsum icon indicating copy to clipboard operation
gotestsum copied to clipboard

junitxml: failure count and include build errors

Open dnephin opened this issue 6 years ago • 5 comments

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.

dnephin avatar Jun 05 '18 20:06 dnephin

This Go issue seems related: https://github.com/golang/go/issues/23037

magik6k avatar May 14 '19 16:05 magik6k

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.

mpictor avatar Sep 06 '19 15:09 mpictor

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).

dnephin avatar Sep 06 '19 16:09 dnephin

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.

mpictor avatar Sep 09 '19 16:09 mpictor

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

dnephin avatar Sep 09 '19 17:09 dnephin