Skip to content

Commit

Permalink
Move testuitil check after skipIntegrationTests
Browse files Browse the repository at this point in the history
  • Loading branch information
RafalKorepta committed Jan 7, 2025
1 parent f1389bb commit 0312468
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/testutil/testutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,17 @@ func Context(t *testing.T) context.Context {
func SkipIfNotIntegration(t *testing.T) {
const prefix = "TestIntegration"

if !strings.HasPrefix(t.Name(), prefix) {
t.Fatalf("tests calling SkipIfNotIntegration must be prefixed with %q; got: %s", prefix, t.Name())
}

if skipIntegrationTests {
t.Skipf("integration build flag not set; skipping integration test")
} else if testing.Short() {
t.Skipf("-short specified; skipping integration test")
} else {
RequireTimeout(t, 20*time.Minute)
}

if !strings.HasPrefix(t.Name(), prefix) {
t.Fatalf("tests calling SkipIfNotIntegration must be prefixed with %q; got: %s", prefix, t.Name())
}
}

// RequireTimeout asserts that the `-timeout` flag is at least `minimum`.
Expand Down

0 comments on commit 0312468

Please sign in to comment.