From 46342ac625c942956abf867bed19edf12c25e107 Mon Sep 17 00:00:00 2001 From: Jake Landis Date: Tue, 28 Jul 2020 16:49:41 -0500 Subject: [PATCH] Convert discovery-* from integTest to [yaml | java]RestTest or internalClusterTest (#60084) For OSS plugins that begin with discovery-*, the integTest task is now a no-op and all of the tests are now executed via a test, yamlRestTest, javaRestTest, or internalClusterTest. related: #56841 related: #59444 --- plugins/discovery-azure-classic/build.gradle | 9 ++-- .../AbstractAzureComputeServiceTestCase.java | 0 .../AzureDiscoveryClusterFormationTests.java | 1 - .../azure/classic/AzureSimpleTests.java | 0 .../classic/AzureTwoStartedNodesTests.java | 0 ...veryAzureClassicClientYamlTestSuiteIT.java | 0 .../test/discovery_azure_classic/10_basic.yml | 0 plugins/discovery-ec2/build.gradle | 3 +- .../discovery-ec2/qa/amazon-ec2/build.gradle | 42 +++++++++++-------- ...azonEC2DiscoveryClientYamlTestSuiteIT.java | 2 +- .../discovery/ec2/AmazonEC2Fixture.java | 2 +- .../test/discovery_ec2/10_basic.yml | 0 .../discovery/ec2/AbstractAwsTestCase.java | 0 .../ec2/Ec2DiscoveryUpdateSettingsTests.java | 0 .../ec2/CloudAwsClientYamlTestSuiteIT.java | 0 .../test/discovery_ec2/10_basic.yml | 0 plugins/discovery-gce/build.gradle | 3 +- plugins/discovery-gce/qa/gce/build.gradle | 18 ++++---- .../GCEDiscoveryClientYamlTestSuiteIT.java | 0 .../elasticsearch/cloud/gce/GCEFixture.java | 0 .../test/discovery_gce/10_basic.yml | 0 .../discovery/gce/GceDiscoverTests.java | 0 .../DiscoveryGceClientYamlTestSuiteIT.java | 0 .../test/discovery_gce/10_basic.yml | 0 24 files changed, 44 insertions(+), 36 deletions(-) rename plugins/discovery-azure-classic/src/{test => internalClusterTest}/java/org/elasticsearch/cloud/azure/classic/AbstractAzureComputeServiceTestCase.java (100%) rename plugins/discovery-azure-classic/src/{test => internalClusterTest}/java/org/elasticsearch/discovery/azure/classic/AzureDiscoveryClusterFormationTests.java (99%) rename plugins/discovery-azure-classic/src/{test => internalClusterTest}/java/org/elasticsearch/discovery/azure/classic/AzureSimpleTests.java (100%) rename plugins/discovery-azure-classic/src/{test => internalClusterTest}/java/org/elasticsearch/discovery/azure/classic/AzureTwoStartedNodesTests.java (100%) rename plugins/discovery-azure-classic/src/{test => yamlRestTest}/java/org/elasticsearch/discovery/azure/classic/DiscoveryAzureClassicClientYamlTestSuiteIT.java (100%) rename plugins/discovery-azure-classic/src/{test => yamlRestTest}/resources/rest-api-spec/test/discovery_azure_classic/10_basic.yml (100%) rename plugins/discovery-ec2/qa/amazon-ec2/src/{test => yamlRestTest}/java/org/elasticsearch/discovery/ec2/AmazonEC2DiscoveryClientYamlTestSuiteIT.java (95%) rename plugins/discovery-ec2/qa/amazon-ec2/src/{test => yamlRestTest}/java/org/elasticsearch/discovery/ec2/AmazonEC2Fixture.java (99%) rename plugins/discovery-ec2/qa/amazon-ec2/src/{test => yamlRestTest}/resources/rest-api-spec/test/discovery_ec2/10_basic.yml (100%) rename plugins/discovery-ec2/src/{test => internalClusterTest}/java/org/elasticsearch/discovery/ec2/AbstractAwsTestCase.java (100%) rename plugins/discovery-ec2/src/{test => internalClusterTest}/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryUpdateSettingsTests.java (100%) rename plugins/discovery-ec2/src/{test => yamlRestTest}/java/org/elasticsearch/discovery/ec2/CloudAwsClientYamlTestSuiteIT.java (100%) rename plugins/discovery-ec2/src/{test => yamlRestTest}/resources/rest-api-spec/test/discovery_ec2/10_basic.yml (100%) rename plugins/discovery-gce/qa/gce/src/{test => yamlRestTest}/java/org/elasticsearch/cloud/gce/GCEDiscoveryClientYamlTestSuiteIT.java (100%) rename plugins/discovery-gce/qa/gce/src/{test => yamlRestTest}/java/org/elasticsearch/cloud/gce/GCEFixture.java (100%) rename plugins/discovery-gce/qa/gce/src/{test => yamlRestTest}/resources/rest-api-spec/test/discovery_gce/10_basic.yml (100%) rename plugins/discovery-gce/src/{test => internalClusterTest}/java/org/elasticsearch/discovery/gce/GceDiscoverTests.java (100%) rename plugins/discovery-gce/src/{test => yamlRestTest}/java/org/elasticsearch/discovery/gce/DiscoveryGceClientYamlTestSuiteIT.java (100%) rename plugins/discovery-gce/src/{test => yamlRestTest}/resources/rest-api-spec/test/discovery_gce/10_basic.yml (100%) diff --git a/plugins/discovery-azure-classic/build.gradle b/plugins/discovery-azure-classic/build.gradle index bca5613bbfe56..8bb934befb7aa 100644 --- a/plugins/discovery-azure-classic/build.gradle +++ b/plugins/discovery-azure-classic/build.gradle @@ -19,7 +19,8 @@ import org.elasticsearch.gradle.info.BuildParams * specific language governing permissions and limitations * under the License. */ -apply plugin: 'elasticsearch.rest-resources' +apply plugin: 'elasticsearch.yaml-rest-test' +apply plugin: 'elasticsearch.internal-cluster-test' esplugin { description 'The Azure Classic Discovery plugin allows to use Azure Classic API for the unicast discovery mechanism' @@ -63,6 +64,7 @@ restResources { includeCore '_common', 'cluster', 'nodes' } } + // needed to be consistent with ssl host checking String host = InetAddress.getLoopbackAddress().getHostAddress() @@ -88,9 +90,10 @@ task createKey(type: LoggedExec) { '-keypass', 'keypass', '-storepass', 'keypass' } - +//no unit tests +test.enabled = false // add keystore to test classpath: it expects it there -processTestResources { +processInternalClusterTestResources { from createKey } diff --git a/plugins/discovery-azure-classic/src/test/java/org/elasticsearch/cloud/azure/classic/AbstractAzureComputeServiceTestCase.java b/plugins/discovery-azure-classic/src/internalClusterTest/java/org/elasticsearch/cloud/azure/classic/AbstractAzureComputeServiceTestCase.java similarity index 100% rename from plugins/discovery-azure-classic/src/test/java/org/elasticsearch/cloud/azure/classic/AbstractAzureComputeServiceTestCase.java rename to plugins/discovery-azure-classic/src/internalClusterTest/java/org/elasticsearch/cloud/azure/classic/AbstractAzureComputeServiceTestCase.java diff --git a/plugins/discovery-azure-classic/src/test/java/org/elasticsearch/discovery/azure/classic/AzureDiscoveryClusterFormationTests.java b/plugins/discovery-azure-classic/src/internalClusterTest/java/org/elasticsearch/discovery/azure/classic/AzureDiscoveryClusterFormationTests.java similarity index 99% rename from plugins/discovery-azure-classic/src/test/java/org/elasticsearch/discovery/azure/classic/AzureDiscoveryClusterFormationTests.java rename to plugins/discovery-azure-classic/src/internalClusterTest/java/org/elasticsearch/discovery/azure/classic/AzureDiscoveryClusterFormationTests.java index e723520f5c8b5..95fcbc948b337 100644 --- a/plugins/discovery-azure-classic/src/test/java/org/elasticsearch/discovery/azure/classic/AzureDiscoveryClusterFormationTests.java +++ b/plugins/discovery-azure-classic/src/internalClusterTest/java/org/elasticsearch/discovery/azure/classic/AzureDiscoveryClusterFormationTests.java @@ -72,7 +72,6 @@ @ESIntegTestCase.ClusterScope(numDataNodes = 2, numClientNodes = 0) @SuppressForbidden(reason = "use http server") -// TODO this should be a IT but currently all ITs in this project run against a real cluster public class AzureDiscoveryClusterFormationTests extends ESIntegTestCase { public static class TestPlugin extends Plugin { diff --git a/plugins/discovery-azure-classic/src/test/java/org/elasticsearch/discovery/azure/classic/AzureSimpleTests.java b/plugins/discovery-azure-classic/src/internalClusterTest/java/org/elasticsearch/discovery/azure/classic/AzureSimpleTests.java similarity index 100% rename from plugins/discovery-azure-classic/src/test/java/org/elasticsearch/discovery/azure/classic/AzureSimpleTests.java rename to plugins/discovery-azure-classic/src/internalClusterTest/java/org/elasticsearch/discovery/azure/classic/AzureSimpleTests.java diff --git a/plugins/discovery-azure-classic/src/test/java/org/elasticsearch/discovery/azure/classic/AzureTwoStartedNodesTests.java b/plugins/discovery-azure-classic/src/internalClusterTest/java/org/elasticsearch/discovery/azure/classic/AzureTwoStartedNodesTests.java similarity index 100% rename from plugins/discovery-azure-classic/src/test/java/org/elasticsearch/discovery/azure/classic/AzureTwoStartedNodesTests.java rename to plugins/discovery-azure-classic/src/internalClusterTest/java/org/elasticsearch/discovery/azure/classic/AzureTwoStartedNodesTests.java diff --git a/plugins/discovery-azure-classic/src/test/java/org/elasticsearch/discovery/azure/classic/DiscoveryAzureClassicClientYamlTestSuiteIT.java b/plugins/discovery-azure-classic/src/yamlRestTest/java/org/elasticsearch/discovery/azure/classic/DiscoveryAzureClassicClientYamlTestSuiteIT.java similarity index 100% rename from plugins/discovery-azure-classic/src/test/java/org/elasticsearch/discovery/azure/classic/DiscoveryAzureClassicClientYamlTestSuiteIT.java rename to plugins/discovery-azure-classic/src/yamlRestTest/java/org/elasticsearch/discovery/azure/classic/DiscoveryAzureClassicClientYamlTestSuiteIT.java diff --git a/plugins/discovery-azure-classic/src/test/resources/rest-api-spec/test/discovery_azure_classic/10_basic.yml b/plugins/discovery-azure-classic/src/yamlRestTest/resources/rest-api-spec/test/discovery_azure_classic/10_basic.yml similarity index 100% rename from plugins/discovery-azure-classic/src/test/resources/rest-api-spec/test/discovery_azure_classic/10_basic.yml rename to plugins/discovery-azure-classic/src/yamlRestTest/resources/rest-api-spec/test/discovery_azure_classic/10_basic.yml diff --git a/plugins/discovery-ec2/build.gradle b/plugins/discovery-ec2/build.gradle index 7435571227992..af912a14d55f8 100644 --- a/plugins/discovery-ec2/build.gradle +++ b/plugins/discovery-ec2/build.gradle @@ -18,7 +18,8 @@ import org.elasticsearch.gradle.info.BuildParams * specific language governing permissions and limitations * under the License. */ -apply plugin: 'elasticsearch.rest-resources' +apply plugin: 'elasticsearch.yaml-rest-test' +apply plugin: 'elasticsearch.internal-cluster-test' esplugin { description 'The EC2 discovery plugin allows to use AWS API for the unicast discovery mechanism.' diff --git a/plugins/discovery-ec2/qa/amazon-ec2/build.gradle b/plugins/discovery-ec2/qa/amazon-ec2/build.gradle index c7f94ef278b66..49d155f7299f6 100644 --- a/plugins/discovery-ec2/qa/amazon-ec2/build.gradle +++ b/plugins/discovery-ec2/qa/amazon-ec2/build.gradle @@ -22,15 +22,14 @@ import org.elasticsearch.gradle.MavenFilteringHack import org.elasticsearch.gradle.info.BuildParams import org.elasticsearch.gradle.test.AntFixture import org.elasticsearch.gradle.test.RestIntegTestTask +import org.elasticsearch.gradle.test.rest.YamlRestTestPlugin import static org.elasticsearch.gradle.PropertyNormalization.IGNORE_VALUE -apply plugin: 'elasticsearch.standalone-rest-test' -apply plugin: 'elasticsearch.rest-test' -apply plugin: 'elasticsearch.rest-resources' +apply plugin: 'elasticsearch.yaml-rest-test' dependencies { - testImplementation project(':plugins:discovery-ec2') + yamlRestTestImplementation project(':plugins:discovery-ec2') } restResources { @@ -45,13 +44,13 @@ Map expansions = [ 'expected_nodes': ec2NumberOfNodes ] -processTestResources { +processYamlRestTestResources { inputs.properties(expansions) MavenFilteringHack.filter(it, expansions) } -// disable default test task, use spezialized ones below -integTest.enabled = false +// disable default yamlRestTest task, use spezialized ones below +yamlRestTest.enabled = false /* * Test using various credential providers (see also https://docs.aws.amazon.com/sdk-for-java/v2/developer-guide/credentials.html): @@ -66,19 +65,26 @@ integTest.enabled = false */ ['KeyStore', 'EnvVariables', 'SystemProperties', 'ContainerCredentials', 'InstanceProfile'].forEach { action -> AntFixture fixture = tasks.create(name: "ec2Fixture${action}", type: AntFixture) { - dependsOn compileTestJava - env 'CLASSPATH', "${-> project.sourceSets.test.runtimeClasspath.asPath}" + dependsOn project.sourceSets.yamlRestTest.runtimeClasspath + env 'CLASSPATH', "${-> project.sourceSets.yamlRestTest.runtimeClasspath.asPath}" executable = "${BuildParams.runtimeJavaHome}/bin/java" - args 'org.elasticsearch.discovery.ec2.AmazonEC2Fixture', baseDir, "${buildDir}/testclusters/integTest${action}-1/config/unicast_hosts.txt" + args 'org.elasticsearch.discovery.ec2.AmazonEC2Fixture', baseDir, "${buildDir}/testclusters/yamlRestTest${action}-1/config/unicast_hosts.txt" } - tasks.create(name: "integTest${action}", type: RestIntegTestTask) { + tasks.create(name: "yamlRestTest${action}", type: RestIntegTestTask) { dependsOn fixture, project(':plugins:discovery-ec2').bundlePlugin } + SourceSetContainer sourceSets = project.getExtensions().getByType(SourceSetContainer.class); + SourceSet yamlRestTestSourceSet = sourceSets.getByName(YamlRestTestPlugin.SOURCE_SET_NAME) + "yamlRestTest${action}" { + runner { + setTestClassesDirs(yamlRestTestSourceSet.getOutput().getClassesDirs()) + setClasspath(yamlRestTestSourceSet.getRuntimeClasspath()) + } + } + check.dependsOn("yamlRestTest${action}") - check.dependsOn("integTest${action}") - - testClusters."integTest${action}" { + testClusters."yamlRestTest${action}" { numberOfNodes = ec2NumberOfNodes plugin project(':plugins:discovery-ec2').bundlePlugin.archiveFile @@ -91,19 +97,19 @@ integTest.enabled = false } // Extra config for KeyStore -testClusters.integTestKeyStore { +testClusters.yamlRestTestKeyStore { keystore 'discovery.ec2.access_key', 'ec2_integration_test_access_key' keystore 'discovery.ec2.secret_key', 'ec2_integration_test_secret_key' } // Extra config for EnvVariables -testClusters.integTestEnvVariables { +testClusters.yamlRestTestEnvVariables { environment 'AWS_ACCESS_KEY_ID', 'ec2_integration_test_access_key' environment 'AWS_SECRET_ACCESS_KEY', 'ec2_integration_test_secret_key' } // Extra config for SystemProperties -testClusters.integTestSystemProperties { +testClusters.yamlRestTestSystemProperties { systemProperty 'aws.accessKeyId', 'ec2_integration_test_access_key' systemProperty 'aws.secretKey', 'ec2_integration_test_secret_key' } @@ -111,7 +117,7 @@ testClusters.integTestSystemProperties { // Extra config for ContainerCredentials ec2FixtureContainerCredentials.env 'ACTIVATE_CONTAINER_CREDENTIALS', true -testClusters.integTestContainerCredentials { +testClusters.yamlRestTestContainerCredentials { environment 'AWS_CONTAINER_CREDENTIALS_FULL_URI', { "http://${-> tasks.findByName("ec2FixtureContainerCredentials").addressAndPort}/ecs_credentials_endpoint" }, IGNORE_VALUE } diff --git a/plugins/discovery-ec2/qa/amazon-ec2/src/test/java/org/elasticsearch/discovery/ec2/AmazonEC2DiscoveryClientYamlTestSuiteIT.java b/plugins/discovery-ec2/qa/amazon-ec2/src/yamlRestTest/java/org/elasticsearch/discovery/ec2/AmazonEC2DiscoveryClientYamlTestSuiteIT.java similarity index 95% rename from plugins/discovery-ec2/qa/amazon-ec2/src/test/java/org/elasticsearch/discovery/ec2/AmazonEC2DiscoveryClientYamlTestSuiteIT.java rename to plugins/discovery-ec2/qa/amazon-ec2/src/yamlRestTest/java/org/elasticsearch/discovery/ec2/AmazonEC2DiscoveryClientYamlTestSuiteIT.java index 09d5a8d6fdf28..72e86b9dc3d54 100644 --- a/plugins/discovery-ec2/qa/amazon-ec2/src/test/java/org/elasticsearch/discovery/ec2/AmazonEC2DiscoveryClientYamlTestSuiteIT.java +++ b/plugins/discovery-ec2/qa/amazon-ec2/src/yamlRestTest/java/org/elasticsearch/discovery/ec2/AmazonEC2DiscoveryClientYamlTestSuiteIT.java @@ -32,6 +32,6 @@ public AmazonEC2DiscoveryClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandi @ParametersFactory public static Iterable parameters() throws Exception { - return ESClientYamlSuiteTestCase.createParameters(); + return createParameters(); } } diff --git a/plugins/discovery-ec2/qa/amazon-ec2/src/test/java/org/elasticsearch/discovery/ec2/AmazonEC2Fixture.java b/plugins/discovery-ec2/qa/amazon-ec2/src/yamlRestTest/java/org/elasticsearch/discovery/ec2/AmazonEC2Fixture.java similarity index 99% rename from plugins/discovery-ec2/qa/amazon-ec2/src/test/java/org/elasticsearch/discovery/ec2/AmazonEC2Fixture.java rename to plugins/discovery-ec2/qa/amazon-ec2/src/yamlRestTest/java/org/elasticsearch/discovery/ec2/AmazonEC2Fixture.java index ecaaceea5cc26..1345b806226d5 100644 --- a/plugins/discovery-ec2/qa/amazon-ec2/src/test/java/org/elasticsearch/discovery/ec2/AmazonEC2Fixture.java +++ b/plugins/discovery-ec2/qa/amazon-ec2/src/yamlRestTest/java/org/elasticsearch/discovery/ec2/AmazonEC2Fixture.java @@ -7,7 +7,7 @@ * not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an diff --git a/plugins/discovery-ec2/qa/amazon-ec2/src/test/resources/rest-api-spec/test/discovery_ec2/10_basic.yml b/plugins/discovery-ec2/qa/amazon-ec2/src/yamlRestTest/resources/rest-api-spec/test/discovery_ec2/10_basic.yml similarity index 100% rename from plugins/discovery-ec2/qa/amazon-ec2/src/test/resources/rest-api-spec/test/discovery_ec2/10_basic.yml rename to plugins/discovery-ec2/qa/amazon-ec2/src/yamlRestTest/resources/rest-api-spec/test/discovery_ec2/10_basic.yml diff --git a/plugins/discovery-ec2/src/test/java/org/elasticsearch/discovery/ec2/AbstractAwsTestCase.java b/plugins/discovery-ec2/src/internalClusterTest/java/org/elasticsearch/discovery/ec2/AbstractAwsTestCase.java similarity index 100% rename from plugins/discovery-ec2/src/test/java/org/elasticsearch/discovery/ec2/AbstractAwsTestCase.java rename to plugins/discovery-ec2/src/internalClusterTest/java/org/elasticsearch/discovery/ec2/AbstractAwsTestCase.java diff --git a/plugins/discovery-ec2/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryUpdateSettingsTests.java b/plugins/discovery-ec2/src/internalClusterTest/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryUpdateSettingsTests.java similarity index 100% rename from plugins/discovery-ec2/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryUpdateSettingsTests.java rename to plugins/discovery-ec2/src/internalClusterTest/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryUpdateSettingsTests.java diff --git a/plugins/discovery-ec2/src/test/java/org/elasticsearch/discovery/ec2/CloudAwsClientYamlTestSuiteIT.java b/plugins/discovery-ec2/src/yamlRestTest/java/org/elasticsearch/discovery/ec2/CloudAwsClientYamlTestSuiteIT.java similarity index 100% rename from plugins/discovery-ec2/src/test/java/org/elasticsearch/discovery/ec2/CloudAwsClientYamlTestSuiteIT.java rename to plugins/discovery-ec2/src/yamlRestTest/java/org/elasticsearch/discovery/ec2/CloudAwsClientYamlTestSuiteIT.java diff --git a/plugins/discovery-ec2/src/test/resources/rest-api-spec/test/discovery_ec2/10_basic.yml b/plugins/discovery-ec2/src/yamlRestTest/resources/rest-api-spec/test/discovery_ec2/10_basic.yml similarity index 100% rename from plugins/discovery-ec2/src/test/resources/rest-api-spec/test/discovery_ec2/10_basic.yml rename to plugins/discovery-ec2/src/yamlRestTest/resources/rest-api-spec/test/discovery_ec2/10_basic.yml diff --git a/plugins/discovery-gce/build.gradle b/plugins/discovery-gce/build.gradle index 70d50d80c5bce..8f44cccbf6593 100644 --- a/plugins/discovery-gce/build.gradle +++ b/plugins/discovery-gce/build.gradle @@ -1,4 +1,5 @@ -apply plugin: 'elasticsearch.rest-resources' +apply plugin: 'elasticsearch.yaml-rest-test' +apply plugin: 'elasticsearch.internal-cluster-test' esplugin { description 'The Google Compute Engine (GCE) Discovery plugin allows to use GCE API for the unicast discovery mechanism.' diff --git a/plugins/discovery-gce/qa/gce/build.gradle b/plugins/discovery-gce/qa/gce/build.gradle index 9ae4dc475fb89..d2ee721e0bd1e 100644 --- a/plugins/discovery-gce/qa/gce/build.gradle +++ b/plugins/discovery-gce/qa/gce/build.gradle @@ -24,14 +24,12 @@ import org.elasticsearch.gradle.test.AntFixture import static org.elasticsearch.gradle.PropertyNormalization.IGNORE_VALUE -apply plugin: 'elasticsearch.standalone-rest-test' -apply plugin: 'elasticsearch.rest-test' -apply plugin: 'elasticsearch.rest-resources' +apply plugin: 'elasticsearch.yaml-rest-test' final int gceNumberOfNodes = 3 dependencies { - testImplementation project(':plugins:discovery-gce') + yamlRestTestImplementation project(':plugins:discovery-gce') } restResources { @@ -42,26 +40,26 @@ restResources { /** A task to start the GCEFixture which emulates a GCE service **/ task gceFixture(type: AntFixture) { - dependsOn compileTestJava - env 'CLASSPATH', "${-> project.sourceSets.test.runtimeClasspath.asPath}" + dependsOn project.sourceSets.yamlRestTest.runtimeClasspath + env 'CLASSPATH', "${-> project.sourceSets.yamlRestTest.runtimeClasspath.asPath}" executable = "${BuildParams.runtimeJavaHome}/bin/java" - args 'org.elasticsearch.cloud.gce.GCEFixture', baseDir, "${buildDir}/testclusters/integTest-1/config/unicast_hosts.txt" + args 'org.elasticsearch.cloud.gce.GCEFixture', baseDir, "${buildDir}/testclusters/yamlRestTest-1/config/unicast_hosts.txt" } Map expansions = [ 'expected_nodes': gceNumberOfNodes ] -processTestResources { +processYamlRestTestResources { inputs.properties(expansions) MavenFilteringHack.filter(it, expansions) } -integTest { +yamlRestTest { dependsOn gceFixture, project(':plugins:discovery-gce').bundlePlugin } -testClusters.integTest { +testClusters.yamlRestTest { numberOfNodes = gceNumberOfNodes plugin project(':plugins:discovery-gce').bundlePlugin.archiveFile // use gce fixture for Auth calls instead of http://metadata.google.internal diff --git a/plugins/discovery-gce/qa/gce/src/test/java/org/elasticsearch/cloud/gce/GCEDiscoveryClientYamlTestSuiteIT.java b/plugins/discovery-gce/qa/gce/src/yamlRestTest/java/org/elasticsearch/cloud/gce/GCEDiscoveryClientYamlTestSuiteIT.java similarity index 100% rename from plugins/discovery-gce/qa/gce/src/test/java/org/elasticsearch/cloud/gce/GCEDiscoveryClientYamlTestSuiteIT.java rename to plugins/discovery-gce/qa/gce/src/yamlRestTest/java/org/elasticsearch/cloud/gce/GCEDiscoveryClientYamlTestSuiteIT.java diff --git a/plugins/discovery-gce/qa/gce/src/test/java/org/elasticsearch/cloud/gce/GCEFixture.java b/plugins/discovery-gce/qa/gce/src/yamlRestTest/java/org/elasticsearch/cloud/gce/GCEFixture.java similarity index 100% rename from plugins/discovery-gce/qa/gce/src/test/java/org/elasticsearch/cloud/gce/GCEFixture.java rename to plugins/discovery-gce/qa/gce/src/yamlRestTest/java/org/elasticsearch/cloud/gce/GCEFixture.java diff --git a/plugins/discovery-gce/qa/gce/src/test/resources/rest-api-spec/test/discovery_gce/10_basic.yml b/plugins/discovery-gce/qa/gce/src/yamlRestTest/resources/rest-api-spec/test/discovery_gce/10_basic.yml similarity index 100% rename from plugins/discovery-gce/qa/gce/src/test/resources/rest-api-spec/test/discovery_gce/10_basic.yml rename to plugins/discovery-gce/qa/gce/src/yamlRestTest/resources/rest-api-spec/test/discovery_gce/10_basic.yml diff --git a/plugins/discovery-gce/src/test/java/org/elasticsearch/discovery/gce/GceDiscoverTests.java b/plugins/discovery-gce/src/internalClusterTest/java/org/elasticsearch/discovery/gce/GceDiscoverTests.java similarity index 100% rename from plugins/discovery-gce/src/test/java/org/elasticsearch/discovery/gce/GceDiscoverTests.java rename to plugins/discovery-gce/src/internalClusterTest/java/org/elasticsearch/discovery/gce/GceDiscoverTests.java diff --git a/plugins/discovery-gce/src/test/java/org/elasticsearch/discovery/gce/DiscoveryGceClientYamlTestSuiteIT.java b/plugins/discovery-gce/src/yamlRestTest/java/org/elasticsearch/discovery/gce/DiscoveryGceClientYamlTestSuiteIT.java similarity index 100% rename from plugins/discovery-gce/src/test/java/org/elasticsearch/discovery/gce/DiscoveryGceClientYamlTestSuiteIT.java rename to plugins/discovery-gce/src/yamlRestTest/java/org/elasticsearch/discovery/gce/DiscoveryGceClientYamlTestSuiteIT.java diff --git a/plugins/discovery-gce/src/test/resources/rest-api-spec/test/discovery_gce/10_basic.yml b/plugins/discovery-gce/src/yamlRestTest/resources/rest-api-spec/test/discovery_gce/10_basic.yml similarity index 100% rename from plugins/discovery-gce/src/test/resources/rest-api-spec/test/discovery_gce/10_basic.yml rename to plugins/discovery-gce/src/yamlRestTest/resources/rest-api-spec/test/discovery_gce/10_basic.yml