Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change to use third-party go test parser #2901

Merged
merged 4 commits into from
Sep 8, 2023

Conversation

peterebden
Copy link
Collaborator

I recall us looking at this sort of thing in the past but can't recall why we didn't just use it. I like the idea of us having a bunch less code here.

Have fiddled with a few cases and this seems reasonable. It's definitely broadly working, unsure if maybe there is some edge case that is worse.
One minor change: on test failures we now emit just the failure and not stdout. I think this is better, Go tests tended to feel overly verbose before with the doubled output.

I've also rediscovered what I previously knew about go test -json: it is not inherently part of the test, it is a separate binary that still parses the (very similar) output. Seems not worth going through another subprocess given this can just parse it directly.

@peterebden
Copy link
Collaborator Author

Hmmmm so this got tried in #982 and reverted again in #994. Reasons for reverting seem lost to history though.

results_test.go:11: Unable to parse file: EOF
--- FAIL: TestJSONExpectedFailure-6 (0.00s)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not fully certain about all the logic here but I don't observe this ordering happening to me when tests fail.

interactive_display_test.go:21: haven't written proper support for this yet
--- SKIP: TestLimitedPrintfAnsiNotCountedWhenReducing (0.00s)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly here, the skip message appears between the RUN and SKIP lines

@@ -169,11 +169,6 @@ func TestGoIgnoreUnknownOutput(t *testing.T) {
assert.Equal(t, 0, results.Skips())
}

func TestGoFailIfUnknownTestPasses(t *testing.T) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think go-junit-report handles the case we test here (of results happening out of order). I'm not sure to what degree we need to care.

@peterebden
Copy link
Collaborator Author

Alright I'm going to land this and we'll see how we go. If we have to revert it again at least we'll try to remember why this time...

@peterebden peterebden merged commit 9bd50e4 into thought-machine:master Sep 8, 2023
@peterebden peterebden deleted the go-junit-parser branch September 8, 2023 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants