-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
summary: mitigate test2json bug causing missing test output
See golang/go#29755. If a test fails, and there is no test output (other than framing), then print all the test output for the entire test case. This won't fix the issue if the test which failed had some output, but well behaved tests generally shouldn't non-failure message output, so hopefully this case is rare.
- Loading branch information
Showing
8 changed files
with
191 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package testjson |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{"Action":"run","Test":"TestOutputWithSubtest"} | ||
{"Action":"output","Test":"TestOutputWithSubtest","Output":"=== RUN TestOutputWithSubtest\n"} | ||
{"Action":"run","Test":"TestOutputWithSubtest/sub_test"} | ||
{"Action":"output","Test":"TestOutputWithSubtest/sub_test","Output":"=== RUN TestOutputWithSubtest/sub_test\n"} | ||
{"Action":"run","Test":"TestOutputWithSubtest/sub_test/sub2"} | ||
{"Action":"output","Test":"TestOutputWithSubtest/sub_test/sub2","Output":"=== RUN TestOutputWithSubtest/sub_test/sub2\n"} | ||
{"Action":"run","Test":"TestOutputWithSubtest/sub_test2"} | ||
{"Action":"output","Test":"TestOutputWithSubtest/sub_test2","Output":"=== RUN TestOutputWithSubtest/sub_test2\n"} | ||
{"Action":"run","Test":"TestOutputWithSubtest/sub_test2/sub2"} | ||
{"Action":"output","Test":"TestOutputWithSubtest/sub_test2/sub2","Output":"=== RUN TestOutputWithSubtest/sub_test2/sub2\n"} | ||
{"Action":"output","Test":"TestOutputWithSubtest","Output":"--- FAIL: TestOutputWithSubtest (0.00s)\n"} | ||
{"Action":"output","Test":"TestOutputWithSubtest/sub_test","Output":" --- PASS: TestOutputWithSubtest/sub_test (0.00s)\n"} | ||
{"Action":"output","Test":"TestOutputWithSubtest/sub_test","Output":" foo_test.go:9: output from sub test\n"} | ||
{"Action":"output","Test":"TestOutputWithSubtest/sub_test","Output":" foo_test.go:11: more output from sub test\n"} | ||
{"Action":"output","Test":"TestOutputWithSubtest/sub_test","Output":" foo_test.go:16: more output from sub test\n"} | ||
{"Action":"output","Test":"TestOutputWithSubtest/sub_test/sub2","Output":" --- PASS: TestOutputWithSubtest/sub_test/sub2 (0.00s)\n"} | ||
{"Action":"output","Test":"TestOutputWithSubtest/sub_test/sub2","Output":" foo_test.go:14: output from sub2 test\n"} | ||
{"Action":"output","Test":"TestOutputWithSubtest/sub_test/sub2","Output":" foo_test.go:22: output from root test\n"} | ||
{"Action":"output","Test":"TestOutputWithSubtest/sub_test/sub2","Output":" foo_test.go:27: output from root test\n"} | ||
{"Action":"pass","Test":"TestOutputWithSubtest/sub_test/sub2"} | ||
{"Action":"pass","Test":"TestOutputWithSubtest/sub_test"} | ||
{"Action":"output","Test":"TestOutputWithSubtest/sub_test2","Output":" --- PASS: TestOutputWithSubtest/sub_test2 (0.00s)\n"} | ||
{"Action":"output","Test":"TestOutputWithSubtest/sub_test2","Output":" foo_test.go:21: output from sub test2\n"} | ||
{"Action":"output","Test":"TestOutputWithSubtest/sub_test2","Output":" foo_test.go:23: more output from sub test2\n"} | ||
{"Action":"output","Test":"TestOutputWithSubtest/sub_test2","Output":" foo_test.go:28: more output from sub test2\n"} | ||
{"Action":"output","Test":"TestOutputWithSubtest/sub_test2/sub2","Output":" --- PASS: TestOutputWithSubtest/sub_test2/sub2 (0.00s)\n"} | ||
{"Action":"output","Test":"TestOutputWithSubtest/sub_test2/sub2","Output":" foo_test.go:26: output from sub2 test\n"} | ||
{"Action":"output","Test":"TestOutputWithSubtest/sub_test2/sub2","Output":" foo_test.go:32: output after sub test\n"} | ||
{"Action":"pass","Test":"TestOutputWithSubtest/sub_test2/sub2"} | ||
{"Action":"pass","Test":"TestOutputWithSubtest/sub_test2"} | ||
{"Action":"fail","Test":"TestOutputWithSubtest"} | ||
{"Action":"output","Output":"FAIL\n"} | ||
{"Action":"output","Output":"FAIL\tgotest.tools/gotestsum/foo\t0.001s\n"} | ||
{"Action":"output","Output":"FAIL\n"} | ||
{"Action":"fail"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
=== Failed | ||
=== FAIL: TestOutputWithSubtest (0.00s) | ||
--- PASS: TestOutputWithSubtest/sub_test (0.00s) | ||
foo_test.go:9: output from sub test | ||
foo_test.go:11: more output from sub test | ||
foo_test.go:16: more output from sub test | ||
--- PASS: TestOutputWithSubtest/sub_test/sub2 (0.00s) | ||
foo_test.go:14: output from sub2 test | ||
foo_test.go:22: output from root test | ||
foo_test.go:27: output from root test | ||
--- PASS: TestOutputWithSubtest/sub_test2 (0.00s) | ||
foo_test.go:21: output from sub test2 | ||
foo_test.go:23: more output from sub test2 | ||
foo_test.go:28: more output from sub test2 | ||
--- PASS: TestOutputWithSubtest/sub_test2/sub2 (0.00s) | ||
foo_test.go:26: output from sub2 test | ||
foo_test.go:32: output after sub test | ||
|
||
|
||
DONE 5 tests, 1 failure in 0.000s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
|
||
=== Skipped | ||
=== SKIP: github.com/gotestyourself/gotestyourself/testjson/internal/good TestSkipped (0.00s) | ||
good_test.go:23: | ||
|
||
=== SKIP: github.com/gotestyourself/gotestyourself/testjson/internal/good TestSkippedWitLog (0.00s) | ||
good_test.go:27: the skip message | ||
|
||
=== SKIP: github.com/gotestyourself/gotestyourself/testjson/internal/stub TestSkipped (0.00s) | ||
stub_test.go:26: | ||
|
||
=== SKIP: github.com/gotestyourself/gotestyourself/testjson/internal/stub TestSkippedWitLog (0.00s) | ||
stub_test.go:30: the skip message | ||
|
||
|
||
=== Failed | ||
=== FAIL: github.com/gotestyourself/gotestyourself/testjson/internal/badmain (0.00s) | ||
sometimes main can exit 2 | ||
FAIL github.com/gotestyourself/gotestyourself/testjson/internal/badmain 0.010s | ||
|
||
=== FAIL: github.com/gotestyourself/gotestyourself/testjson/internal/stub TestFailed (0.00s) | ||
stub_test.go:34: this failed | ||
|
||
=== FAIL: github.com/gotestyourself/gotestyourself/testjson/internal/stub TestFailedWithStderr (0.00s) | ||
this is stderr | ||
stub_test.go:43: also failed | ||
|
||
=== FAIL: github.com/gotestyourself/gotestyourself/testjson/internal/stub TestNestedWithFailure/c (0.00s) | ||
--- FAIL: TestNestedWithFailure/c (0.00s) | ||
stub_test.go:65: failed | ||
|
||
=== FAIL: github.com/gotestyourself/gotestyourself/testjson/internal/stub TestNestedWithFailure (0.00s) | ||
|
||
|
||
DONE 46 tests, 4 skipped, 5 failures in 0.000s |