introduce back go-junit-report for parsing go test output #82
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I tried to stack this PR on top of #81, but I think i need to be able to push that branch to this repo to be able to use it as a base for this PR. I'll still leave both open since if both get merged, then we may want to just revert this one (as has happened before). I've commented on the change which is accounted for in the other PR.
The test output from
go_test
is currently quite hard to read and also can be inaccurate.For example, given this test file:
we get the following output:
There are 5 assertions which fail, however 10 assertion failures are shown. All expected assertions are output under the
Standard error
header and then an assertion failure is also output for each failing test / subtest. However, the assertion failures under eachFailure: in XXX
header are not the always the correct failures. ForTest1
and its subtests, the failure fromTest/Subtest2
is output under eachFailure: in XXX
header.I can see that
go-junit-report
v0.9.0
(technically a couple of commits after this tag) was introduced to the Please repo in 2020 and then reverted due to it not being able to handle more complex input (thought-machine/please#995). This PR introduces it back, now that the tool seems to have matured a bit. Betweenv0.9.0
andv2.0.0
, 81 test cases have been added and it seems to pass the eye test on the above test file:Now, only 5 assertion failures are output and each one is under the correct
Failure: in XXX
heading.The version that i've added to this repo is my fork where i've set the message attribute of the
<skipped>
node correctly so that the reason is output correctly by Please (without this change, the skipped test output looks likeReason: Skipped
vsReason: external_test.go:32: Failing on Alpine currently
). I've made a PR to upstream this: jstemmer/go-junit-report#158.I'm happy to throw any other test files you can think of at
go-junit-report
to make sure it handles them properly 🙏