Closed jmdacruz closed 1 year ago
Thank you for the bug report! I believe this is the same problem as described in #279. See my comment there for more details and a link to the Go issue.
The problem in your case is that the trailing '
comes after the newline, which breaks the test2json
parsing, because it is output without a trailing newline.
Yes, I imagined this was related to the single quote and the new line :). I'll keep an eye out for https://github.com/golang/go/issues/26325. In our particular case, this was output generated by the code under test itself, which might be impossible to control in certain situations (e.g., using some external library that has this behavior). In this particular case, we were able to change the code under test to workaround this issue.
I'm going to close this issue since it sounds like it was a problem with either the test suite, or how go test
handles missing newlines. The linked Go issue has been closed, so maybe go test
handles this better now.
Run into a weird issue caused by verbose output, I created this repository in order to help reproduce the issue consistently: https://github.com/jmdacruz/gotestsum_issue (see README, only requires
docker-compose
to run)Long story short, given this code under test:
Then, the following
gotestsum
commands fail to correctly parse the output of the tests:The
coverpkg
option is useful to filter which packages to include coverage for. The output isThe command's exit code is 0