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

Tests that may have written to stdout (without a trailing newline) fail #31

Closed
johnSchnake opened this issue Apr 29, 2016 · 1 comment · Fixed by #64
Closed

Tests that may have written to stdout (without a trailing newline) fail #31

johnSchnake opened this issue Apr 29, 2016 · 1 comment · Fixed by #64

Comments

@johnSchnake
Copy link
Contributor

I think this may be the cause of #30 as I had very similar results with some code of mine.

The regexp used to match the go test -v output mandates that the --- PASS (and other tokens) be at the start of the line. However if you had a test that did something like fmt.Printf("SUCCESS") the line that go-junit-report tries to parse looks like:
SUCCESS--- PASS ... and so it fails to see the resolution of that test at all and marks it a failure.

Is it open to consideration that the "start of line" restriction be removed from the regexp so that any test like that would pass? go test is not in any way ensuring that their remarks about the test (which is what this tool tries to parse) are at the start of a line so I don't know why go-junit-report should mandate it.

@johnSchnake
Copy link
Contributor Author

By the way, this can be very tricky to diagnose if your program does anything like fmt.Printf("SUCCESS\r") since this gets overwritten by the go test output. You then see the output like normal and would expect go-junit-report to work (which is why #30 doesn't see obvious problems like this) but it fails because it doesn't process the \r in the same way piping to a file or writing to the terminal would.

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 a pull request may close this issue.

1 participant