gotestyourself / gotestsum

'go test' runner with output optimized for humans, JUnit XML for CI integration, and a summary of the test results.
Apache License 2.0
2.03k stars 119 forks source link

Include timeout errors in junit reports. #349

Closed sodul closed 1 year ago

sodul commented 1 year ago

We use Jenkins to parse the junit reports from gotestsum. We noticed that when a test is timedout, the junit report on Jenkins show a failure but not that it was caused by a timeout and we have to go into the console output to figure this out.

Since gotestsum should be aware that the test was aborted due to the timeout, this could be reflected in the junit report so that we can more efficiently know the actual cause in the Jenkins UI, or whatever junit presentation layer is used.

dnephin commented 1 year ago

Thank you for the bug report! I think this is due to the same underlying problem as #292. The go toolchain is inconsistent about where the timeout is reported (https://github.com/golang/go/issues/57305).

In #298 I fixed this with a workaround for the regular output. Either that fix didn't cover the junit.xml, or maybe that fix caused it to be missing. Either way #357 seems like it should fix this problem.