diff --git a/pom.xml b/pom.xml index a83e7988622..a5d3b0a433c 100644 --- a/pom.xml +++ b/pom.xml @@ -101,89 +101,6 @@ com.carrotsearch.randomizedtesting junit4-maven-plugin - - - tests - test - - junit4 - - - 20 - pipe,warn - true - - - - - - - - - 1 - - - - - - - **/*Tests.class - **/*Test.class - - - **/Abstract*.class - **/*StressTest.class - - - ${tests.jvm.argline} - - - -Xmx512m - -Xss256k - -XX:MaxDirectMemorySize=512m - -Des.logger.prefix= - - ${tests.shuffle} - ${tests.verbose} - ${tests.seed} - ${tests.failfast} - - - ${tests.jvm.argline} - ${tests.iters} - ${tests.maxfailures} - ${tests.failfast} - ${tests.class} - ${tests.method} - ${tests.nightly} - ${tests.badapples} - ${tests.weekly} - ${tests.slow} - ${tests.aws} - ${tests.config} - ${tests.awaitsfix} - ${tests.slow} - ${tests.timeoutSuite} - ${tests.showSuccess} - ${tests.integration} - ${tests.cluster_seed} - ${tests.client.ratio} - ${es.logger.level} - true - - - - org.apache.maven.plugins diff --git a/src/test/java/org/elasticsearch/cloud/aws/AbstractAwsTest.java b/src/test/java/org/elasticsearch/cloud/aws/AbstractAwsTest.java index abd4bfaf374..7ed03939b46 100644 --- a/src/test/java/org/elasticsearch/cloud/aws/AbstractAwsTest.java +++ b/src/test/java/org/elasticsearch/cloud/aws/AbstractAwsTest.java @@ -20,6 +20,7 @@ package org.elasticsearch.cloud.aws; import com.carrotsearch.randomizedtesting.annotations.TestGroup; + import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.ImmutableSettings; import org.elasticsearch.common.settings.Settings; @@ -27,6 +28,7 @@ import org.elasticsearch.env.Environment; import org.elasticsearch.env.FailedToResolveConfigException; import org.elasticsearch.plugins.PluginsService; import org.elasticsearch.test.ElasticsearchIntegrationTest; +import org.elasticsearch.test.ElasticsearchIntegrationTest.ThirdParty; import org.junit.After; import org.junit.Before; @@ -38,8 +40,12 @@ import java.util.HashMap; import java.util.Map; /** - * + * Base class for AWS tests that require credentials. + *

+ * You must specify {@code -Dtests.thirdparty=true -Dtests.config=/path/to/config} + * in order to run these tests. */ +@ThirdParty public abstract class AbstractAwsTest extends ElasticsearchIntegrationTest { /** @@ -71,22 +77,6 @@ public abstract class AbstractAwsTest extends ElasticsearchIntegrationTest { } } - - /** - * Annotation for tests that require AWS to run. AWS tests are disabled by default. - * Look at README file for details on how to run tests - */ - @Documented - @Inherited - @Retention(RetentionPolicy.RUNTIME) - @TestGroup(enabled = false, sysProperty = SYSPROP_AWS) - public @interface AwsTest { - } - - /** - */ - public static final String SYSPROP_AWS = "tests.aws"; - @Override protected Settings nodeSettings(int nodeOrdinal) { ImmutableSettings.Builder settings = ImmutableSettings.builder() @@ -105,10 +95,10 @@ public abstract class AbstractAwsTest extends ElasticsearchIntegrationTest { if (Strings.hasText(System.getProperty("tests.config"))) { settings.loadFromUrl(environment.resolveConfig(System.getProperty("tests.config"))); } else { - fail("to run integration tests, you need to set -Dtest.aws=true and -Dtests.config=/path/to/elasticsearch.yml"); + throw new IllegalStateException("to run integration tests, you need to set -Dtest.thirdparty=true and -Dtests.config=/path/to/elasticsearch.yml"); } } catch (FailedToResolveConfigException exception) { - fail("your test configuration file is incorrect: " + System.getProperty("tests.config")); + throw new IllegalStateException("your test configuration file is incorrect: " + System.getProperty("tests.config"), exception); } return settings.build(); } diff --git a/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryITest.java b/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryITest.java index 13e85280c44..d656d6485f6 100644 --- a/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryITest.java +++ b/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryITest.java @@ -21,7 +21,6 @@ package org.elasticsearch.discovery.ec2; import org.elasticsearch.cloud.aws.AbstractAwsTest; -import org.elasticsearch.cloud.aws.AbstractAwsTest.AwsTest; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.plugins.PluginsService; import org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope; @@ -35,7 +34,6 @@ import static org.elasticsearch.common.settings.ImmutableSettings.settingsBuilde * starting. * This test requires AWS to run. */ -@AwsTest @ClusterScope(scope = Scope.TEST, numDataNodes = 0, numClientNodes = 0, transportClientRatio = 0.0) public class Ec2DiscoveryITest extends AbstractAwsTest { diff --git a/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryUpdateSettingsITest.java b/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryUpdateSettingsITest.java index ca1b4d4ef19..f3038b6f017 100644 --- a/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryUpdateSettingsITest.java +++ b/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryUpdateSettingsITest.java @@ -22,7 +22,6 @@ package org.elasticsearch.discovery.ec2; import org.elasticsearch.action.admin.cluster.settings.ClusterUpdateSettingsResponse; import org.elasticsearch.cloud.aws.AbstractAwsTest; -import org.elasticsearch.cloud.aws.AbstractAwsTest.AwsTest; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.plugins.PluginsService; import org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope; @@ -37,7 +36,6 @@ import static org.hamcrest.CoreMatchers.is; * starting. * This test requires AWS to run. */ -@AwsTest @ClusterScope(scope = Scope.TEST, numDataNodes = 0, numClientNodes = 0, transportClientRatio = 0.0) public class Ec2DiscoveryUpdateSettingsITest extends AbstractAwsTest { diff --git a/src/test/java/org/elasticsearch/repositories/s3/AbstractS3SnapshotRestoreTest.java b/src/test/java/org/elasticsearch/repositories/s3/AbstractS3SnapshotRestoreTest.java index b64e2944aa9..c3807745a58 100644 --- a/src/test/java/org/elasticsearch/repositories/s3/AbstractS3SnapshotRestoreTest.java +++ b/src/test/java/org/elasticsearch/repositories/s3/AbstractS3SnapshotRestoreTest.java @@ -23,13 +23,13 @@ import com.amazonaws.services.s3.AmazonS3; import com.amazonaws.services.s3.model.DeleteObjectsRequest; import com.amazonaws.services.s3.model.ObjectListing; import com.amazonaws.services.s3.model.S3ObjectSummary; + import org.elasticsearch.action.admin.cluster.repositories.put.PutRepositoryResponse; import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotResponse; import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotResponse; import org.elasticsearch.client.Client; import org.elasticsearch.client.ClusterAdminClient; import org.elasticsearch.cloud.aws.AbstractAwsTest; -import org.elasticsearch.cloud.aws.AbstractAwsTest.AwsTest; import org.elasticsearch.cloud.aws.AwsS3Service; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.common.settings.ImmutableSettings; @@ -53,7 +53,6 @@ import static org.hamcrest.Matchers.*; /** */ -@AwsTest @ClusterScope(scope = Scope.SUITE, numDataNodes = 2, numClientNodes = 0, transportClientRatio = 0.0) abstract public class AbstractS3SnapshotRestoreTest extends AbstractAwsTest {