Skip to content

Commit

Permalink
test(retry): add validation to ensure at least one test case is resol…
Browse files Browse the repository at this point in the history
…ved (#1109)

* If an overly specific allowed filter can prevent any test cases from being passed to the runner, add validation to ensure there is at least one test case.
  • Loading branch information
BenWhitehead committed Oct 15, 2021
1 parent cdb86dc commit ada8d94
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -20,6 +20,7 @@
import static com.google.cloud.storage.PackagePrivateMethodWorkarounds.bucketCopyWithStorage;
import static com.google.cloud.storage.conformance.retry.Ctx.ctx;
import static com.google.cloud.storage.conformance.retry.State.empty;
import static com.google.common.truth.Truth.assertThat;
import static java.util.Objects.requireNonNull;
import static org.junit.Assert.assertNotNull;

Expand Down Expand Up @@ -151,7 +152,9 @@ public static Collection<Object[]> testCases() throws IOException {
.setTestAllowFilter(RetryTestCaseResolver.includeAll())
.build();

return resolver.getRetryTestCases().stream()
List<RetryTestCase> retryTestCases = resolver.getRetryTestCases();
assertThat(retryTestCases).isNotEmpty();
return retryTestCases.stream()
.map(rtc -> new Object[] {rtc.testRetryConformance, rtc.rpcMethodMapping})
.collect(ImmutableList.toImmutableList());
}
Expand Down

0 comments on commit ada8d94

Please sign in to comment.