Explorar el Código

Add @Repeat to forbidden APIs

@Repeat should not be committed just like @Seed.
Use -Pdev to run annotated methods.
Simon Willnauer hace 10 años
padre
commit
1b2a3d0af6

+ 2 - 0
core/src/test/java/org/elasticsearch/test/test/SuiteScopeClusterTests.java

@@ -20,6 +20,7 @@ package org.elasticsearch.test.test;
 
 import com.carrotsearch.randomizedtesting.annotations.Repeat;
 
+import org.elasticsearch.common.SuppressForbidden;
 import org.elasticsearch.test.ElasticsearchIntegrationTest;
 import org.elasticsearch.test.TestCluster;
 import org.junit.Test;
@@ -39,6 +40,7 @@ public class SuiteScopeClusterTests extends ElasticsearchIntegrationTest {
     private static Long CLUSTER_SEED = null;
 
     @Test
+    @SuppressForbidden(reason = "repeat is a feature here")
     @Repeat(iterations = 10, useConstantSeed = true)
     public void testReproducible() throws IOException {
         if (ITER++ == 0) {

+ 1 - 0
dev-tools/src/main/resources/forbidden/test-signatures.txt

@@ -16,5 +16,6 @@
 
 com.carrotsearch.randomizedtesting.RandomizedTest#globalTempDir() @ Use newTempDirPath() instead
 com.carrotsearch.randomizedtesting.annotations.Seed @ Don't commit hardcoded seeds
+com.carrotsearch.randomizedtesting.annotations.Repeat @ Don't commit hardcoded repeats
 
 org.apache.lucene.codecs.Codec#setDefault(org.apache.lucene.codecs.Codec) @ Use the SuppressCodecs("*") annotation instead