Skip to content

Commit d40fbff

Browse files
cjc25tritone
andauthored
fix(storage): Skip only specific transport tests. (#11016)
Some client tests only work with certain transports, so we try to skip them. However by calling `t.Skip()` before the per-transport `t.Run()`, we skipped every remaining sub-test once we hit that condition. This changes the code to skip only the relevant transport, by skipping the testing.T for the sub-test. Co-authored-by: Chris Cotter <[email protected]>
1 parent ff06fc2 commit d40fbff

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: storage/client_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -1584,10 +1584,10 @@ func transportClientTest(ctx context.Context, t *testing.T, test func(*testing.T
15841584
checkEmulatorEnvironment(t)
15851585

15861586
for transport, client := range emulatorClients {
1587-
if reason := ctx.Value(skipTransportTestKey(transport)); reason != nil {
1588-
t.Skip("transport", fmt.Sprintf("%q", transport), "explicitly skipped:", reason)
1589-
}
15901587
t.Run(transport, func(t *testing.T) {
1588+
if reason := ctx.Value(skipTransportTestKey(transport)); reason != nil {
1589+
t.Skip("transport", fmt.Sprintf("%q", transport), "explicitly skipped:", reason)
1590+
}
15911591
project := fmt.Sprintf("%s-project", transport)
15921592
bucket := fmt.Sprintf("%s-bucket-%d", transport, time.Now().Nanosecond())
15931593
test(t, ctx, project, bucket, client)

0 commit comments

Comments
 (0)