Skip to content

Commit

Permalink
Add skip output to testname
Browse files Browse the repository at this point in the history
  • Loading branch information
dnephin committed Aug 12, 2023
1 parent 181f9a1 commit 2d9a370
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion testjson/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func testNameFormat(out io.Writer) EventFormatter {
pkg.WriteOutputTo(buf, tc.ID)
return formatTest()

case event.Action == ActionPass:
case event.Action == ActionPass || event.Action == ActionSkip:
return formatTest()
}
return nil
Expand Down
4 changes: 4 additions & 0 deletions testjson/testdata/format/testname-coverage.out
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ FAIL gotestsum/testjson/internal/badmain
PASS gotestsum/testjson/internal/good.TestPassed (0.00s)
PASS gotestsum/testjson/internal/good.TestPassedWithLog (0.00s)
PASS gotestsum/testjson/internal/good.TestPassedWithStdout (0.00s)
SKIP gotestsum/testjson/internal/good.TestSkipped (0.00s)
SKIP gotestsum/testjson/internal/good.TestSkippedWitLog (0.00s)
PASS gotestsum/testjson/internal/good.TestWithStderr (0.00s)
PASS gotestsum/testjson/internal/good.TestNestedSuccess/a/sub (0.00s)
PASS gotestsum/testjson/internal/good.TestNestedSuccess/a (0.00s)
Expand All @@ -21,6 +23,8 @@ PASS gotestsum/testjson/internal/good (coverage: 0.0% of statements)
PASS gotestsum/testjson/internal/stub.TestPassed (0.00s)
PASS gotestsum/testjson/internal/stub.TestPassedWithLog (0.00s)
PASS gotestsum/testjson/internal/stub.TestPassedWithStdout (0.00s)
SKIP gotestsum/testjson/internal/stub.TestSkipped (0.00s)
SKIP gotestsum/testjson/internal/stub.TestSkippedWitLog (0.00s)
=== RUN TestFailed
--- FAIL: TestFailed (0.00s)
stub_test.go:34: this failed
Expand Down
5 changes: 5 additions & 0 deletions testjson/testdata/format/testname-shuffle.out
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
sometimes main can exit 2
FAIL testjson/internal/badmain
PASS testjson/internal/good.TestPassedWithLog (0.00s)
SKIP testjson/internal/good.TestSkippedWitLog (0.00s)
PASS testjson/internal/good.TestPassedWithStdout (0.00s)
PASS testjson/internal/good.TestPassed (0.00s)
PASS testjson/internal/good.TestNestedSuccess/a/sub (0.00s)
Expand All @@ -13,6 +14,7 @@ PASS testjson/internal/good.TestNestedSuccess/d/sub (0.00s)
PASS testjson/internal/good.TestNestedSuccess/d (0.00s)
PASS testjson/internal/good.TestNestedSuccess (0.00s)
PASS testjson/internal/good.TestWithStderr (0.00s)
SKIP testjson/internal/good.TestSkipped (0.00s)
PASS testjson/internal/good.TestParallelTheSecond (0.01s)
PASS testjson/internal/good.TestParallelTheFirst (0.01s)
PASS testjson/internal/good.TestParallelTheThird (0.00s)
Expand Down Expand Up @@ -68,6 +70,7 @@ FAIL testjson/internal/parallelfails.TestParallelTheFirst (0.01s)
FAIL testjson/internal/parallelfails.TestParallelTheThird (0.00s)
FAIL testjson/internal/parallelfails (-test.shuffle 123456)
PASS testjson/internal/withfails.TestPassedWithStdout (0.00s)
SKIP testjson/internal/withfails.TestSkipped (0.00s)
PASS testjson/internal/withfails.TestNestedWithFailure/a/sub (0.00s)
PASS testjson/internal/withfails.TestNestedWithFailure/a (0.00s)
PASS testjson/internal/withfails.TestNestedWithFailure/b/sub (0.00s)
Expand All @@ -83,6 +86,7 @@ PASS testjson/internal/withfails.TestNestedWithFailure/d (0.00s)
FAIL testjson/internal/withfails.TestNestedWithFailure (0.00s)
PASS testjson/internal/withfails.TestWithStderr (0.00s)
PASS testjson/internal/withfails.TestPassed (0.00s)
SKIP testjson/internal/withfails.TestSkippedWitLog (0.00s)
PASS testjson/internal/withfails.TestNestedSuccess/a/sub (0.00s)
PASS testjson/internal/withfails.TestNestedSuccess/a (0.00s)
PASS testjson/internal/withfails.TestNestedSuccess/b/sub (0.00s)
Expand All @@ -93,6 +97,7 @@ PASS testjson/internal/withfails.TestNestedSuccess/d/sub (0.00s)
PASS testjson/internal/withfails.TestNestedSuccess/d (0.00s)
PASS testjson/internal/withfails.TestNestedSuccess (0.00s)
PASS testjson/internal/withfails.TestPassedWithLog (0.00s)
SKIP testjson/internal/withfails.TestTimeout (0.00s)
=== RUN TestFailedWithStderr
this is stderr
fails_test.go:43: also failed
Expand Down
5 changes: 5 additions & 0 deletions testjson/testdata/format/testname.out
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ EMPTY testjson/internal/empty (cached)
PASS testjson/internal/good.TestPassed (0.00s)
PASS testjson/internal/good.TestPassedWithLog (0.00s)
PASS testjson/internal/good.TestPassedWithStdout (0.00s)
SKIP testjson/internal/good.TestSkipped (0.00s)
SKIP testjson/internal/good.TestSkippedWitLog (0.00s)
PASS testjson/internal/good.TestWithStderr (0.00s)
PASS testjson/internal/good.TestNestedSuccess/a/sub (0.00s)
PASS testjson/internal/good.TestNestedSuccess/a (0.00s)
Expand Down Expand Up @@ -71,6 +73,8 @@ FAIL testjson/internal/parallelfails
PASS testjson/internal/withfails.TestPassed (0.00s)
PASS testjson/internal/withfails.TestPassedWithLog (0.00s)
PASS testjson/internal/withfails.TestPassedWithStdout (0.00s)
SKIP testjson/internal/withfails.TestSkipped (0.00s)
SKIP testjson/internal/withfails.TestSkippedWitLog (0.00s)
=== RUN TestFailed
fails_test.go:34: this failed
--- FAIL: TestFailed (0.00s)
Expand Down Expand Up @@ -103,6 +107,7 @@ PASS testjson/internal/withfails.TestNestedSuccess/c (0.00s)
PASS testjson/internal/withfails.TestNestedSuccess/d/sub (0.00s)
PASS testjson/internal/withfails.TestNestedSuccess/d (0.00s)
PASS testjson/internal/withfails.TestNestedSuccess (0.00s)
SKIP testjson/internal/withfails.TestTimeout (0.00s)
PASS testjson/internal/withfails.TestParallelTheFirst (0.01s)
PASS testjson/internal/withfails.TestParallelTheThird (0.00s)
PASS testjson/internal/withfails.TestParallelTheSecond (0.01s)
Expand Down

0 comments on commit 2d9a370

Please sign in to comment.