diff --git a/src/test/java/org/apache/lucene/util/AbstractRandomizedTest.java b/src/test/java/org/apache/lucene/util/AbstractRandomizedTest.java index 61c19345adc..502f223eaec 100644 --- a/src/test/java/org/apache/lucene/util/AbstractRandomizedTest.java +++ b/src/test/java/org/apache/lucene/util/AbstractRandomizedTest.java @@ -24,6 +24,7 @@ import com.carrotsearch.randomizedtesting.LifecycleScope; import com.carrotsearch.randomizedtesting.RandomizedContext; import com.carrotsearch.randomizedtesting.RandomizedTest; import com.carrotsearch.randomizedtesting.annotations.Listeners; +import com.carrotsearch.randomizedtesting.annotations.TestGroup; import com.carrotsearch.randomizedtesting.annotations.TestMethodProviders; import com.carrotsearch.randomizedtesting.rules.NoClassHooksShadowingRule; import com.carrotsearch.randomizedtesting.rules.NoInstanceHooksOverridesRule; @@ -42,6 +43,7 @@ import org.junit.runner.RunWith; import java.io.Closeable; import java.io.File; +import java.lang.annotation.*; import java.lang.reflect.Method; import java.util.*; import java.util.concurrent.atomic.AtomicReference; @@ -60,6 +62,16 @@ import java.util.logging.Logger; // NOTE: this class is in o.a.lucene.util since it uses some classes that are related // to the test framework that didn't make sense to copy but are package private access public class AbstractRandomizedTest extends RandomizedTest { + + /** + * Annotation for integration tests + */ + @Inherited + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @TestGroup(enabled = true, sysProperty = SYSPROP_INTEGRATION) + public @interface IntegrationTests {} + // -------------------------------------------------------------------- // Test groups, system properties and other annotations modifying tests // -------------------------------------------------------------------- @@ -69,6 +81,8 @@ public class AbstractRandomizedTest extends RandomizedTest { /** @see #ignoreAfterMaxFailures*/ public static final String SYSPROP_FAILFAST = "tests.failfast"; + + public static final String SYSPROP_INTEGRATION = "tests.integration"; // ----------------------------------------------------------------- // Truly immutable fields and constants, initialized once and valid diff --git a/src/test/java/org/elasticsearch/AbstractNodesTests.java b/src/test/java/org/elasticsearch/AbstractNodesTests.java index 204d69f4bfc..e0beddc8ff4 100644 --- a/src/test/java/org/elasticsearch/AbstractNodesTests.java +++ b/src/test/java/org/elasticsearch/AbstractNodesTests.java @@ -20,6 +20,7 @@ package org.elasticsearch; import com.google.common.collect.ImmutableSet; +import org.apache.lucene.util.AbstractRandomizedTest.IntegrationTests; import org.elasticsearch.client.Client; import org.elasticsearch.cluster.block.ClusterBlock; import org.elasticsearch.cluster.block.ClusterBlockLevel; @@ -39,11 +40,12 @@ import java.util.List; import java.util.Map; import static com.google.common.collect.Maps.newHashMap; -import static org.elasticsearch.common.settings.ImmutableSettings.Builder.EMPTY_SETTINGS; import static org.elasticsearch.common.settings.ImmutableSettings.settingsBuilder; +import static org.elasticsearch.common.settings.ImmutableSettings.Builder.EMPTY_SETTINGS; import static org.elasticsearch.node.NodeBuilder.nodeBuilder; @Ignore +@IntegrationTests public abstract class AbstractNodesTests extends ElasticsearchTestCase { private static Map nodes = newHashMap(); diff --git a/src/test/java/org/elasticsearch/AbstractSharedClusterTest.java b/src/test/java/org/elasticsearch/AbstractSharedClusterTest.java index e7ebb767739..90bb57bd8ed 100644 --- a/src/test/java/org/elasticsearch/AbstractSharedClusterTest.java +++ b/src/test/java/org/elasticsearch/AbstractSharedClusterTest.java @@ -20,6 +20,7 @@ package org.elasticsearch; import com.google.common.base.Joiner; import com.google.common.collect.Iterators; +import org.apache.lucene.util.AbstractRandomizedTest.IntegrationTests; import org.elasticsearch.action.ActionRequestBuilder; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.admin.cluster.health.ClusterHealthRequest; @@ -80,6 +81,7 @@ import static org.hamcrest.Matchers.equalTo; * transient settings the baseclass will raise and error. */ @Ignore +@IntegrationTests public abstract class AbstractSharedClusterTest extends ElasticsearchTestCase { private static TestCluster cluster;