Skip to content

Commit

Permalink
Change label for incomplete tests
Browse files Browse the repository at this point in the history
A panic is not the only thing which can cause this output. Some bugs in
tests2json caused by missing newline on stdout can also cause it.
  • Loading branch information
dnephin committed Apr 25, 2020
1 parent 9b766e9 commit 8ee9a8b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion testjson/summary.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func formatExecStatus(done bool) string {
// FormatDurationAsSeconds formats a time.Duration as a float with an s suffix.
func FormatDurationAsSeconds(d time.Duration, precision int) string {
if d == neverFinished {
return "panic"
return "unknown"
}
return fmt.Sprintf("%.[2]*[1]fs", d.Seconds(), precision)
}
Expand Down
2 changes: 1 addition & 1 deletion testjson/testdata/summary-missing-test-fail-event
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

=== Failed
=== FAIL: gotest.tools/v3/poll TestWaitOn_WithCompare (panic)
=== FAIL: gotest.tools/v3/poll TestWaitOn_WithCompare (unknown)
panic: runtime error: index out of range [1] with length 1

goroutine 7 [running]:
Expand Down

0 comments on commit 8ee9a8b

Please sign in to comment.