Skip to content

Commit

Permalink
Relaxing checks for stderr to not fail on download lines
Browse files Browse the repository at this point in the history
  • Loading branch information
cardil committed Jul 18, 2024
1 parent f103e9a commit 3a99010
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion test/unit/presubmit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func TestPresubmitTestMainFunc(t *testing.T) {
contains("Unit tests for knative.dev/hack/schema"),
contains("Unit tests for knative.dev/hack"),
contains("Running go test with args: -short -race -count 1 ./..."),
contains("go run gotest.tools/gotestsum@v1.11.0 --format testname --junitfile"),
contains("👻 go run gotest.tools/gotestsum@v1.11.0 --format testname --junitfile"),
contains("-- -short -race -count 1 ./..."),
header("UNIT TESTS PASSED"),
},
Expand Down
10 changes: 5 additions & 5 deletions test/unit/report_go_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,26 @@ func TestReportGoTest(t *testing.T) {
contains("fatal\tTestFailsWithFatal\tlibrary_test.go:48\tFailed with logger.Fatal()"),
contains("FAIL test.TestFailsWithFatal"),
}, logChecks...),
stderr: lines("exit status 1"),
stderr: []check{contains("exit status 1")},
}, {
name: `report_go_test -tags=library -run TestFailsWithPanic ./test`,
stdout: append([]check{
contains("=== RUN TestFailsWithPanic"),
contains("panic: test timed out after 5m0s"),
contains("FAIL test.TestFailsWithPanic"),
}, logChecks...),
stderr: lines("exit status 1"),
stderr: []check{contains("exit status 1")},
}, {
name: `report_go_test -tags=library -run TestFailsWithSigQuit ./test`,
stdout: append([]check{
contains("=== RUN TestFailsWithSigQuit"),
contains("SIGQUIT: quit"),
contains("FAIL test.TestFailsWithSigQuit"),
}, logChecks...),
stderr: lines("exit status 1"),
stderr: []check{contains("exit status 1")},
}}
for _, tc := range tcs {
tc := tc
for i := range tcs {
tc := tcs[i]
t.Run(tc.name, tc.test(sc))
}
}

0 comments on commit 3a99010

Please sign in to comment.