From 376db4221908bfb29d5d87d2a6e15a7a0f889ca5 Mon Sep 17 00:00:00 2001 From: Jake Landis Date: Sat, 11 Jul 2020 16:15:27 -0500 Subject: [PATCH 01/26] start of migration --- .../elasticsearch/gradle/test/RestTestPlugin.groovy | 8 +++++--- plugins/analysis-icu/build.gradle | 12 +++++++----- .../index/analysis/IcuClientYamlTestSuiteIT.java | 0 .../rest-api-spec/test/analysis_icu/10_basic.yml | 0 .../rest-api-spec/test/analysis_icu/20_search.yml | 0 plugins/analysis-kuromoji/build.gradle | 4 +++- .../analysis/KuromojiClientYamlTestSuiteIT.java | 0 .../test/analysis_kuromoji/10_basic.yml | 0 .../test/analysis_kuromoji/20_search.yml | 0 plugins/analysis-nori/build.gradle | 5 ++++- .../index/analysis/NoriClientYamlTestSuiteIT.java | 0 .../rest-api-spec/test/analysis_nori/10_basic.yml | 0 .../rest-api-spec/test/analysis_nori/20_search.yml | 0 plugins/analysis-phonetic/build.gradle | 4 +++- .../analysis/PhoneticClientYamlTestSuiteIT.java | 0 .../test/analysis_phonetic/10_metaphone.yml | 0 .../test/analysis_phonetic/20_double_metaphone.yml | 0 .../test/analysis_phonetic/30_beider_morse.yml | 0 .../test/analysis_phonetic/40_search.yml | 0 .../test/analysis_phonetic/50_daitch_mokotoff.yml | 0 plugins/analysis-smartcn/build.gradle | 4 +++- .../index/analysis/SmartCNClientYamlTestSuiteIT.java | 0 .../rest-api-spec/test/analysis_smartcn/10_basic.yml | 0 .../test/analysis_smartcn/20_search.yml | 0 plugins/analysis-stempel/build.gradle | 4 +++- .../index/analysis/StempelClientYamlTestSuiteIT.java | 0 .../rest-api-spec/test/analysis_stempel/10_basic.yml | 0 .../test/analysis_stempel/20_search.yml | 0 plugins/analysis-ukrainian/build.gradle | 4 +++- .../analysis/UkrainianClientYamlTestSuiteIT.java | 0 .../test/analysis_ukrainian/10_basic.yml | 0 .../test/analysis_ukrainian/20_search.yml | 0 plugins/discovery-azure-classic/build.gradle | 5 ++++- .../DiscoveryAzureClassicClientYamlTestSuiteIT.java | 0 .../test/discovery_azure_classic/10_basic.yml | 0 plugins/discovery-ec2/build.gradle | 4 +++- plugins/discovery-ec2/qa/amazon-ec2/build.gradle | 3 +++ .../discovery/ec2/CloudAwsClientYamlTestSuiteIT.java | 0 .../rest-api-spec/test/discovery_ec2/10_basic.yml | 0 plugins/discovery-gce/build.gradle | 4 +++- plugins/discovery-gce/qa/gce/build.gradle | 3 +++ .../gce/DiscoveryGceClientYamlTestSuiteIT.java | 0 .../rest-api-spec/test/discovery_gce/10_basic.yml | 0 plugins/examples/custom-settings/build.gradle | 7 ++++--- .../ExampleCustomSettingsClientYamlTestSuiteIT.java | 8 ++++---- .../rest-api-spec/test/customsettings/10_plugin.yml | 0 .../test/customsettings/10_settings.yml | 0 .../custom-significance-heuristic/build.gradle | 5 +++-- ...omSignificanceHeuristicClientYamlTestSuiteIT.java | 0 .../test/custom-significance-heuristic/10_basic.yml | 0 .../20_custom_heuristic.yml | 0 plugins/examples/custom-suggester/build.gradle | 6 +++--- .../CustomSuggesterClientYamlTestSuiteIT.java | 0 .../rest-api-spec/test/custom-suggester/10_basic.yml | 0 .../test/custom-suggester/20_suggest.yml | 0 plugins/examples/painless-whitelist/build.gradle | 2 +- plugins/examples/rescore/build.gradle | 2 +- plugins/examples/rest-handler/build.gradle | 2 +- plugins/examples/script-expert-scoring/build.gradle | 2 +- .../security-authorization-engine/build.gradle | 2 +- plugins/ingest-attachment/build.gradle | 2 +- plugins/mapper-annotated-text/build.gradle | 2 +- plugins/mapper-murmur3/build.gradle | 2 +- plugins/mapper-size/build.gradle | 2 +- plugins/repository-azure/build.gradle | 2 +- plugins/repository-gcs/build.gradle | 2 +- plugins/repository-hdfs/build.gradle | 2 +- plugins/repository-s3/build.gradle | 2 +- plugins/store-smb/build.gradle | 2 +- 69 files changed, 75 insertions(+), 43 deletions(-) rename plugins/analysis-icu/src/{test => yamlRestTest}/java/org/elasticsearch/index/analysis/IcuClientYamlTestSuiteIT.java (100%) rename plugins/analysis-icu/src/{test => yamlRestTest}/resources/rest-api-spec/test/analysis_icu/10_basic.yml (100%) rename plugins/analysis-icu/src/{test => yamlRestTest}/resources/rest-api-spec/test/analysis_icu/20_search.yml (100%) rename plugins/analysis-kuromoji/src/{test => yamlRestTest}/java/org/elasticsearch/index/analysis/KuromojiClientYamlTestSuiteIT.java (100%) rename plugins/analysis-kuromoji/src/{test => yamlRestTest}/resources/rest-api-spec/test/analysis_kuromoji/10_basic.yml (100%) rename plugins/analysis-kuromoji/src/{test => yamlRestTest}/resources/rest-api-spec/test/analysis_kuromoji/20_search.yml (100%) rename plugins/analysis-nori/src/{test => yamlRestTest}/java/org/elasticsearch/index/analysis/NoriClientYamlTestSuiteIT.java (100%) rename plugins/analysis-nori/src/{test => yamlRestTest}/resources/rest-api-spec/test/analysis_nori/10_basic.yml (100%) rename plugins/analysis-nori/src/{test => yamlRestTest}/resources/rest-api-spec/test/analysis_nori/20_search.yml (100%) rename plugins/analysis-phonetic/src/{test => yamlRestTest}/java/org/elasticsearch/index/analysis/PhoneticClientYamlTestSuiteIT.java (100%) rename plugins/analysis-phonetic/src/{test => yamlRestTest}/resources/rest-api-spec/test/analysis_phonetic/10_metaphone.yml (100%) rename plugins/analysis-phonetic/src/{test => yamlRestTest}/resources/rest-api-spec/test/analysis_phonetic/20_double_metaphone.yml (100%) rename plugins/analysis-phonetic/src/{test => yamlRestTest}/resources/rest-api-spec/test/analysis_phonetic/30_beider_morse.yml (100%) rename plugins/analysis-phonetic/src/{test => yamlRestTest}/resources/rest-api-spec/test/analysis_phonetic/40_search.yml (100%) rename plugins/analysis-phonetic/src/{test => yamlRestTest}/resources/rest-api-spec/test/analysis_phonetic/50_daitch_mokotoff.yml (100%) rename plugins/analysis-smartcn/src/{test => yamlRestTest}/java/org/elasticsearch/index/analysis/SmartCNClientYamlTestSuiteIT.java (100%) rename plugins/analysis-smartcn/src/{test => yamlRestTest}/resources/rest-api-spec/test/analysis_smartcn/10_basic.yml (100%) rename plugins/analysis-smartcn/src/{test => yamlRestTest}/resources/rest-api-spec/test/analysis_smartcn/20_search.yml (100%) rename plugins/analysis-stempel/src/{test => yamlRestTest}/java/org/elasticsearch/index/analysis/StempelClientYamlTestSuiteIT.java (100%) rename plugins/analysis-stempel/src/{test => yamlRestTest}/resources/rest-api-spec/test/analysis_stempel/10_basic.yml (100%) rename plugins/analysis-stempel/src/{test => yamlRestTest}/resources/rest-api-spec/test/analysis_stempel/20_search.yml (100%) rename plugins/analysis-ukrainian/src/{test => yamlRestTest}/java/org/elasticsearch/index/analysis/UkrainianClientYamlTestSuiteIT.java (100%) rename plugins/analysis-ukrainian/src/{test => yamlRestTest}/resources/rest-api-spec/test/analysis_ukrainian/10_basic.yml (100%) rename plugins/analysis-ukrainian/src/{test => yamlRestTest}/resources/rest-api-spec/test/analysis_ukrainian/20_search.yml (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/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/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%) rename plugins/examples/custom-settings/src/{test => yamlRestTest}/java/org/elasticsearch/example/customsettings/ExampleCustomSettingsClientYamlTestSuiteIT.java (87%) rename plugins/examples/custom-settings/src/{test => yamlRestTest}/resources/rest-api-spec/test/customsettings/10_plugin.yml (100%) rename plugins/examples/custom-settings/src/{test => yamlRestTest}/resources/rest-api-spec/test/customsettings/10_settings.yml (100%) rename plugins/examples/custom-significance-heuristic/src/{test => yamlRestTest}/java/org/elasticsearch/example/customsigheuristic/CustomSignificanceHeuristicClientYamlTestSuiteIT.java (100%) rename plugins/examples/custom-significance-heuristic/src/{test => yamlRestTest}/resources/rest-api-spec/test/custom-significance-heuristic/10_basic.yml (100%) rename plugins/examples/custom-significance-heuristic/src/{test => yamlRestTest}/resources/rest-api-spec/test/custom-significance-heuristic/20_custom_heuristic.yml (100%) rename plugins/examples/custom-suggester/src/{test => yamlRestTest}/java/org/elasticsearch/example/customsuggester/CustomSuggesterClientYamlTestSuiteIT.java (100%) rename plugins/examples/custom-suggester/src/{test => yamlRestTest}/resources/rest-api-spec/test/custom-suggester/10_basic.yml (100%) rename plugins/examples/custom-suggester/src/{test => yamlRestTest}/resources/rest-api-spec/test/custom-suggester/20_suggest.yml (100%) diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/RestTestPlugin.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/RestTestPlugin.groovy index 669ff191e76a1..b94d77ce3e0c7 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/RestTestPlugin.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/RestTestPlugin.groovy @@ -36,21 +36,23 @@ import org.gradle.api.plugins.JavaBasePlugin class RestTestPlugin implements Plugin { List REQUIRED_PLUGINS = [ 'elasticsearch.build', - 'elasticsearch.standalone-rest-test'] + 'elasticsearch.standalone-rest-test', + 'elasticsearch.yaml-rest-test'] @Override void apply(Project project) { if (false == REQUIRED_PLUGINS.any { project.pluginManager.hasPlugin(it) }) { throw new InvalidUserDataException('elasticsearch.rest-test ' + 'requires either elasticsearch.build or ' - + 'elasticsearch.standalone-rest-test') + + 'elasticsearch.standalone-rest-test' + + 'elasticsearch.yaml-rest-test') } project.pluginManager.apply(TestClustersPlugin) RestIntegTestTask integTest = project.tasks.create('integTest', RestIntegTestTask.class) integTest.description = 'Runs rest tests against an elasticsearch cluster.' integTest.group = JavaBasePlugin.VERIFICATION_GROUP - integTest.mustRunAfter(project.tasks.named('precommit')) + // integTest.mustRunAfter(project.tasks.named('precommit')) project.tasks.named('check').configure { it.dependsOn(integTest) } } } diff --git a/plugins/analysis-icu/build.gradle b/plugins/analysis-icu/build.gradle index 7f174f670a250..8b35696ebb528 100644 --- a/plugins/analysis-icu/build.gradle +++ b/plugins/analysis-icu/build.gradle @@ -18,17 +18,19 @@ import de.thetaphi.forbiddenapis.gradle.CheckForbiddenApis * specific language governing permissions and limitations * under the License. */ -apply plugin: 'elasticsearch.rest-resources' +apply plugin: 'elasticsearch.yaml-rest-test' esplugin { description 'The ICU Analysis plugin integrates the Lucene ICU module into Elasticsearch, adding ICU-related analysis components.' classname 'org.elasticsearch.plugin.analysis.icu.AnalysisICUPlugin' } -tasks.withType(CheckForbiddenApis).configureEach { - signatures += [ - "com.ibm.icu.text.Collator#getInstance() @ Don't use default locale, use getInstance(ULocale) instead" - ] +tasks.withType(CheckForbiddenApis).configureEach { task -> + if(task.name.contains("YamlRestTest") == false) { + signatures += [ + "com.ibm.icu.text.Collator#getInstance() @ Don't use default locale, use getInstance(ULocale) instead" + ] + } } dependencies { diff --git a/plugins/analysis-icu/src/test/java/org/elasticsearch/index/analysis/IcuClientYamlTestSuiteIT.java b/plugins/analysis-icu/src/yamlRestTest/java/org/elasticsearch/index/analysis/IcuClientYamlTestSuiteIT.java similarity index 100% rename from plugins/analysis-icu/src/test/java/org/elasticsearch/index/analysis/IcuClientYamlTestSuiteIT.java rename to plugins/analysis-icu/src/yamlRestTest/java/org/elasticsearch/index/analysis/IcuClientYamlTestSuiteIT.java diff --git a/plugins/analysis-icu/src/test/resources/rest-api-spec/test/analysis_icu/10_basic.yml b/plugins/analysis-icu/src/yamlRestTest/resources/rest-api-spec/test/analysis_icu/10_basic.yml similarity index 100% rename from plugins/analysis-icu/src/test/resources/rest-api-spec/test/analysis_icu/10_basic.yml rename to plugins/analysis-icu/src/yamlRestTest/resources/rest-api-spec/test/analysis_icu/10_basic.yml diff --git a/plugins/analysis-icu/src/test/resources/rest-api-spec/test/analysis_icu/20_search.yml b/plugins/analysis-icu/src/yamlRestTest/resources/rest-api-spec/test/analysis_icu/20_search.yml similarity index 100% rename from plugins/analysis-icu/src/test/resources/rest-api-spec/test/analysis_icu/20_search.yml rename to plugins/analysis-icu/src/yamlRestTest/resources/rest-api-spec/test/analysis_icu/20_search.yml diff --git a/plugins/analysis-kuromoji/build.gradle b/plugins/analysis-kuromoji/build.gradle index c3d2576ccc821..3f89c0f5823e4 100644 --- a/plugins/analysis-kuromoji/build.gradle +++ b/plugins/analysis-kuromoji/build.gradle @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -apply plugin: 'elasticsearch.rest-resources' +apply plugin: 'elasticsearch.yaml-rest-test' esplugin { description 'The Japanese (kuromoji) Analysis plugin integrates Lucene kuromoji analysis module into elasticsearch.' @@ -33,6 +33,8 @@ restResources { } } +integTest.enabled = false + tasks.named("dependencyLicenses").configure { mapping from: /lucene-.*/, to: 'lucene' } diff --git a/plugins/analysis-kuromoji/src/test/java/org/elasticsearch/index/analysis/KuromojiClientYamlTestSuiteIT.java b/plugins/analysis-kuromoji/src/yamlRestTest/java/org/elasticsearch/index/analysis/KuromojiClientYamlTestSuiteIT.java similarity index 100% rename from plugins/analysis-kuromoji/src/test/java/org/elasticsearch/index/analysis/KuromojiClientYamlTestSuiteIT.java rename to plugins/analysis-kuromoji/src/yamlRestTest/java/org/elasticsearch/index/analysis/KuromojiClientYamlTestSuiteIT.java diff --git a/plugins/analysis-kuromoji/src/test/resources/rest-api-spec/test/analysis_kuromoji/10_basic.yml b/plugins/analysis-kuromoji/src/yamlRestTest/resources/rest-api-spec/test/analysis_kuromoji/10_basic.yml similarity index 100% rename from plugins/analysis-kuromoji/src/test/resources/rest-api-spec/test/analysis_kuromoji/10_basic.yml rename to plugins/analysis-kuromoji/src/yamlRestTest/resources/rest-api-spec/test/analysis_kuromoji/10_basic.yml diff --git a/plugins/analysis-kuromoji/src/test/resources/rest-api-spec/test/analysis_kuromoji/20_search.yml b/plugins/analysis-kuromoji/src/yamlRestTest/resources/rest-api-spec/test/analysis_kuromoji/20_search.yml similarity index 100% rename from plugins/analysis-kuromoji/src/test/resources/rest-api-spec/test/analysis_kuromoji/20_search.yml rename to plugins/analysis-kuromoji/src/yamlRestTest/resources/rest-api-spec/test/analysis_kuromoji/20_search.yml diff --git a/plugins/analysis-nori/build.gradle b/plugins/analysis-nori/build.gradle index 001e149804fab..5ab19e330ef1e 100644 --- a/plugins/analysis-nori/build.gradle +++ b/plugins/analysis-nori/build.gradle @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -apply plugin: 'elasticsearch.rest-resources' +apply plugin: 'elasticsearch.yaml-rest-test' esplugin { description 'The Korean (nori) Analysis plugin integrates Lucene nori analysis module into elasticsearch.' @@ -32,6 +32,9 @@ restResources { includeCore '_common', 'indices', 'index', 'search' } } + +integTest.enabled = false + tasks.named("dependencyLicenses").configure { mapping from: /lucene-.*/, to: 'lucene' } diff --git a/plugins/analysis-nori/src/test/java/org/elasticsearch/index/analysis/NoriClientYamlTestSuiteIT.java b/plugins/analysis-nori/src/yamlRestTest/java/org/elasticsearch/index/analysis/NoriClientYamlTestSuiteIT.java similarity index 100% rename from plugins/analysis-nori/src/test/java/org/elasticsearch/index/analysis/NoriClientYamlTestSuiteIT.java rename to plugins/analysis-nori/src/yamlRestTest/java/org/elasticsearch/index/analysis/NoriClientYamlTestSuiteIT.java diff --git a/plugins/analysis-nori/src/test/resources/rest-api-spec/test/analysis_nori/10_basic.yml b/plugins/analysis-nori/src/yamlRestTest/resources/rest-api-spec/test/analysis_nori/10_basic.yml similarity index 100% rename from plugins/analysis-nori/src/test/resources/rest-api-spec/test/analysis_nori/10_basic.yml rename to plugins/analysis-nori/src/yamlRestTest/resources/rest-api-spec/test/analysis_nori/10_basic.yml diff --git a/plugins/analysis-nori/src/test/resources/rest-api-spec/test/analysis_nori/20_search.yml b/plugins/analysis-nori/src/yamlRestTest/resources/rest-api-spec/test/analysis_nori/20_search.yml similarity index 100% rename from plugins/analysis-nori/src/test/resources/rest-api-spec/test/analysis_nori/20_search.yml rename to plugins/analysis-nori/src/yamlRestTest/resources/rest-api-spec/test/analysis_nori/20_search.yml diff --git a/plugins/analysis-phonetic/build.gradle b/plugins/analysis-phonetic/build.gradle index db035eeb98a88..c2234d680183b 100644 --- a/plugins/analysis-phonetic/build.gradle +++ b/plugins/analysis-phonetic/build.gradle @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -apply plugin: 'elasticsearch.rest-resources' +apply plugin: 'elasticsearch.yaml-rest-test' esplugin { description 'The Phonetic Analysis plugin integrates phonetic token filter analysis with elasticsearch.' @@ -34,6 +34,8 @@ restResources { } } +integTest.enabled = false + tasks.named("dependencyLicenses").configure { mapping from: /lucene-.*/, to: 'lucene' } diff --git a/plugins/analysis-phonetic/src/test/java/org/elasticsearch/index/analysis/PhoneticClientYamlTestSuiteIT.java b/plugins/analysis-phonetic/src/yamlRestTest/java/org/elasticsearch/index/analysis/PhoneticClientYamlTestSuiteIT.java similarity index 100% rename from plugins/analysis-phonetic/src/test/java/org/elasticsearch/index/analysis/PhoneticClientYamlTestSuiteIT.java rename to plugins/analysis-phonetic/src/yamlRestTest/java/org/elasticsearch/index/analysis/PhoneticClientYamlTestSuiteIT.java diff --git a/plugins/analysis-phonetic/src/test/resources/rest-api-spec/test/analysis_phonetic/10_metaphone.yml b/plugins/analysis-phonetic/src/yamlRestTest/resources/rest-api-spec/test/analysis_phonetic/10_metaphone.yml similarity index 100% rename from plugins/analysis-phonetic/src/test/resources/rest-api-spec/test/analysis_phonetic/10_metaphone.yml rename to plugins/analysis-phonetic/src/yamlRestTest/resources/rest-api-spec/test/analysis_phonetic/10_metaphone.yml diff --git a/plugins/analysis-phonetic/src/test/resources/rest-api-spec/test/analysis_phonetic/20_double_metaphone.yml b/plugins/analysis-phonetic/src/yamlRestTest/resources/rest-api-spec/test/analysis_phonetic/20_double_metaphone.yml similarity index 100% rename from plugins/analysis-phonetic/src/test/resources/rest-api-spec/test/analysis_phonetic/20_double_metaphone.yml rename to plugins/analysis-phonetic/src/yamlRestTest/resources/rest-api-spec/test/analysis_phonetic/20_double_metaphone.yml diff --git a/plugins/analysis-phonetic/src/test/resources/rest-api-spec/test/analysis_phonetic/30_beider_morse.yml b/plugins/analysis-phonetic/src/yamlRestTest/resources/rest-api-spec/test/analysis_phonetic/30_beider_morse.yml similarity index 100% rename from plugins/analysis-phonetic/src/test/resources/rest-api-spec/test/analysis_phonetic/30_beider_morse.yml rename to plugins/analysis-phonetic/src/yamlRestTest/resources/rest-api-spec/test/analysis_phonetic/30_beider_morse.yml diff --git a/plugins/analysis-phonetic/src/test/resources/rest-api-spec/test/analysis_phonetic/40_search.yml b/plugins/analysis-phonetic/src/yamlRestTest/resources/rest-api-spec/test/analysis_phonetic/40_search.yml similarity index 100% rename from plugins/analysis-phonetic/src/test/resources/rest-api-spec/test/analysis_phonetic/40_search.yml rename to plugins/analysis-phonetic/src/yamlRestTest/resources/rest-api-spec/test/analysis_phonetic/40_search.yml diff --git a/plugins/analysis-phonetic/src/test/resources/rest-api-spec/test/analysis_phonetic/50_daitch_mokotoff.yml b/plugins/analysis-phonetic/src/yamlRestTest/resources/rest-api-spec/test/analysis_phonetic/50_daitch_mokotoff.yml similarity index 100% rename from plugins/analysis-phonetic/src/test/resources/rest-api-spec/test/analysis_phonetic/50_daitch_mokotoff.yml rename to plugins/analysis-phonetic/src/yamlRestTest/resources/rest-api-spec/test/analysis_phonetic/50_daitch_mokotoff.yml diff --git a/plugins/analysis-smartcn/build.gradle b/plugins/analysis-smartcn/build.gradle index 1dd36e9305031..d4ad0adcdc70e 100644 --- a/plugins/analysis-smartcn/build.gradle +++ b/plugins/analysis-smartcn/build.gradle @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -apply plugin: 'elasticsearch.rest-resources' +apply plugin: 'elasticsearch.yaml-rest-test' esplugin { description 'Smart Chinese Analysis plugin integrates Lucene Smart Chinese analysis module into elasticsearch.' @@ -33,6 +33,8 @@ restResources { } } +integTest.enabled = false + tasks.named("dependencyLicenses").configure { mapping from: /lucene-.*/, to: 'lucene' } diff --git a/plugins/analysis-smartcn/src/test/java/org/elasticsearch/index/analysis/SmartCNClientYamlTestSuiteIT.java b/plugins/analysis-smartcn/src/yamlRestTest/java/org/elasticsearch/index/analysis/SmartCNClientYamlTestSuiteIT.java similarity index 100% rename from plugins/analysis-smartcn/src/test/java/org/elasticsearch/index/analysis/SmartCNClientYamlTestSuiteIT.java rename to plugins/analysis-smartcn/src/yamlRestTest/java/org/elasticsearch/index/analysis/SmartCNClientYamlTestSuiteIT.java diff --git a/plugins/analysis-smartcn/src/test/resources/rest-api-spec/test/analysis_smartcn/10_basic.yml b/plugins/analysis-smartcn/src/yamlRestTest/resources/rest-api-spec/test/analysis_smartcn/10_basic.yml similarity index 100% rename from plugins/analysis-smartcn/src/test/resources/rest-api-spec/test/analysis_smartcn/10_basic.yml rename to plugins/analysis-smartcn/src/yamlRestTest/resources/rest-api-spec/test/analysis_smartcn/10_basic.yml diff --git a/plugins/analysis-smartcn/src/test/resources/rest-api-spec/test/analysis_smartcn/20_search.yml b/plugins/analysis-smartcn/src/yamlRestTest/resources/rest-api-spec/test/analysis_smartcn/20_search.yml similarity index 100% rename from plugins/analysis-smartcn/src/test/resources/rest-api-spec/test/analysis_smartcn/20_search.yml rename to plugins/analysis-smartcn/src/yamlRestTest/resources/rest-api-spec/test/analysis_smartcn/20_search.yml diff --git a/plugins/analysis-stempel/build.gradle b/plugins/analysis-stempel/build.gradle index 4cfc7c01742fa..c3af13897f578 100644 --- a/plugins/analysis-stempel/build.gradle +++ b/plugins/analysis-stempel/build.gradle @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -apply plugin: 'elasticsearch.rest-resources' +apply plugin: 'elasticsearch.yaml-rest-test' esplugin { description 'The Stempel (Polish) Analysis plugin integrates Lucene stempel (polish) analysis module into elasticsearch.' @@ -33,6 +33,8 @@ restResources { } } +integTest.enabled = false + tasks.named("dependencyLicenses").configure { mapping from: /lucene-.*/, to: 'lucene' } diff --git a/plugins/analysis-stempel/src/test/java/org/elasticsearch/index/analysis/StempelClientYamlTestSuiteIT.java b/plugins/analysis-stempel/src/yamlRestTest/java/org/elasticsearch/index/analysis/StempelClientYamlTestSuiteIT.java similarity index 100% rename from plugins/analysis-stempel/src/test/java/org/elasticsearch/index/analysis/StempelClientYamlTestSuiteIT.java rename to plugins/analysis-stempel/src/yamlRestTest/java/org/elasticsearch/index/analysis/StempelClientYamlTestSuiteIT.java diff --git a/plugins/analysis-stempel/src/test/resources/rest-api-spec/test/analysis_stempel/10_basic.yml b/plugins/analysis-stempel/src/yamlRestTest/resources/rest-api-spec/test/analysis_stempel/10_basic.yml similarity index 100% rename from plugins/analysis-stempel/src/test/resources/rest-api-spec/test/analysis_stempel/10_basic.yml rename to plugins/analysis-stempel/src/yamlRestTest/resources/rest-api-spec/test/analysis_stempel/10_basic.yml diff --git a/plugins/analysis-stempel/src/test/resources/rest-api-spec/test/analysis_stempel/20_search.yml b/plugins/analysis-stempel/src/yamlRestTest/resources/rest-api-spec/test/analysis_stempel/20_search.yml similarity index 100% rename from plugins/analysis-stempel/src/test/resources/rest-api-spec/test/analysis_stempel/20_search.yml rename to plugins/analysis-stempel/src/yamlRestTest/resources/rest-api-spec/test/analysis_stempel/20_search.yml diff --git a/plugins/analysis-ukrainian/build.gradle b/plugins/analysis-ukrainian/build.gradle index 9ee5b17bff4ac..4ae69bce771c0 100644 --- a/plugins/analysis-ukrainian/build.gradle +++ b/plugins/analysis-ukrainian/build.gradle @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -apply plugin: 'elasticsearch.rest-resources' +apply plugin: 'elasticsearch.yaml-rest-test' esplugin { description 'The Ukrainian Analysis plugin integrates the Lucene UkrainianMorfologikAnalyzer into elasticsearch.' @@ -36,6 +36,8 @@ restResources { } } +integTest.enabled = false + tasks.named("dependencyLicenses").configure { mapping from: /lucene-.*/, to: 'lucene' mapping from: /morfologik-.*/, to: 'lucene' diff --git a/plugins/analysis-ukrainian/src/test/java/org/elasticsearch/index/analysis/UkrainianClientYamlTestSuiteIT.java b/plugins/analysis-ukrainian/src/yamlRestTest/java/org/elasticsearch/index/analysis/UkrainianClientYamlTestSuiteIT.java similarity index 100% rename from plugins/analysis-ukrainian/src/test/java/org/elasticsearch/index/analysis/UkrainianClientYamlTestSuiteIT.java rename to plugins/analysis-ukrainian/src/yamlRestTest/java/org/elasticsearch/index/analysis/UkrainianClientYamlTestSuiteIT.java diff --git a/plugins/analysis-ukrainian/src/test/resources/rest-api-spec/test/analysis_ukrainian/10_basic.yml b/plugins/analysis-ukrainian/src/yamlRestTest/resources/rest-api-spec/test/analysis_ukrainian/10_basic.yml similarity index 100% rename from plugins/analysis-ukrainian/src/test/resources/rest-api-spec/test/analysis_ukrainian/10_basic.yml rename to plugins/analysis-ukrainian/src/yamlRestTest/resources/rest-api-spec/test/analysis_ukrainian/10_basic.yml diff --git a/plugins/analysis-ukrainian/src/test/resources/rest-api-spec/test/analysis_ukrainian/20_search.yml b/plugins/analysis-ukrainian/src/yamlRestTest/resources/rest-api-spec/test/analysis_ukrainian/20_search.yml similarity index 100% rename from plugins/analysis-ukrainian/src/test/resources/rest-api-spec/test/analysis_ukrainian/20_search.yml rename to plugins/analysis-ukrainian/src/yamlRestTest/resources/rest-api-spec/test/analysis_ukrainian/20_search.yml diff --git a/plugins/discovery-azure-classic/build.gradle b/plugins/discovery-azure-classic/build.gradle index bca5613bbfe56..7e9b104f73054 100644 --- a/plugins/discovery-azure-classic/build.gradle +++ b/plugins/discovery-azure-classic/build.gradle @@ -19,7 +19,7 @@ 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' esplugin { description 'The Azure Classic Discovery plugin allows to use Azure Classic API for the unicast discovery mechanism' @@ -63,6 +63,9 @@ restResources { includeCore '_common', 'cluster', 'nodes' } } + +integTest.enabled = false + // needed to be consistent with ssl host checking String host = InetAddress.getLoopbackAddress().getHostAddress() 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..e569dd05d5dbd 100644 --- a/plugins/discovery-ec2/build.gradle +++ b/plugins/discovery-ec2/build.gradle @@ -18,7 +18,7 @@ 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' esplugin { description 'The EC2 discovery plugin allows to use AWS API for the unicast discovery mechanism.' @@ -47,6 +47,8 @@ restResources { } } +integTest.enabled = false + tasks.named("dependencyLicenses").configure { mapping from: /aws-java-sdk-.*/, to: 'aws-java-sdk' mapping from: /jackson-.*/, to: 'jackson' diff --git a/plugins/discovery-ec2/qa/amazon-ec2/build.gradle b/plugins/discovery-ec2/qa/amazon-ec2/build.gradle index c7f94ef278b66..f7903e551c88e 100644 --- a/plugins/discovery-ec2/qa/amazon-ec2/build.gradle +++ b/plugins/discovery-ec2/qa/amazon-ec2/build.gradle @@ -29,6 +29,9 @@ apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.rest-resources' +//TODO: convert to yamlRestTest - fix incompatibilities with standalone-rest-test, will likely need a javaRestTest sourceSet to fix +//apply plugin: 'elasticsearch.yaml-rest-test' + dependencies { testImplementation project(':plugins:discovery-ec2') } 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..84610eaa874b6 100644 --- a/plugins/discovery-gce/build.gradle +++ b/plugins/discovery-gce/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.rest-resources' +apply plugin: 'elasticsearch.yaml-rest-test' esplugin { description 'The Google Compute Engine (GCE) Discovery plugin allows to use GCE API for the unicast discovery mechanism.' @@ -29,6 +29,8 @@ restResources { } } +integTest.enabled = false + tasks.named("dependencyLicenses").configure { mapping from: /google-.*/, to: 'google' } diff --git a/plugins/discovery-gce/qa/gce/build.gradle b/plugins/discovery-gce/qa/gce/build.gradle index 9ae4dc475fb89..3944f990a83ac 100644 --- a/plugins/discovery-gce/qa/gce/build.gradle +++ b/plugins/discovery-gce/qa/gce/build.gradle @@ -28,6 +28,9 @@ apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.rest-resources' +//TODO: convert to yamlRestTest - fix incompatibilities with standalone-rest-test, will likely need a javaRestTest sourceSet to fix +//apply plugin: 'elasticsearch.yaml-rest-test' + final int gceNumberOfNodes = 3 dependencies { 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 diff --git a/plugins/examples/custom-settings/build.gradle b/plugins/examples/custom-settings/build.gradle index 5c2b604494930..b4b4b2988a57b 100644 --- a/plugins/examples/custom-settings/build.gradle +++ b/plugins/examples/custom-settings/build.gradle @@ -16,9 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -apply plugin: 'elasticsearch.testclusters' apply plugin: 'elasticsearch.esplugin' -apply plugin: 'elasticsearch.rest-resources' +apply plugin: 'elasticsearch.yaml-rest-test' esplugin { name 'custom-settings' @@ -28,7 +27,9 @@ esplugin { noticeFile rootProject.file('NOTICE.txt') } -testClusters.integTest { +testClusters.all { // Adds a setting in the Elasticsearch keystore before running the integration tests keystore 'custom.secured', 'password' } + +integTest.enabled = false diff --git a/plugins/examples/custom-settings/src/test/java/org/elasticsearch/example/customsettings/ExampleCustomSettingsClientYamlTestSuiteIT.java b/plugins/examples/custom-settings/src/yamlRestTest/java/org/elasticsearch/example/customsettings/ExampleCustomSettingsClientYamlTestSuiteIT.java similarity index 87% rename from plugins/examples/custom-settings/src/test/java/org/elasticsearch/example/customsettings/ExampleCustomSettingsClientYamlTestSuiteIT.java rename to plugins/examples/custom-settings/src/yamlRestTest/java/org/elasticsearch/example/customsettings/ExampleCustomSettingsClientYamlTestSuiteIT.java index cd8f31f76905e..89cded2343b74 100644 --- a/plugins/examples/custom-settings/src/test/java/org/elasticsearch/example/customsettings/ExampleCustomSettingsClientYamlTestSuiteIT.java +++ b/plugins/examples/custom-settings/src/yamlRestTest/java/org/elasticsearch/example/customsettings/ExampleCustomSettingsClientYamlTestSuiteIT.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 @@ -26,11 +26,11 @@ /** * {@link ExampleCustomSettingsClientYamlTestSuiteIT} executes the plugin's REST API integration tests. *

- * The tests can be executed using the command: ./gradlew :example-plugins:custom-settings:check + * The tests can be executed using the command: ./gradlew :example-plugins:custom-settings:yamlRestTest *

* This class extends {@link ESClientYamlSuiteTestCase}, which takes care of parsing the YAML files - * located in the src/test/resources/rest-api-spec/test/ directory and validates them against the - * custom REST API definition files located in src/test/resources/rest-api-spec/api/. + * located in the src/yamlRestTest/resources/rest-api-spec/test/ directory and validates them against the + * custom REST API definition files located in src/yamlRestTest/resources/rest-api-spec/api/. *

* Once validated, {@link ESClientYamlSuiteTestCase} executes the REST tests against a single node * integration cluster which has the plugin already installed by the Gradle build script. diff --git a/plugins/examples/custom-settings/src/test/resources/rest-api-spec/test/customsettings/10_plugin.yml b/plugins/examples/custom-settings/src/yamlRestTest/resources/rest-api-spec/test/customsettings/10_plugin.yml similarity index 100% rename from plugins/examples/custom-settings/src/test/resources/rest-api-spec/test/customsettings/10_plugin.yml rename to plugins/examples/custom-settings/src/yamlRestTest/resources/rest-api-spec/test/customsettings/10_plugin.yml diff --git a/plugins/examples/custom-settings/src/test/resources/rest-api-spec/test/customsettings/10_settings.yml b/plugins/examples/custom-settings/src/yamlRestTest/resources/rest-api-spec/test/customsettings/10_settings.yml similarity index 100% rename from plugins/examples/custom-settings/src/test/resources/rest-api-spec/test/customsettings/10_settings.yml rename to plugins/examples/custom-settings/src/yamlRestTest/resources/rest-api-spec/test/customsettings/10_settings.yml diff --git a/plugins/examples/custom-significance-heuristic/build.gradle b/plugins/examples/custom-significance-heuristic/build.gradle index 5387097ef7e54..0ee3efc0ff47f 100644 --- a/plugins/examples/custom-significance-heuristic/build.gradle +++ b/plugins/examples/custom-significance-heuristic/build.gradle @@ -16,9 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -apply plugin: 'elasticsearch.testclusters' apply plugin: 'elasticsearch.esplugin' -apply plugin: 'elasticsearch.rest-resources' +apply plugin: 'elasticsearch.yaml-rest-test' esplugin { name 'custom-significance-heuristic' @@ -27,3 +26,5 @@ esplugin { licenseFile rootProject.file('licenses/APACHE-LICENSE-2.0.txt') noticeFile rootProject.file('NOTICE.txt') } + +integTest.enabled = false diff --git a/plugins/examples/custom-significance-heuristic/src/test/java/org/elasticsearch/example/customsigheuristic/CustomSignificanceHeuristicClientYamlTestSuiteIT.java b/plugins/examples/custom-significance-heuristic/src/yamlRestTest/java/org/elasticsearch/example/customsigheuristic/CustomSignificanceHeuristicClientYamlTestSuiteIT.java similarity index 100% rename from plugins/examples/custom-significance-heuristic/src/test/java/org/elasticsearch/example/customsigheuristic/CustomSignificanceHeuristicClientYamlTestSuiteIT.java rename to plugins/examples/custom-significance-heuristic/src/yamlRestTest/java/org/elasticsearch/example/customsigheuristic/CustomSignificanceHeuristicClientYamlTestSuiteIT.java diff --git a/plugins/examples/custom-significance-heuristic/src/test/resources/rest-api-spec/test/custom-significance-heuristic/10_basic.yml b/plugins/examples/custom-significance-heuristic/src/yamlRestTest/resources/rest-api-spec/test/custom-significance-heuristic/10_basic.yml similarity index 100% rename from plugins/examples/custom-significance-heuristic/src/test/resources/rest-api-spec/test/custom-significance-heuristic/10_basic.yml rename to plugins/examples/custom-significance-heuristic/src/yamlRestTest/resources/rest-api-spec/test/custom-significance-heuristic/10_basic.yml diff --git a/plugins/examples/custom-significance-heuristic/src/test/resources/rest-api-spec/test/custom-significance-heuristic/20_custom_heuristic.yml b/plugins/examples/custom-significance-heuristic/src/yamlRestTest/resources/rest-api-spec/test/custom-significance-heuristic/20_custom_heuristic.yml similarity index 100% rename from plugins/examples/custom-significance-heuristic/src/test/resources/rest-api-spec/test/custom-significance-heuristic/20_custom_heuristic.yml rename to plugins/examples/custom-significance-heuristic/src/yamlRestTest/resources/rest-api-spec/test/custom-significance-heuristic/20_custom_heuristic.yml diff --git a/plugins/examples/custom-suggester/build.gradle b/plugins/examples/custom-suggester/build.gradle index f31286f90282a..c61255cba0e70 100644 --- a/plugins/examples/custom-suggester/build.gradle +++ b/plugins/examples/custom-suggester/build.gradle @@ -16,9 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -apply plugin: 'elasticsearch.testclusters' apply plugin: 'elasticsearch.esplugin' -apply plugin: 'elasticsearch.rest-resources' +apply plugin: 'elasticsearch.yaml-rest-test' esplugin { name 'custom-suggester' @@ -28,9 +27,10 @@ esplugin { noticeFile rootProject.file('NOTICE.txt') } -testClusters.integTest { +testClusters.all { numberOfNodes = 2 } // this plugin has no unit tests, only rest tests tasks.test.enabled = false +integTest.enabled = false diff --git a/plugins/examples/custom-suggester/src/test/java/org/elasticsearch/example/customsuggester/CustomSuggesterClientYamlTestSuiteIT.java b/plugins/examples/custom-suggester/src/yamlRestTest/java/org/elasticsearch/example/customsuggester/CustomSuggesterClientYamlTestSuiteIT.java similarity index 100% rename from plugins/examples/custom-suggester/src/test/java/org/elasticsearch/example/customsuggester/CustomSuggesterClientYamlTestSuiteIT.java rename to plugins/examples/custom-suggester/src/yamlRestTest/java/org/elasticsearch/example/customsuggester/CustomSuggesterClientYamlTestSuiteIT.java diff --git a/plugins/examples/custom-suggester/src/test/resources/rest-api-spec/test/custom-suggester/10_basic.yml b/plugins/examples/custom-suggester/src/yamlRestTest/resources/rest-api-spec/test/custom-suggester/10_basic.yml similarity index 100% rename from plugins/examples/custom-suggester/src/test/resources/rest-api-spec/test/custom-suggester/10_basic.yml rename to plugins/examples/custom-suggester/src/yamlRestTest/resources/rest-api-spec/test/custom-suggester/10_basic.yml diff --git a/plugins/examples/custom-suggester/src/test/resources/rest-api-spec/test/custom-suggester/20_suggest.yml b/plugins/examples/custom-suggester/src/yamlRestTest/resources/rest-api-spec/test/custom-suggester/20_suggest.yml similarity index 100% rename from plugins/examples/custom-suggester/src/test/resources/rest-api-spec/test/custom-suggester/20_suggest.yml rename to plugins/examples/custom-suggester/src/yamlRestTest/resources/rest-api-spec/test/custom-suggester/20_suggest.yml diff --git a/plugins/examples/painless-whitelist/build.gradle b/plugins/examples/painless-whitelist/build.gradle index 5b57e51cbfd1f..c65fd35738c1d 100644 --- a/plugins/examples/painless-whitelist/build.gradle +++ b/plugins/examples/painless-whitelist/build.gradle @@ -19,7 +19,7 @@ apply plugin: 'elasticsearch.testclusters' apply plugin: 'elasticsearch.esplugin' -apply plugin: 'elasticsearch.rest-resources' +apply plugin: 'elasticsearch.yaml-rest-test' esplugin { name 'painless-whitelist' diff --git a/plugins/examples/rescore/build.gradle b/plugins/examples/rescore/build.gradle index 20527b8b6dbc7..0f23df2373108 100644 --- a/plugins/examples/rescore/build.gradle +++ b/plugins/examples/rescore/build.gradle @@ -18,7 +18,7 @@ */ apply plugin: 'elasticsearch.testclusters' apply plugin: 'elasticsearch.esplugin' -apply plugin: 'elasticsearch.rest-resources' +apply plugin: 'elasticsearch.yaml-rest-test' esplugin { name 'example-rescore' diff --git a/plugins/examples/rest-handler/build.gradle b/plugins/examples/rest-handler/build.gradle index 92d7f296b0be8..640b05be491c2 100644 --- a/plugins/examples/rest-handler/build.gradle +++ b/plugins/examples/rest-handler/build.gradle @@ -20,7 +20,7 @@ import org.elasticsearch.gradle.info.BuildParams */ apply plugin: 'elasticsearch.testclusters' apply plugin: 'elasticsearch.esplugin' -apply plugin: 'elasticsearch.rest-resources' +apply plugin: 'elasticsearch.yaml-rest-test' esplugin { name 'rest-handler' diff --git a/plugins/examples/script-expert-scoring/build.gradle b/plugins/examples/script-expert-scoring/build.gradle index 65b6203967461..022c97410ff6f 100644 --- a/plugins/examples/script-expert-scoring/build.gradle +++ b/plugins/examples/script-expert-scoring/build.gradle @@ -18,7 +18,7 @@ */ apply plugin: 'elasticsearch.testclusters' apply plugin: 'elasticsearch.esplugin' -apply plugin: 'elasticsearch.rest-resources' +apply plugin: 'elasticsearch.yaml-rest-test' esplugin { name 'script-expert-scoring' diff --git a/plugins/examples/security-authorization-engine/build.gradle b/plugins/examples/security-authorization-engine/build.gradle index 86d1ee826110d..654f8614b37b4 100644 --- a/plugins/examples/security-authorization-engine/build.gradle +++ b/plugins/examples/security-authorization-engine/build.gradle @@ -1,6 +1,6 @@ apply plugin: 'elasticsearch.testclusters' apply plugin: 'elasticsearch.esplugin' -apply plugin: 'elasticsearch.rest-resources' +apply plugin: 'elasticsearch.yaml-rest-test' esplugin { name 'security-authorization-engine' diff --git a/plugins/ingest-attachment/build.gradle b/plugins/ingest-attachment/build.gradle index d86431ff0f859..2705100f71640 100644 --- a/plugins/ingest-attachment/build.gradle +++ b/plugins/ingest-attachment/build.gradle @@ -18,7 +18,7 @@ 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' esplugin { description 'Ingest processor that uses Apache Tika to extract contents' diff --git a/plugins/mapper-annotated-text/build.gradle b/plugins/mapper-annotated-text/build.gradle index a8a5a53196eb3..7a5305a107ddc 100644 --- a/plugins/mapper-annotated-text/build.gradle +++ b/plugins/mapper-annotated-text/build.gradle @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -apply plugin: 'elasticsearch.rest-resources' +apply plugin: 'elasticsearch.yaml-rest-test' esplugin { description 'The Mapper Annotated_text plugin adds support for text fields with markup used to inject annotation tokens into the index.' diff --git a/plugins/mapper-murmur3/build.gradle b/plugins/mapper-murmur3/build.gradle index 5b9c459eea8be..3d8c94695912e 100644 --- a/plugins/mapper-murmur3/build.gradle +++ b/plugins/mapper-murmur3/build.gradle @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -apply plugin: 'elasticsearch.rest-resources' +apply plugin: 'elasticsearch.yaml-rest-test' esplugin { description 'The Mapper Murmur3 plugin allows to compute hashes of a field\'s values at index-time and to store them in the index.' diff --git a/plugins/mapper-size/build.gradle b/plugins/mapper-size/build.gradle index fd4deab79bbb5..1732c10aa7c9e 100644 --- a/plugins/mapper-size/build.gradle +++ b/plugins/mapper-size/build.gradle @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -apply plugin: 'elasticsearch.rest-resources' +apply plugin: 'elasticsearch.yaml-rest-test' esplugin { description 'The Mapper Size plugin allows document to record their uncompressed size at index time.' diff --git a/plugins/repository-azure/build.gradle b/plugins/repository-azure/build.gradle index 723a4c1e0753a..1816c894085de 100644 --- a/plugins/repository-azure/build.gradle +++ b/plugins/repository-azure/build.gradle @@ -22,7 +22,7 @@ import static org.elasticsearch.gradle.PropertyNormalization.IGNORE_VALUE * specific language governing permissions and limitations * under the License. */ -apply plugin: 'elasticsearch.rest-resources' +apply plugin: 'elasticsearch.yaml-rest-test' esplugin { description 'The Azure Repository plugin adds support for Azure storage repositories.' diff --git a/plugins/repository-gcs/build.gradle b/plugins/repository-gcs/build.gradle index 5a60f96d8abbd..67585a6125578 100644 --- a/plugins/repository-gcs/build.gradle +++ b/plugins/repository-gcs/build.gradle @@ -28,7 +28,7 @@ import static org.elasticsearch.gradle.PropertyNormalization.IGNORE_VALUE * specific language governing permissions and limitations * under the License. */ -apply plugin: 'elasticsearch.rest-resources' +apply plugin: 'elasticsearch.yaml-rest-test' esplugin { description 'The GCS repository plugin adds Google Cloud Storage support for repositories.' diff --git a/plugins/repository-hdfs/build.gradle b/plugins/repository-hdfs/build.gradle index e179ba392a1ff..ae4cdc9adab1f 100644 --- a/plugins/repository-hdfs/build.gradle +++ b/plugins/repository-hdfs/build.gradle @@ -28,7 +28,7 @@ import java.nio.file.Paths import static org.elasticsearch.gradle.PropertyNormalization.IGNORE_VALUE apply plugin: 'elasticsearch.test.fixtures' -apply plugin: 'elasticsearch.rest-resources' +apply plugin: 'elasticsearch.yaml-rest-test' esplugin { description 'The HDFS repository plugin adds support for Hadoop Distributed File-System (HDFS) repositories.' diff --git a/plugins/repository-s3/build.gradle b/plugins/repository-s3/build.gradle index 38362209228e6..0c7c45f68a6c0 100644 --- a/plugins/repository-s3/build.gradle +++ b/plugins/repository-s3/build.gradle @@ -22,7 +22,7 @@ import static org.elasticsearch.gradle.PropertyNormalization.IGNORE_VALUE * specific language governing permissions and limitations * under the License. */ -apply plugin: 'elasticsearch.rest-resources' +apply plugin: 'elasticsearch.yaml-rest-test' esplugin { description 'The S3 repository plugin adds S3 repositories' diff --git a/plugins/store-smb/build.gradle b/plugins/store-smb/build.gradle index fd137f0e34cc7..3aee34b587d6a 100644 --- a/plugins/store-smb/build.gradle +++ b/plugins/store-smb/build.gradle @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -apply plugin: 'elasticsearch.rest-resources' +apply plugin: 'elasticsearch.yaml-rest-test' esplugin { description 'The Store SMB plugin adds support for SMB stores.' From 1e56bb3f943612b86956095adbc0370cbd8335a9 Mon Sep 17 00:00:00 2001 From: Jake Landis Date: Sat, 11 Jul 2020 17:02:58 -0500 Subject: [PATCH 02/26] fix annoyning bug --- .../org/elasticsearch/gradle/test/rest/CopyRestApiTask.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/test/rest/CopyRestApiTask.java b/buildSrc/src/main/java/org/elasticsearch/gradle/test/rest/CopyRestApiTask.java index 0caf6bdc543c2..847fe3f7bb949 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/test/rest/CopyRestApiTask.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/test/rest/CopyRestApiTask.java @@ -198,7 +198,7 @@ private File getTestSourceResourceDir() { Set resourceDir = testSources.getResources() .getSrcDirs() .stream() - .filter(f -> f.isDirectory() && f.getParentFile().getName().equals("test") && f.getName().equals("resources")) + .filter(f -> f.isDirectory() && f.getParentFile().getName().equals(getSourceSetName()) && f.getName().equals("resources")) .collect(Collectors.toSet()); assert resourceDir.size() <= 1; if (resourceDir.size() == 0) { From 424fd5efd1420c1f88659f047b8999ebed6122c6 Mon Sep 17 00:00:00 2001 From: Jake Landis Date: Mon, 13 Jul 2020 12:01:15 -0500 Subject: [PATCH 03/26] more conversion, ignore repository and store for now --- plugins/examples/painless-whitelist/build.gradle | 5 ++--- .../PainlessWhitelistClientYamlTestSuiteIT.java | 0 .../rest-api-spec/test/painless_whitelist/10_basic.yml | 0 .../rest-api-spec/test/painless_whitelist/20_whitelist.yml | 0 .../rest-api-spec/test/painless_whitelist/30_static.yml | 0 .../rest-api-spec/test/painless_whitelist/40_instance.yml | 0 plugins/examples/rescore/build.gradle | 2 +- .../rescore/ExampleRescoreClientYamlTestSuiteIT.java | 0 .../rest-api-spec/test/example-rescore/10_basic.yml | 0 .../rest-api-spec/test/example-rescore/20_score.yml | 0 plugins/examples/rest-handler/build.gradle | 1 - .../ExampleRestHandlerClientYamlTestSuiteIT.java | 6 +++--- .../resources/rest-api-spec/api/cat.example.json | 0 .../resources/rest-api-spec/test/resthandler/10_basic.yml | 0 .../rest-api-spec/test/resthandler/20_cat_example.yml | 0 plugins/examples/script-expert-scoring/build.gradle | 2 +- .../expertscript/ExpertScriptClientYamlTestSuiteIT.java | 0 .../rest-api-spec/test/script_expert_scoring/10_basic.yml | 0 .../rest-api-spec/test/script_expert_scoring/20_score.yml | 0 plugins/ingest-attachment/build.gradle | 2 ++ .../attachment/IngestAttachmentClientYamlTestSuiteIT.java | 0 .../rest-api-spec/test/ingest_attachment/10_basic.yml | 0 .../test/ingest_attachment/20_attachment_processor.yml | 0 .../test/ingest_attachment/30_files_supported.yml | 0 plugins/mapper-annotated-text/build.gradle | 2 ++ .../annotatedtext/AnnotatedTextClientYamlTestSuiteIT.java | 0 .../rest-api-spec/test/mapper_annotatedtext/10_basic.yml | 0 plugins/mapper-murmur3/build.gradle | 2 ++ .../mapper/murmur3/MapperMurmur3ClientYamlTestSuiteIT.java | 0 .../rest-api-spec/test/mapper_murmur3/10_basic.yml | 0 .../index/mapper/size/MapperSizeClientYamlTestSuiteIT.java | 0 .../resources/rest-api-spec/test/mapper_size/10_basic.yml | 0 plugins/repository-azure/build.gradle | 2 +- plugins/repository-gcs/build.gradle | 2 +- plugins/repository-hdfs/build.gradle | 2 +- plugins/repository-s3/build.gradle | 2 +- plugins/store-smb/build.gradle | 2 +- 37 files changed, 18 insertions(+), 14 deletions(-) rename plugins/examples/painless-whitelist/src/{test => yamlRestTest}/java/org/elasticsearch/example/painlesswhitelist/PainlessWhitelistClientYamlTestSuiteIT.java (100%) rename plugins/examples/painless-whitelist/src/{test => yamlRestTest}/resources/rest-api-spec/test/painless_whitelist/10_basic.yml (100%) rename plugins/examples/painless-whitelist/src/{test => yamlRestTest}/resources/rest-api-spec/test/painless_whitelist/20_whitelist.yml (100%) rename plugins/examples/painless-whitelist/src/{test => yamlRestTest}/resources/rest-api-spec/test/painless_whitelist/30_static.yml (100%) rename plugins/examples/painless-whitelist/src/{test => yamlRestTest}/resources/rest-api-spec/test/painless_whitelist/40_instance.yml (100%) rename plugins/examples/rescore/src/{test => yamlRestTest}/java/org/elasticsearch/example/rescore/ExampleRescoreClientYamlTestSuiteIT.java (100%) rename plugins/examples/rescore/src/{test => yamlRestTest}/resources/rest-api-spec/test/example-rescore/10_basic.yml (100%) rename plugins/examples/rescore/src/{test => yamlRestTest}/resources/rest-api-spec/test/example-rescore/20_score.yml (100%) rename plugins/examples/rest-handler/src/{test => yamlRestTest}/java/org/elasticsearch/example/resthandler/ExampleRestHandlerClientYamlTestSuiteIT.java (89%) rename plugins/examples/rest-handler/src/{test => yamlRestTest}/resources/rest-api-spec/api/cat.example.json (100%) rename plugins/examples/rest-handler/src/{test => yamlRestTest}/resources/rest-api-spec/test/resthandler/10_basic.yml (100%) rename plugins/examples/rest-handler/src/{test => yamlRestTest}/resources/rest-api-spec/test/resthandler/20_cat_example.yml (100%) rename plugins/examples/script-expert-scoring/src/{test => yamlRestTest}/java/org/elasticsearch/example/expertscript/ExpertScriptClientYamlTestSuiteIT.java (100%) rename plugins/examples/script-expert-scoring/src/{test => yamlRestTest}/resources/rest-api-spec/test/script_expert_scoring/10_basic.yml (100%) rename plugins/examples/script-expert-scoring/src/{test => yamlRestTest}/resources/rest-api-spec/test/script_expert_scoring/20_score.yml (100%) rename plugins/ingest-attachment/src/{test => yamlRestTest}/java/org/elasticsearch/ingest/attachment/IngestAttachmentClientYamlTestSuiteIT.java (100%) rename plugins/ingest-attachment/src/{test => yamlRestTest}/resources/rest-api-spec/test/ingest_attachment/10_basic.yml (100%) rename plugins/ingest-attachment/src/{test => yamlRestTest}/resources/rest-api-spec/test/ingest_attachment/20_attachment_processor.yml (100%) rename plugins/ingest-attachment/src/{test => yamlRestTest}/resources/rest-api-spec/test/ingest_attachment/30_files_supported.yml (100%) rename plugins/mapper-annotated-text/src/{test => yamlRestTest}/java/org/elasticsearch/index/mapper/annotatedtext/AnnotatedTextClientYamlTestSuiteIT.java (100%) rename plugins/mapper-annotated-text/src/{test => yamlRestTest}/resources/rest-api-spec/test/mapper_annotatedtext/10_basic.yml (100%) rename plugins/mapper-murmur3/src/{test => yamlRestTest}/java/org/elasticsearch/index/mapper/murmur3/MapperMurmur3ClientYamlTestSuiteIT.java (100%) rename plugins/mapper-murmur3/src/{test => yamlRestTest}/resources/rest-api-spec/test/mapper_murmur3/10_basic.yml (100%) rename plugins/mapper-size/src/{test => yamlRestTest}/java/org/elasticsearch/index/mapper/size/MapperSizeClientYamlTestSuiteIT.java (100%) rename plugins/mapper-size/src/{test => yamlRestTest}/resources/rest-api-spec/test/mapper_size/10_basic.yml (100%) diff --git a/plugins/examples/painless-whitelist/build.gradle b/plugins/examples/painless-whitelist/build.gradle index c65fd35738c1d..b46c70cbd36eb 100644 --- a/plugins/examples/painless-whitelist/build.gradle +++ b/plugins/examples/painless-whitelist/build.gradle @@ -16,8 +16,6 @@ * specific language governing permissions and limitations * under the License. */ - -apply plugin: 'elasticsearch.testclusters' apply plugin: 'elasticsearch.esplugin' apply plugin: 'elasticsearch.yaml-rest-test' @@ -34,8 +32,9 @@ dependencies { compileOnly "org.elasticsearch.plugin:elasticsearch-scripting-painless-spi:${versions.elasticsearch}" } -testClusters.integTest { +testClusters.all { testDistribution = 'OSS' } test.enabled = false +integTest.enabled = false diff --git a/plugins/examples/painless-whitelist/src/test/java/org/elasticsearch/example/painlesswhitelist/PainlessWhitelistClientYamlTestSuiteIT.java b/plugins/examples/painless-whitelist/src/yamlRestTest/java/org/elasticsearch/example/painlesswhitelist/PainlessWhitelistClientYamlTestSuiteIT.java similarity index 100% rename from plugins/examples/painless-whitelist/src/test/java/org/elasticsearch/example/painlesswhitelist/PainlessWhitelistClientYamlTestSuiteIT.java rename to plugins/examples/painless-whitelist/src/yamlRestTest/java/org/elasticsearch/example/painlesswhitelist/PainlessWhitelistClientYamlTestSuiteIT.java diff --git a/plugins/examples/painless-whitelist/src/test/resources/rest-api-spec/test/painless_whitelist/10_basic.yml b/plugins/examples/painless-whitelist/src/yamlRestTest/resources/rest-api-spec/test/painless_whitelist/10_basic.yml similarity index 100% rename from plugins/examples/painless-whitelist/src/test/resources/rest-api-spec/test/painless_whitelist/10_basic.yml rename to plugins/examples/painless-whitelist/src/yamlRestTest/resources/rest-api-spec/test/painless_whitelist/10_basic.yml diff --git a/plugins/examples/painless-whitelist/src/test/resources/rest-api-spec/test/painless_whitelist/20_whitelist.yml b/plugins/examples/painless-whitelist/src/yamlRestTest/resources/rest-api-spec/test/painless_whitelist/20_whitelist.yml similarity index 100% rename from plugins/examples/painless-whitelist/src/test/resources/rest-api-spec/test/painless_whitelist/20_whitelist.yml rename to plugins/examples/painless-whitelist/src/yamlRestTest/resources/rest-api-spec/test/painless_whitelist/20_whitelist.yml diff --git a/plugins/examples/painless-whitelist/src/test/resources/rest-api-spec/test/painless_whitelist/30_static.yml b/plugins/examples/painless-whitelist/src/yamlRestTest/resources/rest-api-spec/test/painless_whitelist/30_static.yml similarity index 100% rename from plugins/examples/painless-whitelist/src/test/resources/rest-api-spec/test/painless_whitelist/30_static.yml rename to plugins/examples/painless-whitelist/src/yamlRestTest/resources/rest-api-spec/test/painless_whitelist/30_static.yml diff --git a/plugins/examples/painless-whitelist/src/test/resources/rest-api-spec/test/painless_whitelist/40_instance.yml b/plugins/examples/painless-whitelist/src/yamlRestTest/resources/rest-api-spec/test/painless_whitelist/40_instance.yml similarity index 100% rename from plugins/examples/painless-whitelist/src/test/resources/rest-api-spec/test/painless_whitelist/40_instance.yml rename to plugins/examples/painless-whitelist/src/yamlRestTest/resources/rest-api-spec/test/painless_whitelist/40_instance.yml diff --git a/plugins/examples/rescore/build.gradle b/plugins/examples/rescore/build.gradle index 0f23df2373108..331623d4f1cad 100644 --- a/plugins/examples/rescore/build.gradle +++ b/plugins/examples/rescore/build.gradle @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -apply plugin: 'elasticsearch.testclusters' apply plugin: 'elasticsearch.esplugin' apply plugin: 'elasticsearch.yaml-rest-test' @@ -28,3 +27,4 @@ esplugin { noticeFile rootProject.file('NOTICE.txt') } +integTest.enabled = false diff --git a/plugins/examples/rescore/src/test/java/org/elasticsearch/example/rescore/ExampleRescoreClientYamlTestSuiteIT.java b/plugins/examples/rescore/src/yamlRestTest/java/org/elasticsearch/example/rescore/ExampleRescoreClientYamlTestSuiteIT.java similarity index 100% rename from plugins/examples/rescore/src/test/java/org/elasticsearch/example/rescore/ExampleRescoreClientYamlTestSuiteIT.java rename to plugins/examples/rescore/src/yamlRestTest/java/org/elasticsearch/example/rescore/ExampleRescoreClientYamlTestSuiteIT.java diff --git a/plugins/examples/rescore/src/test/resources/rest-api-spec/test/example-rescore/10_basic.yml b/plugins/examples/rescore/src/yamlRestTest/resources/rest-api-spec/test/example-rescore/10_basic.yml similarity index 100% rename from plugins/examples/rescore/src/test/resources/rest-api-spec/test/example-rescore/10_basic.yml rename to plugins/examples/rescore/src/yamlRestTest/resources/rest-api-spec/test/example-rescore/10_basic.yml diff --git a/plugins/examples/rescore/src/test/resources/rest-api-spec/test/example-rescore/20_score.yml b/plugins/examples/rescore/src/yamlRestTest/resources/rest-api-spec/test/example-rescore/20_score.yml similarity index 100% rename from plugins/examples/rescore/src/test/resources/rest-api-spec/test/example-rescore/20_score.yml rename to plugins/examples/rescore/src/yamlRestTest/resources/rest-api-spec/test/example-rescore/20_score.yml diff --git a/plugins/examples/rest-handler/build.gradle b/plugins/examples/rest-handler/build.gradle index 640b05be491c2..67c26e7d30aca 100644 --- a/plugins/examples/rest-handler/build.gradle +++ b/plugins/examples/rest-handler/build.gradle @@ -18,7 +18,6 @@ import org.elasticsearch.gradle.info.BuildParams * specific language governing permissions and limitations * under the License. */ -apply plugin: 'elasticsearch.testclusters' apply plugin: 'elasticsearch.esplugin' apply plugin: 'elasticsearch.yaml-rest-test' diff --git a/plugins/examples/rest-handler/src/test/java/org/elasticsearch/example/resthandler/ExampleRestHandlerClientYamlTestSuiteIT.java b/plugins/examples/rest-handler/src/yamlRestTest/java/org/elasticsearch/example/resthandler/ExampleRestHandlerClientYamlTestSuiteIT.java similarity index 89% rename from plugins/examples/rest-handler/src/test/java/org/elasticsearch/example/resthandler/ExampleRestHandlerClientYamlTestSuiteIT.java rename to plugins/examples/rest-handler/src/yamlRestTest/java/org/elasticsearch/example/resthandler/ExampleRestHandlerClientYamlTestSuiteIT.java index e4c2d6f655c19..78842ac6850ec 100644 --- a/plugins/examples/rest-handler/src/test/java/org/elasticsearch/example/resthandler/ExampleRestHandlerClientYamlTestSuiteIT.java +++ b/plugins/examples/rest-handler/src/yamlRestTest/java/org/elasticsearch/example/resthandler/ExampleRestHandlerClientYamlTestSuiteIT.java @@ -26,11 +26,11 @@ /** * {@link ExampleRestHandlerClientYamlTestSuiteIT} executes the plugin's REST API integration tests. *

- * The tests can be executed using the command: ./gradlew :example-plugins:rest-handler:check + * The tests can be executed using the command: ./gradlew :example-plugins:rest-handler:yamlRestTest *

* This class extends {@link ESClientYamlSuiteTestCase}, which takes care of parsing the YAML files - * located in the src/test/resources/rest-api-spec/test/ directory and validates them against the - * custom REST API definition files located in src/test/resources/rest-api-spec/api/. + * located in the src/yamlRestTest/resources/rest-api-spec/test/ directory and validates them against the + * custom REST API definition files located in src/yamlRestTest/resources/rest-api-spec/api/. *

* Once validated, {@link ESClientYamlSuiteTestCase} executes the REST tests against a single node * integration cluster which has the plugin already installed by the Gradle build script. diff --git a/plugins/examples/rest-handler/src/test/resources/rest-api-spec/api/cat.example.json b/plugins/examples/rest-handler/src/yamlRestTest/resources/rest-api-spec/api/cat.example.json similarity index 100% rename from plugins/examples/rest-handler/src/test/resources/rest-api-spec/api/cat.example.json rename to plugins/examples/rest-handler/src/yamlRestTest/resources/rest-api-spec/api/cat.example.json diff --git a/plugins/examples/rest-handler/src/test/resources/rest-api-spec/test/resthandler/10_basic.yml b/plugins/examples/rest-handler/src/yamlRestTest/resources/rest-api-spec/test/resthandler/10_basic.yml similarity index 100% rename from plugins/examples/rest-handler/src/test/resources/rest-api-spec/test/resthandler/10_basic.yml rename to plugins/examples/rest-handler/src/yamlRestTest/resources/rest-api-spec/test/resthandler/10_basic.yml diff --git a/plugins/examples/rest-handler/src/test/resources/rest-api-spec/test/resthandler/20_cat_example.yml b/plugins/examples/rest-handler/src/yamlRestTest/resources/rest-api-spec/test/resthandler/20_cat_example.yml similarity index 100% rename from plugins/examples/rest-handler/src/test/resources/rest-api-spec/test/resthandler/20_cat_example.yml rename to plugins/examples/rest-handler/src/yamlRestTest/resources/rest-api-spec/test/resthandler/20_cat_example.yml diff --git a/plugins/examples/script-expert-scoring/build.gradle b/plugins/examples/script-expert-scoring/build.gradle index 022c97410ff6f..9c73f4472578e 100644 --- a/plugins/examples/script-expert-scoring/build.gradle +++ b/plugins/examples/script-expert-scoring/build.gradle @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -apply plugin: 'elasticsearch.testclusters' apply plugin: 'elasticsearch.esplugin' apply plugin: 'elasticsearch.yaml-rest-test' @@ -29,4 +28,5 @@ esplugin { } test.enabled = false +integTest.enabled = false diff --git a/plugins/examples/script-expert-scoring/src/test/java/org/elasticsearch/example/expertscript/ExpertScriptClientYamlTestSuiteIT.java b/plugins/examples/script-expert-scoring/src/yamlRestTest/java/org/elasticsearch/example/expertscript/ExpertScriptClientYamlTestSuiteIT.java similarity index 100% rename from plugins/examples/script-expert-scoring/src/test/java/org/elasticsearch/example/expertscript/ExpertScriptClientYamlTestSuiteIT.java rename to plugins/examples/script-expert-scoring/src/yamlRestTest/java/org/elasticsearch/example/expertscript/ExpertScriptClientYamlTestSuiteIT.java diff --git a/plugins/examples/script-expert-scoring/src/test/resources/rest-api-spec/test/script_expert_scoring/10_basic.yml b/plugins/examples/script-expert-scoring/src/yamlRestTest/resources/rest-api-spec/test/script_expert_scoring/10_basic.yml similarity index 100% rename from plugins/examples/script-expert-scoring/src/test/resources/rest-api-spec/test/script_expert_scoring/10_basic.yml rename to plugins/examples/script-expert-scoring/src/yamlRestTest/resources/rest-api-spec/test/script_expert_scoring/10_basic.yml diff --git a/plugins/examples/script-expert-scoring/src/test/resources/rest-api-spec/test/script_expert_scoring/20_score.yml b/plugins/examples/script-expert-scoring/src/yamlRestTest/resources/rest-api-spec/test/script_expert_scoring/20_score.yml similarity index 100% rename from plugins/examples/script-expert-scoring/src/test/resources/rest-api-spec/test/script_expert_scoring/20_score.yml rename to plugins/examples/script-expert-scoring/src/yamlRestTest/resources/rest-api-spec/test/script_expert_scoring/20_score.yml diff --git a/plugins/ingest-attachment/build.gradle b/plugins/ingest-attachment/build.gradle index 2705100f71640..2721bcf533311 100644 --- a/plugins/ingest-attachment/build.gradle +++ b/plugins/ingest-attachment/build.gradle @@ -83,6 +83,8 @@ restResources { } } +integTest.enabled = false + tasks.named("dependencyLicenses").configure { mapping from: /apache-mime4j-.*/, to: 'apache-mime4j' } diff --git a/plugins/ingest-attachment/src/test/java/org/elasticsearch/ingest/attachment/IngestAttachmentClientYamlTestSuiteIT.java b/plugins/ingest-attachment/src/yamlRestTest/java/org/elasticsearch/ingest/attachment/IngestAttachmentClientYamlTestSuiteIT.java similarity index 100% rename from plugins/ingest-attachment/src/test/java/org/elasticsearch/ingest/attachment/IngestAttachmentClientYamlTestSuiteIT.java rename to plugins/ingest-attachment/src/yamlRestTest/java/org/elasticsearch/ingest/attachment/IngestAttachmentClientYamlTestSuiteIT.java diff --git a/plugins/ingest-attachment/src/test/resources/rest-api-spec/test/ingest_attachment/10_basic.yml b/plugins/ingest-attachment/src/yamlRestTest/resources/rest-api-spec/test/ingest_attachment/10_basic.yml similarity index 100% rename from plugins/ingest-attachment/src/test/resources/rest-api-spec/test/ingest_attachment/10_basic.yml rename to plugins/ingest-attachment/src/yamlRestTest/resources/rest-api-spec/test/ingest_attachment/10_basic.yml diff --git a/plugins/ingest-attachment/src/test/resources/rest-api-spec/test/ingest_attachment/20_attachment_processor.yml b/plugins/ingest-attachment/src/yamlRestTest/resources/rest-api-spec/test/ingest_attachment/20_attachment_processor.yml similarity index 100% rename from plugins/ingest-attachment/src/test/resources/rest-api-spec/test/ingest_attachment/20_attachment_processor.yml rename to plugins/ingest-attachment/src/yamlRestTest/resources/rest-api-spec/test/ingest_attachment/20_attachment_processor.yml diff --git a/plugins/ingest-attachment/src/test/resources/rest-api-spec/test/ingest_attachment/30_files_supported.yml b/plugins/ingest-attachment/src/yamlRestTest/resources/rest-api-spec/test/ingest_attachment/30_files_supported.yml similarity index 100% rename from plugins/ingest-attachment/src/test/resources/rest-api-spec/test/ingest_attachment/30_files_supported.yml rename to plugins/ingest-attachment/src/yamlRestTest/resources/rest-api-spec/test/ingest_attachment/30_files_supported.yml diff --git a/plugins/mapper-annotated-text/build.gradle b/plugins/mapper-annotated-text/build.gradle index 7a5305a107ddc..bf1046c3503be 100644 --- a/plugins/mapper-annotated-text/build.gradle +++ b/plugins/mapper-annotated-text/build.gradle @@ -28,3 +28,5 @@ restResources { includeCore '_common', 'indices', 'index', 'search' } } + +integTest.enabled = false diff --git a/plugins/mapper-annotated-text/src/test/java/org/elasticsearch/index/mapper/annotatedtext/AnnotatedTextClientYamlTestSuiteIT.java b/plugins/mapper-annotated-text/src/yamlRestTest/java/org/elasticsearch/index/mapper/annotatedtext/AnnotatedTextClientYamlTestSuiteIT.java similarity index 100% rename from plugins/mapper-annotated-text/src/test/java/org/elasticsearch/index/mapper/annotatedtext/AnnotatedTextClientYamlTestSuiteIT.java rename to plugins/mapper-annotated-text/src/yamlRestTest/java/org/elasticsearch/index/mapper/annotatedtext/AnnotatedTextClientYamlTestSuiteIT.java diff --git a/plugins/mapper-annotated-text/src/test/resources/rest-api-spec/test/mapper_annotatedtext/10_basic.yml b/plugins/mapper-annotated-text/src/yamlRestTest/resources/rest-api-spec/test/mapper_annotatedtext/10_basic.yml similarity index 100% rename from plugins/mapper-annotated-text/src/test/resources/rest-api-spec/test/mapper_annotatedtext/10_basic.yml rename to plugins/mapper-annotated-text/src/yamlRestTest/resources/rest-api-spec/test/mapper_annotatedtext/10_basic.yml diff --git a/plugins/mapper-murmur3/build.gradle b/plugins/mapper-murmur3/build.gradle index 3d8c94695912e..fca4178f0f01c 100644 --- a/plugins/mapper-murmur3/build.gradle +++ b/plugins/mapper-murmur3/build.gradle @@ -28,3 +28,5 @@ restResources { includeCore '_common', 'indices', 'index', 'search' } } + +integTest.enabled = false diff --git a/plugins/mapper-murmur3/src/test/java/org/elasticsearch/index/mapper/murmur3/MapperMurmur3ClientYamlTestSuiteIT.java b/plugins/mapper-murmur3/src/yamlRestTest/java/org/elasticsearch/index/mapper/murmur3/MapperMurmur3ClientYamlTestSuiteIT.java similarity index 100% rename from plugins/mapper-murmur3/src/test/java/org/elasticsearch/index/mapper/murmur3/MapperMurmur3ClientYamlTestSuiteIT.java rename to plugins/mapper-murmur3/src/yamlRestTest/java/org/elasticsearch/index/mapper/murmur3/MapperMurmur3ClientYamlTestSuiteIT.java diff --git a/plugins/mapper-murmur3/src/test/resources/rest-api-spec/test/mapper_murmur3/10_basic.yml b/plugins/mapper-murmur3/src/yamlRestTest/resources/rest-api-spec/test/mapper_murmur3/10_basic.yml similarity index 100% rename from plugins/mapper-murmur3/src/test/resources/rest-api-spec/test/mapper_murmur3/10_basic.yml rename to plugins/mapper-murmur3/src/yamlRestTest/resources/rest-api-spec/test/mapper_murmur3/10_basic.yml diff --git a/plugins/mapper-size/src/test/java/org/elasticsearch/index/mapper/size/MapperSizeClientYamlTestSuiteIT.java b/plugins/mapper-size/src/yamlRestTest/java/org/elasticsearch/index/mapper/size/MapperSizeClientYamlTestSuiteIT.java similarity index 100% rename from plugins/mapper-size/src/test/java/org/elasticsearch/index/mapper/size/MapperSizeClientYamlTestSuiteIT.java rename to plugins/mapper-size/src/yamlRestTest/java/org/elasticsearch/index/mapper/size/MapperSizeClientYamlTestSuiteIT.java diff --git a/plugins/mapper-size/src/test/resources/rest-api-spec/test/mapper_size/10_basic.yml b/plugins/mapper-size/src/yamlRestTest/resources/rest-api-spec/test/mapper_size/10_basic.yml similarity index 100% rename from plugins/mapper-size/src/test/resources/rest-api-spec/test/mapper_size/10_basic.yml rename to plugins/mapper-size/src/yamlRestTest/resources/rest-api-spec/test/mapper_size/10_basic.yml diff --git a/plugins/repository-azure/build.gradle b/plugins/repository-azure/build.gradle index 1816c894085de..723a4c1e0753a 100644 --- a/plugins/repository-azure/build.gradle +++ b/plugins/repository-azure/build.gradle @@ -22,7 +22,7 @@ import static org.elasticsearch.gradle.PropertyNormalization.IGNORE_VALUE * specific language governing permissions and limitations * under the License. */ -apply plugin: 'elasticsearch.yaml-rest-test' +apply plugin: 'elasticsearch.rest-resources' esplugin { description 'The Azure Repository plugin adds support for Azure storage repositories.' diff --git a/plugins/repository-gcs/build.gradle b/plugins/repository-gcs/build.gradle index 67585a6125578..5a60f96d8abbd 100644 --- a/plugins/repository-gcs/build.gradle +++ b/plugins/repository-gcs/build.gradle @@ -28,7 +28,7 @@ import static org.elasticsearch.gradle.PropertyNormalization.IGNORE_VALUE * specific language governing permissions and limitations * under the License. */ -apply plugin: 'elasticsearch.yaml-rest-test' +apply plugin: 'elasticsearch.rest-resources' esplugin { description 'The GCS repository plugin adds Google Cloud Storage support for repositories.' diff --git a/plugins/repository-hdfs/build.gradle b/plugins/repository-hdfs/build.gradle index ae4cdc9adab1f..e179ba392a1ff 100644 --- a/plugins/repository-hdfs/build.gradle +++ b/plugins/repository-hdfs/build.gradle @@ -28,7 +28,7 @@ import java.nio.file.Paths import static org.elasticsearch.gradle.PropertyNormalization.IGNORE_VALUE apply plugin: 'elasticsearch.test.fixtures' -apply plugin: 'elasticsearch.yaml-rest-test' +apply plugin: 'elasticsearch.rest-resources' esplugin { description 'The HDFS repository plugin adds support for Hadoop Distributed File-System (HDFS) repositories.' diff --git a/plugins/repository-s3/build.gradle b/plugins/repository-s3/build.gradle index 0c7c45f68a6c0..38362209228e6 100644 --- a/plugins/repository-s3/build.gradle +++ b/plugins/repository-s3/build.gradle @@ -22,7 +22,7 @@ import static org.elasticsearch.gradle.PropertyNormalization.IGNORE_VALUE * specific language governing permissions and limitations * under the License. */ -apply plugin: 'elasticsearch.yaml-rest-test' +apply plugin: 'elasticsearch.rest-resources' esplugin { description 'The S3 repository plugin adds S3 repositories' diff --git a/plugins/store-smb/build.gradle b/plugins/store-smb/build.gradle index 3aee34b587d6a..fd137f0e34cc7 100644 --- a/plugins/store-smb/build.gradle +++ b/plugins/store-smb/build.gradle @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -apply plugin: 'elasticsearch.yaml-rest-test' +apply plugin: 'elasticsearch.rest-resources' esplugin { description 'The Store SMB plugin adds support for SMB stores.' From aa96ed806df8d4eb6341580da8b700d8923d2838 Mon Sep 17 00:00:00 2001 From: Jake Landis Date: Mon, 13 Jul 2020 12:08:30 -0500 Subject: [PATCH 04/26] remove temporary code --- .../org/elasticsearch/gradle/test/RestTestPlugin.groovy | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/RestTestPlugin.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/RestTestPlugin.groovy index b94d77ce3e0c7..669ff191e76a1 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/RestTestPlugin.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/RestTestPlugin.groovy @@ -36,23 +36,21 @@ import org.gradle.api.plugins.JavaBasePlugin class RestTestPlugin implements Plugin { List REQUIRED_PLUGINS = [ 'elasticsearch.build', - 'elasticsearch.standalone-rest-test', - 'elasticsearch.yaml-rest-test'] + 'elasticsearch.standalone-rest-test'] @Override void apply(Project project) { if (false == REQUIRED_PLUGINS.any { project.pluginManager.hasPlugin(it) }) { throw new InvalidUserDataException('elasticsearch.rest-test ' + 'requires either elasticsearch.build or ' - + 'elasticsearch.standalone-rest-test' - + 'elasticsearch.yaml-rest-test') + + 'elasticsearch.standalone-rest-test') } project.pluginManager.apply(TestClustersPlugin) RestIntegTestTask integTest = project.tasks.create('integTest', RestIntegTestTask.class) integTest.description = 'Runs rest tests against an elasticsearch cluster.' integTest.group = JavaBasePlugin.VERIFICATION_GROUP - // integTest.mustRunAfter(project.tasks.named('precommit')) + integTest.mustRunAfter(project.tasks.named('precommit')) project.tasks.named('check').configure { it.dependsOn(integTest) } } } From dfebc85902546bcc643cffb3979ac4541e14c2ed Mon Sep 17 00:00:00 2001 From: Jake Landis Date: Mon, 13 Jul 2020 12:11:18 -0500 Subject: [PATCH 05/26] remove unecessary todo --- plugins/discovery-gce/qa/gce/build.gradle | 3 --- 1 file changed, 3 deletions(-) diff --git a/plugins/discovery-gce/qa/gce/build.gradle b/plugins/discovery-gce/qa/gce/build.gradle index 3944f990a83ac..9ae4dc475fb89 100644 --- a/plugins/discovery-gce/qa/gce/build.gradle +++ b/plugins/discovery-gce/qa/gce/build.gradle @@ -28,9 +28,6 @@ apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.rest-resources' -//TODO: convert to yamlRestTest - fix incompatibilities with standalone-rest-test, will likely need a javaRestTest sourceSet to fix -//apply plugin: 'elasticsearch.yaml-rest-test' - final int gceNumberOfNodes = 3 dependencies { From 2be2c71a68c4ceacdd2be5c90c95da5700f05963 Mon Sep 17 00:00:00 2001 From: Jake Landis Date: Mon, 13 Jul 2020 12:15:38 -0500 Subject: [PATCH 06/26] remove unecessary todo --- plugins/discovery-ec2/qa/amazon-ec2/build.gradle | 3 --- 1 file changed, 3 deletions(-) diff --git a/plugins/discovery-ec2/qa/amazon-ec2/build.gradle b/plugins/discovery-ec2/qa/amazon-ec2/build.gradle index f7903e551c88e..c7f94ef278b66 100644 --- a/plugins/discovery-ec2/qa/amazon-ec2/build.gradle +++ b/plugins/discovery-ec2/qa/amazon-ec2/build.gradle @@ -29,9 +29,6 @@ apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.rest-resources' -//TODO: convert to yamlRestTest - fix incompatibilities with standalone-rest-test, will likely need a javaRestTest sourceSet to fix -//apply plugin: 'elasticsearch.yaml-rest-test' - dependencies { testImplementation project(':plugins:discovery-ec2') } From c603b8024dd8a41bdb393adf730ed534030a546d Mon Sep 17 00:00:00 2001 From: Jake Landis Date: Mon, 13 Jul 2020 12:57:50 -0500 Subject: [PATCH 07/26] remove rouge plugin defintion --- plugins/examples/security-authorization-engine/build.gradle | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/examples/security-authorization-engine/build.gradle b/plugins/examples/security-authorization-engine/build.gradle index 654f8614b37b4..15233bc872f4e 100644 --- a/plugins/examples/security-authorization-engine/build.gradle +++ b/plugins/examples/security-authorization-engine/build.gradle @@ -1,6 +1,5 @@ apply plugin: 'elasticsearch.testclusters' apply plugin: 'elasticsearch.esplugin' -apply plugin: 'elasticsearch.yaml-rest-test' esplugin { name 'security-authorization-engine' From a9a34d9fc3b175fef59909e9d7ac4d4da7c1acbf Mon Sep 17 00:00:00 2001 From: Jake Landis Date: Tue, 21 Jul 2020 17:50:25 -0500 Subject: [PATCH 08/26] remove (now) unneccessary integTest.enabled=false --- plugins/analysis-kuromoji/build.gradle | 3 --- plugins/analysis-nori/build.gradle | 2 -- plugins/analysis-phonetic/build.gradle | 2 -- plugins/analysis-smartcn/build.gradle | 2 -- plugins/analysis-stempel/build.gradle | 2 -- plugins/analysis-ukrainian/build.gradle | 2 -- plugins/discovery-azure-classic/build.gradle | 2 -- plugins/discovery-ec2/build.gradle | 2 -- plugins/discovery-gce/build.gradle | 2 -- plugins/examples/custom-settings/build.gradle | 1 - plugins/examples/custom-significance-heuristic/build.gradle | 2 -- plugins/examples/custom-suggester/build.gradle | 1 - plugins/examples/painless-whitelist/build.gradle | 1 - plugins/examples/rescore/build.gradle | 2 -- plugins/examples/script-expert-scoring/build.gradle | 1 - plugins/ingest-attachment/build.gradle | 2 -- plugins/mapper-annotated-text/build.gradle | 2 -- plugins/mapper-murmur3/build.gradle | 2 -- 18 files changed, 33 deletions(-) diff --git a/plugins/analysis-kuromoji/build.gradle b/plugins/analysis-kuromoji/build.gradle index 3f89c0f5823e4..b68a5e9aeb813 100644 --- a/plugins/analysis-kuromoji/build.gradle +++ b/plugins/analysis-kuromoji/build.gradle @@ -32,9 +32,6 @@ restResources { includeCore '_common', 'indices', 'index', 'search' } } - -integTest.enabled = false - tasks.named("dependencyLicenses").configure { mapping from: /lucene-.*/, to: 'lucene' } diff --git a/plugins/analysis-nori/build.gradle b/plugins/analysis-nori/build.gradle index 5ab19e330ef1e..e96602e68e809 100644 --- a/plugins/analysis-nori/build.gradle +++ b/plugins/analysis-nori/build.gradle @@ -33,8 +33,6 @@ restResources { } } -integTest.enabled = false - tasks.named("dependencyLicenses").configure { mapping from: /lucene-.*/, to: 'lucene' } diff --git a/plugins/analysis-phonetic/build.gradle b/plugins/analysis-phonetic/build.gradle index c2234d680183b..b49300f648f0a 100644 --- a/plugins/analysis-phonetic/build.gradle +++ b/plugins/analysis-phonetic/build.gradle @@ -34,8 +34,6 @@ restResources { } } -integTest.enabled = false - tasks.named("dependencyLicenses").configure { mapping from: /lucene-.*/, to: 'lucene' } diff --git a/plugins/analysis-smartcn/build.gradle b/plugins/analysis-smartcn/build.gradle index d4ad0adcdc70e..3bcb73085c145 100644 --- a/plugins/analysis-smartcn/build.gradle +++ b/plugins/analysis-smartcn/build.gradle @@ -33,8 +33,6 @@ restResources { } } -integTest.enabled = false - tasks.named("dependencyLicenses").configure { mapping from: /lucene-.*/, to: 'lucene' } diff --git a/plugins/analysis-stempel/build.gradle b/plugins/analysis-stempel/build.gradle index c3af13897f578..7cc59a7f60d50 100644 --- a/plugins/analysis-stempel/build.gradle +++ b/plugins/analysis-stempel/build.gradle @@ -33,8 +33,6 @@ restResources { } } -integTest.enabled = false - tasks.named("dependencyLicenses").configure { mapping from: /lucene-.*/, to: 'lucene' } diff --git a/plugins/analysis-ukrainian/build.gradle b/plugins/analysis-ukrainian/build.gradle index 4ae69bce771c0..0c2e8fce1f1be 100644 --- a/plugins/analysis-ukrainian/build.gradle +++ b/plugins/analysis-ukrainian/build.gradle @@ -36,8 +36,6 @@ restResources { } } -integTest.enabled = false - tasks.named("dependencyLicenses").configure { mapping from: /lucene-.*/, to: 'lucene' mapping from: /morfologik-.*/, to: 'lucene' diff --git a/plugins/discovery-azure-classic/build.gradle b/plugins/discovery-azure-classic/build.gradle index 7e9b104f73054..20a3278a6905e 100644 --- a/plugins/discovery-azure-classic/build.gradle +++ b/plugins/discovery-azure-classic/build.gradle @@ -64,8 +64,6 @@ restResources { } } -integTest.enabled = false - // needed to be consistent with ssl host checking String host = InetAddress.getLoopbackAddress().getHostAddress() diff --git a/plugins/discovery-ec2/build.gradle b/plugins/discovery-ec2/build.gradle index e569dd05d5dbd..75388494fb6ca 100644 --- a/plugins/discovery-ec2/build.gradle +++ b/plugins/discovery-ec2/build.gradle @@ -47,8 +47,6 @@ restResources { } } -integTest.enabled = false - tasks.named("dependencyLicenses").configure { mapping from: /aws-java-sdk-.*/, to: 'aws-java-sdk' mapping from: /jackson-.*/, to: 'jackson' diff --git a/plugins/discovery-gce/build.gradle b/plugins/discovery-gce/build.gradle index 84610eaa874b6..db60919dcd151 100644 --- a/plugins/discovery-gce/build.gradle +++ b/plugins/discovery-gce/build.gradle @@ -29,8 +29,6 @@ restResources { } } -integTest.enabled = false - tasks.named("dependencyLicenses").configure { mapping from: /google-.*/, to: 'google' } diff --git a/plugins/examples/custom-settings/build.gradle b/plugins/examples/custom-settings/build.gradle index b4b4b2988a57b..ca934759c1864 100644 --- a/plugins/examples/custom-settings/build.gradle +++ b/plugins/examples/custom-settings/build.gradle @@ -32,4 +32,3 @@ testClusters.all { keystore 'custom.secured', 'password' } -integTest.enabled = false diff --git a/plugins/examples/custom-significance-heuristic/build.gradle b/plugins/examples/custom-significance-heuristic/build.gradle index 0ee3efc0ff47f..e7938ba04fd9f 100644 --- a/plugins/examples/custom-significance-heuristic/build.gradle +++ b/plugins/examples/custom-significance-heuristic/build.gradle @@ -26,5 +26,3 @@ esplugin { licenseFile rootProject.file('licenses/APACHE-LICENSE-2.0.txt') noticeFile rootProject.file('NOTICE.txt') } - -integTest.enabled = false diff --git a/plugins/examples/custom-suggester/build.gradle b/plugins/examples/custom-suggester/build.gradle index c61255cba0e70..0646b1f24f2f0 100644 --- a/plugins/examples/custom-suggester/build.gradle +++ b/plugins/examples/custom-suggester/build.gradle @@ -33,4 +33,3 @@ testClusters.all { // this plugin has no unit tests, only rest tests tasks.test.enabled = false -integTest.enabled = false diff --git a/plugins/examples/painless-whitelist/build.gradle b/plugins/examples/painless-whitelist/build.gradle index b46c70cbd36eb..7753983ff8cfa 100644 --- a/plugins/examples/painless-whitelist/build.gradle +++ b/plugins/examples/painless-whitelist/build.gradle @@ -37,4 +37,3 @@ testClusters.all { } test.enabled = false -integTest.enabled = false diff --git a/plugins/examples/rescore/build.gradle b/plugins/examples/rescore/build.gradle index 331623d4f1cad..99c9279337cdf 100644 --- a/plugins/examples/rescore/build.gradle +++ b/plugins/examples/rescore/build.gradle @@ -26,5 +26,3 @@ esplugin { licenseFile rootProject.file('licenses/APACHE-LICENSE-2.0.txt') noticeFile rootProject.file('NOTICE.txt') } - -integTest.enabled = false diff --git a/plugins/examples/script-expert-scoring/build.gradle b/plugins/examples/script-expert-scoring/build.gradle index 9c73f4472578e..324b136b3ebfe 100644 --- a/plugins/examples/script-expert-scoring/build.gradle +++ b/plugins/examples/script-expert-scoring/build.gradle @@ -28,5 +28,4 @@ esplugin { } test.enabled = false -integTest.enabled = false diff --git a/plugins/ingest-attachment/build.gradle b/plugins/ingest-attachment/build.gradle index 2721bcf533311..2705100f71640 100644 --- a/plugins/ingest-attachment/build.gradle +++ b/plugins/ingest-attachment/build.gradle @@ -83,8 +83,6 @@ restResources { } } -integTest.enabled = false - tasks.named("dependencyLicenses").configure { mapping from: /apache-mime4j-.*/, to: 'apache-mime4j' } diff --git a/plugins/mapper-annotated-text/build.gradle b/plugins/mapper-annotated-text/build.gradle index bf1046c3503be..7a5305a107ddc 100644 --- a/plugins/mapper-annotated-text/build.gradle +++ b/plugins/mapper-annotated-text/build.gradle @@ -28,5 +28,3 @@ restResources { includeCore '_common', 'indices', 'index', 'search' } } - -integTest.enabled = false diff --git a/plugins/mapper-murmur3/build.gradle b/plugins/mapper-murmur3/build.gradle index fca4178f0f01c..3d8c94695912e 100644 --- a/plugins/mapper-murmur3/build.gradle +++ b/plugins/mapper-murmur3/build.gradle @@ -28,5 +28,3 @@ restResources { includeCore '_common', 'indices', 'index', 'search' } } - -integTest.enabled = false From 5c75412f830b1ea938bbfee39b2a20c4bc6f90d8 Mon Sep 17 00:00:00 2001 From: Jake Landis Date: Tue, 21 Jul 2020 18:10:13 -0500 Subject: [PATCH 09/26] fix forbiden API and move test --- plugins/analysis-icu/build.gradle | 13 +++++++------ .../mapper/ICUCollationKeywordFieldMapperIT.java | 0 2 files changed, 7 insertions(+), 6 deletions(-) rename plugins/analysis-icu/src/{test => internalClusterTest}/java/org/elasticsearch/index/mapper/ICUCollationKeywordFieldMapperIT.java (100%) diff --git a/plugins/analysis-icu/build.gradle b/plugins/analysis-icu/build.gradle index 8b35696ebb528..507156d4fec36 100644 --- a/plugins/analysis-icu/build.gradle +++ b/plugins/analysis-icu/build.gradle @@ -19,18 +19,19 @@ import de.thetaphi.forbiddenapis.gradle.CheckForbiddenApis * under the License. */ apply plugin: 'elasticsearch.yaml-rest-test' +apply plugin: 'elasticsearch.internal-cluster-test' esplugin { description 'The ICU Analysis plugin integrates the Lucene ICU module into Elasticsearch, adding ICU-related analysis components.' classname 'org.elasticsearch.plugin.analysis.icu.AnalysisICUPlugin' } -tasks.withType(CheckForbiddenApis).configureEach { task -> - if(task.name.contains("YamlRestTest") == false) { - signatures += [ - "com.ibm.icu.text.Collator#getInstance() @ Don't use default locale, use getInstance(ULocale) instead" - ] - } +List forbidden_signatures = new ArrayList([ + "com.ibm.icu.text.Collator#getInstance() @ Don't use default locale, use getInstance(ULocale) instead" +]) + +forbiddenApisMain { + signatures += forbidden_signatures } dependencies { diff --git a/plugins/analysis-icu/src/test/java/org/elasticsearch/index/mapper/ICUCollationKeywordFieldMapperIT.java b/plugins/analysis-icu/src/internalClusterTest/java/org/elasticsearch/index/mapper/ICUCollationKeywordFieldMapperIT.java similarity index 100% rename from plugins/analysis-icu/src/test/java/org/elasticsearch/index/mapper/ICUCollationKeywordFieldMapperIT.java rename to plugins/analysis-icu/src/internalClusterTest/java/org/elasticsearch/index/mapper/ICUCollationKeywordFieldMapperIT.java From 2fab21b807cb74ea2a88ded8b61d9fe927400a38 Mon Sep 17 00:00:00 2001 From: Jake Landis Date: Wed, 22 Jul 2020 10:30:03 -0500 Subject: [PATCH 10/26] more migration --- plugins/analysis-icu/build.gradle | 2 +- plugins/discovery-azure-classic/build.gradle | 5 ++- .../AbstractAzureComputeServiceTestCase.java | 4 +- .../AzureDiscoveryClusterFormationTests.java | 6 +-- .../azure/classic/AzureSimpleTests.java | 6 +-- .../classic/AzureTwoStartedNodesTests.java | 7 ++-- .../discovery-ec2/qa/amazon-ec2/build.gradle | 42 +++++++++++-------- ...azonEC2DiscoveryClientYamlTestSuiteIT.java | 4 +- .../discovery/ec2/AmazonEC2Fixture.java | 2 +- .../test/discovery_ec2/10_basic.yml | 0 .../discovery/ec2/AbstractAwsTestCase.java | 1 + 11 files changed, 44 insertions(+), 35 deletions(-) rename plugins/discovery-azure-classic/src/{test/java/org => internalClusterTest/java}/elasticsearch/cloud/azure/classic/AbstractAzureComputeServiceTestCase.java (98%) rename plugins/discovery-azure-classic/src/{test/java/org => internalClusterTest/java}/elasticsearch/discovery/azure/classic/AzureDiscoveryClusterFormationTests.java (98%) rename plugins/discovery-azure-classic/src/{test/java/org => internalClusterTest/java}/elasticsearch/discovery/azure/classic/AzureSimpleTests.java (94%) rename plugins/discovery-azure-classic/src/{test/java/org => internalClusterTest/java}/elasticsearch/discovery/azure/classic/AzureTwoStartedNodesTests.java (90%) rename plugins/discovery-ec2/qa/amazon-ec2/src/{test => yamlRestTest}/java/org/elasticsearch/discovery/ec2/AmazonEC2DiscoveryClientYamlTestSuiteIT.java (92%) 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%) diff --git a/plugins/analysis-icu/build.gradle b/plugins/analysis-icu/build.gradle index 507156d4fec36..d9bbb58915408 100644 --- a/plugins/analysis-icu/build.gradle +++ b/plugins/analysis-icu/build.gradle @@ -26,7 +26,7 @@ esplugin { classname 'org.elasticsearch.plugin.analysis.icu.AnalysisICUPlugin' } -List forbidden_signatures = new ArrayList([ +List forbidden_signatures = new ArrayList<>([ "com.ibm.icu.text.Collator#getInstance() @ Don't use default locale, use getInstance(ULocale) instead" ]) diff --git a/plugins/discovery-azure-classic/build.gradle b/plugins/discovery-azure-classic/build.gradle index 20a3278a6905e..328726100c810 100644 --- a/plugins/discovery-azure-classic/build.gradle +++ b/plugins/discovery-azure-classic/build.gradle @@ -20,6 +20,7 @@ import org.elasticsearch.gradle.info.BuildParams * under the License. */ 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' @@ -89,9 +90,9 @@ task createKey(type: LoggedExec) { '-keypass', 'keypass', '-storepass', 'keypass' } - +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/elasticsearch/cloud/azure/classic/AbstractAzureComputeServiceTestCase.java similarity index 98% 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/elasticsearch/cloud/azure/classic/AbstractAzureComputeServiceTestCase.java index 5bf825b0cd13c..b763b2bfe7555 100644 --- a/plugins/discovery-azure-classic/src/test/java/org/elasticsearch/cloud/azure/classic/AbstractAzureComputeServiceTestCase.java +++ b/plugins/discovery-azure-classic/src/internalClusterTest/java/elasticsearch/cloud/azure/classic/AbstractAzureComputeServiceTestCase.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 @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.cloud.azure.classic; +package elasticsearch.cloud.azure.classic; import com.microsoft.windowsazure.management.compute.models.DeploymentSlot; import com.microsoft.windowsazure.management.compute.models.DeploymentStatus; 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/elasticsearch/discovery/azure/classic/AzureDiscoveryClusterFormationTests.java similarity index 98% 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/elasticsearch/discovery/azure/classic/AzureDiscoveryClusterFormationTests.java index e723520f5c8b5..7fccbc7745b65 100644 --- a/plugins/discovery-azure-classic/src/test/java/org/elasticsearch/discovery/azure/classic/AzureDiscoveryClusterFormationTests.java +++ b/plugins/discovery-azure-classic/src/internalClusterTest/java/elasticsearch/discovery/azure/classic/AzureDiscoveryClusterFormationTests.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 @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.discovery.azure.classic; +package elasticsearch.discovery.azure.classic; import com.microsoft.windowsazure.management.compute.models.DeploymentSlot; import com.microsoft.windowsazure.management.compute.models.DeploymentStatus; @@ -32,6 +32,7 @@ import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.discovery.DiscoveryModule; +import org.elasticsearch.discovery.azure.classic.AzureSeedHostsProvider; import org.elasticsearch.env.Environment; import org.elasticsearch.mocksocket.MockHttpServer; import org.elasticsearch.node.Node; @@ -72,7 +73,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/elasticsearch/discovery/azure/classic/AzureSimpleTests.java similarity index 94% 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/elasticsearch/discovery/azure/classic/AzureSimpleTests.java index 3c174de172e2a..925dc4ad200df 100644 --- a/plugins/discovery-azure-classic/src/test/java/org/elasticsearch/discovery/azure/classic/AzureSimpleTests.java +++ b/plugins/discovery-azure-classic/src/internalClusterTest/java/elasticsearch/discovery/azure/classic/AzureSimpleTests.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 @@ -17,9 +17,9 @@ * under the License. */ -package org.elasticsearch.discovery.azure.classic; +package elasticsearch.discovery.azure.classic; -import org.elasticsearch.cloud.azure.classic.AbstractAzureComputeServiceTestCase; +import elasticsearch.cloud.azure.classic.AbstractAzureComputeServiceTestCase; import org.elasticsearch.cloud.azure.classic.management.AzureComputeService.Discovery; import org.elasticsearch.cloud.azure.classic.management.AzureComputeService.Management; import org.elasticsearch.common.settings.Settings; 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/elasticsearch/discovery/azure/classic/AzureTwoStartedNodesTests.java similarity index 90% 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/elasticsearch/discovery/azure/classic/AzureTwoStartedNodesTests.java index 79fced1801c15..6ef3972e66286 100644 --- a/plugins/discovery-azure-classic/src/test/java/org/elasticsearch/discovery/azure/classic/AzureTwoStartedNodesTests.java +++ b/plugins/discovery-azure-classic/src/internalClusterTest/java/elasticsearch/discovery/azure/classic/AzureTwoStartedNodesTests.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 @@ -17,12 +17,13 @@ * under the License. */ -package org.elasticsearch.discovery.azure.classic; +package elasticsearch.discovery.azure.classic; -import org.elasticsearch.cloud.azure.classic.AbstractAzureComputeServiceTestCase; +import elasticsearch.cloud.azure.classic.AbstractAzureComputeServiceTestCase; import org.elasticsearch.cloud.azure.classic.management.AzureComputeService.Discovery; import org.elasticsearch.cloud.azure.classic.management.AzureComputeService.Management; import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.discovery.azure.classic.AzureSeedHostsProvider; import org.elasticsearch.test.ESIntegTestCase; @ESIntegTestCase.ClusterScope(scope = ESIntegTestCase.Scope.TEST, diff --git a/plugins/discovery-ec2/qa/amazon-ec2/build.gradle b/plugins/discovery-ec2/qa/amazon-ec2/build.gradle index c7f94ef278b66..1f85a59de9e92 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 compileYamlRestTestJava + 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 92% 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..1894b69a6206d 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 @@ -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 @@ -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/test/java/org/elasticsearch/discovery/ec2/AbstractAwsTestCase.java index aef5bbeb86967..702de9ff40fb5 100644 --- a/plugins/discovery-ec2/src/test/java/org/elasticsearch/discovery/ec2/AbstractAwsTestCase.java +++ b/plugins/discovery-ec2/src/test/java/org/elasticsearch/discovery/ec2/AbstractAwsTestCase.java @@ -39,6 +39,7 @@ * in order to run these tests. */ @ThirdParty +//TODO: move this test case over to an internalClusterTest public abstract class AbstractAwsTestCase extends ESIntegTestCase { @Override From cc095507ad6171aa18f626939ad1c1002eacd214 Mon Sep 17 00:00:00 2001 From: Jake Landis Date: Wed, 22 Jul 2020 11:15:47 -0500 Subject: [PATCH 11/26] finish examples --- plugins/discovery-gce/build.gradle | 1 + plugins/discovery-gce/qa/gce/build.gradle | 18 ++++++++---------- .../gce/GCEDiscoveryClientYamlTestSuiteIT.java | 4 ++-- .../elasticsearch/cloud/gce/GCEFixture.java | 0 .../test/discovery_gce/10_basic.yml | 0 .../discovery/gce/GceDiscoverTests.java | 0 plugins/examples/rest-handler/build.gradle | 12 ++++-------- .../example/resthandler/ExampleFixture.java | 0 .../example/resthandler/ExampleFixtureIT.java | 0 .../security-authorization-engine/build.gradle | 18 ++++++++++++------ .../example/CustomAuthorizationEngineIT.java | 17 ++++++++--------- .../CustomAuthorizationEngineTests.java | 0 12 files changed, 35 insertions(+), 35 deletions(-) rename plugins/discovery-gce/qa/gce/src/{test => yamlRestTest}/java/org/elasticsearch/cloud/gce/GCEDiscoveryClientYamlTestSuiteIT.java (92%) 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/examples/rest-handler/src/{test => javaRestTest}/java/org/elasticsearch/example/resthandler/ExampleFixture.java (100%) rename plugins/examples/rest-handler/src/{test => javaRestTest}/java/org/elasticsearch/example/resthandler/ExampleFixtureIT.java (100%) rename plugins/examples/security-authorization-engine/src/{test => javaRestTest}/java/org/elasticsearch/example/CustomAuthorizationEngineIT.java (89%) rename plugins/examples/security-authorization-engine/src/{test => javaRestTest}/java/org/elasticsearch/example/CustomAuthorizationEngineTests.java (100%) diff --git a/plugins/discovery-gce/build.gradle b/plugins/discovery-gce/build.gradle index db60919dcd151..8f44cccbf6593 100644 --- a/plugins/discovery-gce/build.gradle +++ b/plugins/discovery-gce/build.gradle @@ -1,4 +1,5 @@ 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..e10e5b7648b14 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 compileYamlRestTestJava + 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 92% 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 index 6c1ca9c72d3f8..34bcfd6e21bf2 100644 --- 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 @@ -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 @@ -32,6 +32,6 @@ public GCEDiscoveryClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate t @ParametersFactory public static Iterable parameters() throws Exception { - return ESClientYamlSuiteTestCase.createParameters(); + return createParameters(); } } 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/examples/rest-handler/build.gradle b/plugins/examples/rest-handler/build.gradle index 67c26e7d30aca..1a0e48385ba81 100644 --- a/plugins/examples/rest-handler/build.gradle +++ b/plugins/examples/rest-handler/build.gradle @@ -20,6 +20,7 @@ import org.elasticsearch.gradle.info.BuildParams */ apply plugin: 'elasticsearch.esplugin' apply plugin: 'elasticsearch.yaml-rest-test' +apply plugin: 'elasticsearch.java-rest-test' esplugin { name 'rest-handler' @@ -33,21 +34,16 @@ esplugin { test.enabled = false tasks.register("exampleFixture", org.elasticsearch.gradle.test.AntFixture) { - dependsOn testClasses - env 'CLASSPATH', "${-> project.sourceSets.test.runtimeClasspath.asPath}" + dependsOn javaRestTestClasses + env 'CLASSPATH', "${-> project.sourceSets.javaRestTest.runtimeClasspath.asPath}" executable = "${BuildParams.runtimeJavaHome}/bin/java" args 'org.elasticsearch.example.resthandler.ExampleFixture', baseDir, 'TEST' } -integTest { +javaRestTest { dependsOn exampleFixture runner { nonInputProperties.systemProperty 'external.address', "${-> exampleFixture.addressAndPort}" } } -testingConventions.naming { - IT { - baseClass 'org.elasticsearch.test.ESTestCase' - } -} diff --git a/plugins/examples/rest-handler/src/test/java/org/elasticsearch/example/resthandler/ExampleFixture.java b/plugins/examples/rest-handler/src/javaRestTest/java/org/elasticsearch/example/resthandler/ExampleFixture.java similarity index 100% rename from plugins/examples/rest-handler/src/test/java/org/elasticsearch/example/resthandler/ExampleFixture.java rename to plugins/examples/rest-handler/src/javaRestTest/java/org/elasticsearch/example/resthandler/ExampleFixture.java diff --git a/plugins/examples/rest-handler/src/test/java/org/elasticsearch/example/resthandler/ExampleFixtureIT.java b/plugins/examples/rest-handler/src/javaRestTest/java/org/elasticsearch/example/resthandler/ExampleFixtureIT.java similarity index 100% rename from plugins/examples/rest-handler/src/test/java/org/elasticsearch/example/resthandler/ExampleFixtureIT.java rename to plugins/examples/rest-handler/src/javaRestTest/java/org/elasticsearch/example/resthandler/ExampleFixtureIT.java diff --git a/plugins/examples/security-authorization-engine/build.gradle b/plugins/examples/security-authorization-engine/build.gradle index 15233bc872f4e..c68e128625fa1 100644 --- a/plugins/examples/security-authorization-engine/build.gradle +++ b/plugins/examples/security-authorization-engine/build.gradle @@ -1,5 +1,7 @@ -apply plugin: 'elasticsearch.testclusters' apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.java-rest-test' + +import org.elasticsearch.gradle.util.GradleUtils esplugin { name 'security-authorization-engine' @@ -10,19 +12,24 @@ esplugin { noticeFile rootProject.file('NOTICE.txt') } +// let the javaRestTest see the classpath of main +GradleUtils.extendSourceSet(project, "main", "javaRestTest") + dependencies { compileOnly "org.elasticsearch.plugin:x-pack-core:${versions.elasticsearch}" - testImplementation "org.elasticsearch.client:elasticsearch-rest-high-level-client:${versions.elasticsearch}" + javaRestTestImplementation "org.elasticsearch.plugin:x-pack-core:${versions.elasticsearch}" + javaRestTestImplementation "org.elasticsearch.client:elasticsearch-rest-high-level-client:${versions.elasticsearch}" } - -integTest { +//no unit tests +test.enabled = false +javaRestTest { dependsOn buildZip runner { systemProperty 'tests.security.manager', 'false' } } -testClusters.integTest { +testClusters.javaRestTest { setting 'xpack.security.enabled', 'true' setting 'xpack.ml.enabled', 'false' setting 'xpack.license.self_generated.type', 'trial' @@ -35,4 +42,3 @@ testClusters.integTest { user role: 'custom_superuser' } -check.dependsOn integTest diff --git a/plugins/examples/security-authorization-engine/src/test/java/org/elasticsearch/example/CustomAuthorizationEngineIT.java b/plugins/examples/security-authorization-engine/src/javaRestTest/java/org/elasticsearch/example/CustomAuthorizationEngineIT.java similarity index 89% rename from plugins/examples/security-authorization-engine/src/test/java/org/elasticsearch/example/CustomAuthorizationEngineIT.java rename to plugins/examples/security-authorization-engine/src/javaRestTest/java/org/elasticsearch/example/CustomAuthorizationEngineIT.java index 4342b2a4b88f0..9c08993ae7f11 100644 --- a/plugins/examples/security-authorization-engine/src/test/java/org/elasticsearch/example/CustomAuthorizationEngineIT.java +++ b/plugins/examples/security-authorization-engine/src/javaRestTest/java/org/elasticsearch/example/CustomAuthorizationEngineIT.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 @@ -40,7 +40,6 @@ import java.util.Collections; import java.util.List; -import static org.elasticsearch.xpack.core.security.authc.support.UsernamePasswordToken.basicAuthHeaderValue; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.is; @@ -68,7 +67,7 @@ public void testClusterAction() throws IOException { { RequestOptions.Builder options = RequestOptions.DEFAULT.toBuilder(); options.addHeader(UsernamePasswordToken.BASIC_AUTH_HEADER, - basicAuthHeaderValue("custom_user", new SecureString("x-pack-test-password".toCharArray()))); + UsernamePasswordToken.basicAuthHeaderValue("custom_user", new SecureString("x-pack-test-password".toCharArray()))); Request request = new Request("GET", "_cluster/health"); request.setOptions(options); Response response = client().performRequest(request); @@ -80,7 +79,7 @@ public void testClusterAction() throws IOException { "x-pack-test-password".toCharArray(), true, RefreshPolicy.IMMEDIATE), RequestOptions.DEFAULT); RequestOptions.Builder options = RequestOptions.DEFAULT.toBuilder(); options.addHeader(UsernamePasswordToken.BASIC_AUTH_HEADER, - basicAuthHeaderValue("custom_user2", new SecureString("x-pack-test-password".toCharArray()))); + UsernamePasswordToken.basicAuthHeaderValue("custom_user2", new SecureString("x-pack-test-password".toCharArray()))); Request request = new Request("GET", "_cluster/health"); request.setOptions(options); ResponseException e = expectThrows(ResponseException.class, () -> client().performRequest(request)); @@ -96,7 +95,7 @@ public void testIndexAction() throws IOException { { RequestOptions.Builder options = RequestOptions.DEFAULT.toBuilder(); options.addHeader(UsernamePasswordToken.BASIC_AUTH_HEADER, - basicAuthHeaderValue("custom_user", new SecureString("x-pack-test-password".toCharArray()))); + UsernamePasswordToken.basicAuthHeaderValue("custom_user", new SecureString("x-pack-test-password".toCharArray()))); Request request = new Request("PUT", "/index"); request.setOptions(options); Response response = client().performRequest(request); @@ -108,7 +107,7 @@ public void testIndexAction() throws IOException { "x-pack-test-password".toCharArray(), true, RefreshPolicy.IMMEDIATE), RequestOptions.DEFAULT); RequestOptions.Builder options = RequestOptions.DEFAULT.toBuilder(); options.addHeader(UsernamePasswordToken.BASIC_AUTH_HEADER, - basicAuthHeaderValue("custom_user2", new SecureString("x-pack-test-password".toCharArray()))); + UsernamePasswordToken.basicAuthHeaderValue("custom_user2", new SecureString("x-pack-test-password".toCharArray()))); Request request = new Request("PUT", "/index"); request.setOptions(options); ResponseException e = expectThrows(ResponseException.class, () -> client().performRequest(request)); @@ -128,7 +127,7 @@ public void testRunAs() throws IOException { { RequestOptions.Builder options = RequestOptions.DEFAULT.toBuilder(); options.addHeader(UsernamePasswordToken.BASIC_AUTH_HEADER, - basicAuthHeaderValue("custom_user", new SecureString("x-pack-test-password".toCharArray()))); + UsernamePasswordToken.basicAuthHeaderValue("custom_user", new SecureString("x-pack-test-password".toCharArray()))); options.addHeader("es-security-runas-user", "custom_user2"); Request request = new Request("GET", "/_security/_authenticate"); request.setOptions(options); @@ -141,7 +140,7 @@ public void testRunAs() throws IOException { { RequestOptions.Builder options = RequestOptions.DEFAULT.toBuilder(); options.addHeader(UsernamePasswordToken.BASIC_AUTH_HEADER, - basicAuthHeaderValue("custom_user", new SecureString("x-pack-test-password".toCharArray()))); + UsernamePasswordToken.basicAuthHeaderValue("custom_user", new SecureString("x-pack-test-password".toCharArray()))); options.addHeader("es-security-runas-user", "custom_user3"); Request request = new Request("PUT", "/index"); request.setOptions(options); @@ -152,7 +151,7 @@ public void testRunAs() throws IOException { { RequestOptions.Builder options = RequestOptions.DEFAULT.toBuilder(); options.addHeader(UsernamePasswordToken.BASIC_AUTH_HEADER, - basicAuthHeaderValue("custom_user3", new SecureString("x-pack-test-password".toCharArray()))); + UsernamePasswordToken.basicAuthHeaderValue("custom_user3", new SecureString("x-pack-test-password".toCharArray()))); options.addHeader("es-security-runas-user", "custom_user2"); Request request = new Request("PUT", "/index"); request.setOptions(options); diff --git a/plugins/examples/security-authorization-engine/src/test/java/org/elasticsearch/example/CustomAuthorizationEngineTests.java b/plugins/examples/security-authorization-engine/src/javaRestTest/java/org/elasticsearch/example/CustomAuthorizationEngineTests.java similarity index 100% rename from plugins/examples/security-authorization-engine/src/test/java/org/elasticsearch/example/CustomAuthorizationEngineTests.java rename to plugins/examples/security-authorization-engine/src/javaRestTest/java/org/elasticsearch/example/CustomAuthorizationEngineTests.java From cd76cf49743da978d4576ef858e164cd14779c01 Mon Sep 17 00:00:00 2001 From: Jake Landis Date: Wed, 22 Jul 2020 11:28:18 -0500 Subject: [PATCH 12/26] more --- plugins/mapper-annotated-text/build.gradle | 1 + .../mapper/annotatedtext/AnnotatedTextFieldMapperTests.java | 0 plugins/mapper-murmur3/build.gradle | 3 +++ .../index/mapper/murmur3/Murmur3FieldMapperTests.java | 0 plugins/mapper-size/build.gradle | 3 +++ .../org/elasticsearch/index/mapper/size/SizeMappingIT.java | 0 .../org/elasticsearch/index/mapper/size/SizeMappingTests.java | 0 7 files changed, 7 insertions(+) rename plugins/mapper-annotated-text/src/{test => internalClusterTest}/java/org/elasticsearch/index/mapper/annotatedtext/AnnotatedTextFieldMapperTests.java (100%) rename plugins/mapper-murmur3/src/{test => internalClusterTest}/java/org/elasticsearch/index/mapper/murmur3/Murmur3FieldMapperTests.java (100%) rename plugins/mapper-size/src/{test => internalClusterTest}/java/org/elasticsearch/index/mapper/size/SizeMappingIT.java (100%) rename plugins/mapper-size/src/{test => internalClusterTest}/java/org/elasticsearch/index/mapper/size/SizeMappingTests.java (100%) diff --git a/plugins/mapper-annotated-text/build.gradle b/plugins/mapper-annotated-text/build.gradle index 7a5305a107ddc..253b6c4a62ab9 100644 --- a/plugins/mapper-annotated-text/build.gradle +++ b/plugins/mapper-annotated-text/build.gradle @@ -17,6 +17,7 @@ * under the License. */ apply plugin: 'elasticsearch.yaml-rest-test' +apply plugin: 'elasticsearch.internal-cluster-test' esplugin { description 'The Mapper Annotated_text plugin adds support for text fields with markup used to inject annotation tokens into the index.' diff --git a/plugins/mapper-annotated-text/src/test/java/org/elasticsearch/index/mapper/annotatedtext/AnnotatedTextFieldMapperTests.java b/plugins/mapper-annotated-text/src/internalClusterTest/java/org/elasticsearch/index/mapper/annotatedtext/AnnotatedTextFieldMapperTests.java similarity index 100% rename from plugins/mapper-annotated-text/src/test/java/org/elasticsearch/index/mapper/annotatedtext/AnnotatedTextFieldMapperTests.java rename to plugins/mapper-annotated-text/src/internalClusterTest/java/org/elasticsearch/index/mapper/annotatedtext/AnnotatedTextFieldMapperTests.java diff --git a/plugins/mapper-murmur3/build.gradle b/plugins/mapper-murmur3/build.gradle index 3d8c94695912e..4eae185482028 100644 --- a/plugins/mapper-murmur3/build.gradle +++ b/plugins/mapper-murmur3/build.gradle @@ -17,6 +17,7 @@ * under the License. */ apply plugin: 'elasticsearch.yaml-rest-test' +apply plugin: 'elasticsearch.internal-cluster-test' esplugin { description 'The Mapper Murmur3 plugin allows to compute hashes of a field\'s values at index-time and to store them in the index.' @@ -28,3 +29,5 @@ restResources { includeCore '_common', 'indices', 'index', 'search' } } +// no unit tests +test.enabled = false diff --git a/plugins/mapper-murmur3/src/test/java/org/elasticsearch/index/mapper/murmur3/Murmur3FieldMapperTests.java b/plugins/mapper-murmur3/src/internalClusterTest/java/org/elasticsearch/index/mapper/murmur3/Murmur3FieldMapperTests.java similarity index 100% rename from plugins/mapper-murmur3/src/test/java/org/elasticsearch/index/mapper/murmur3/Murmur3FieldMapperTests.java rename to plugins/mapper-murmur3/src/internalClusterTest/java/org/elasticsearch/index/mapper/murmur3/Murmur3FieldMapperTests.java diff --git a/plugins/mapper-size/build.gradle b/plugins/mapper-size/build.gradle index 1732c10aa7c9e..3f383179ad187 100644 --- a/plugins/mapper-size/build.gradle +++ b/plugins/mapper-size/build.gradle @@ -17,6 +17,7 @@ * under the License. */ apply plugin: 'elasticsearch.yaml-rest-test' +apply plugin: 'elasticsearch.internal-cluster-test' esplugin { description 'The Mapper Size plugin allows document to record their uncompressed size at index time.' @@ -28,3 +29,5 @@ restResources { includeCore '_common', 'indices', 'index', 'get' } } +// no unit tests +test.enabled = false diff --git a/plugins/mapper-size/src/test/java/org/elasticsearch/index/mapper/size/SizeMappingIT.java b/plugins/mapper-size/src/internalClusterTest/java/org/elasticsearch/index/mapper/size/SizeMappingIT.java similarity index 100% rename from plugins/mapper-size/src/test/java/org/elasticsearch/index/mapper/size/SizeMappingIT.java rename to plugins/mapper-size/src/internalClusterTest/java/org/elasticsearch/index/mapper/size/SizeMappingIT.java diff --git a/plugins/mapper-size/src/test/java/org/elasticsearch/index/mapper/size/SizeMappingTests.java b/plugins/mapper-size/src/internalClusterTest/java/org/elasticsearch/index/mapper/size/SizeMappingTests.java similarity index 100% rename from plugins/mapper-size/src/test/java/org/elasticsearch/index/mapper/size/SizeMappingTests.java rename to plugins/mapper-size/src/internalClusterTest/java/org/elasticsearch/index/mapper/size/SizeMappingTests.java From 4a2d639bec119eafec0a8fe83d72191d372e1f99 Mon Sep 17 00:00:00 2001 From: Jake Landis Date: Wed, 22 Jul 2020 11:44:13 -0500 Subject: [PATCH 13/26] repository-azure --- plugins/repository-azure/build.gradle | 16 +++++++++++----- .../azure/AzureBlobStoreRepositoryTests.java | 0 .../AzureStorageCleanupThirdPartyTests.java | 0 .../RepositoryAzureClientYamlTestSuiteIT.java | 0 .../test/repository_azure/10_basic.yml | 0 .../test/repository_azure/20_repository.yml | 0 6 files changed, 11 insertions(+), 5 deletions(-) rename plugins/repository-azure/src/{test => internalClusterTest}/java/org/elasticsearch/repositories/azure/AzureBlobStoreRepositoryTests.java (100%) rename plugins/repository-azure/src/{test => internalClusterTest}/java/org/elasticsearch/repositories/azure/AzureStorageCleanupThirdPartyTests.java (100%) rename plugins/repository-azure/src/{test => yamlRestTest}/java/org/elasticsearch/repositories/azure/RepositoryAzureClientYamlTestSuiteIT.java (100%) rename plugins/repository-azure/src/{test => yamlRestTest}/resources/rest-api-spec/test/repository_azure/10_basic.yml (100%) rename plugins/repository-azure/src/{test => yamlRestTest}/resources/rest-api-spec/test/repository_azure/20_repository.yml (100%) diff --git a/plugins/repository-azure/build.gradle b/plugins/repository-azure/build.gradle index 723a4c1e0753a..6cfae235d0ab5 100644 --- a/plugins/repository-azure/build.gradle +++ b/plugins/repository-azure/build.gradle @@ -1,5 +1,6 @@ import org.elasticsearch.gradle.MavenFilteringHack import org.elasticsearch.gradle.info.BuildParams +import org.elasticsearch.gradle.test.InternalClusterTestPlugin import static org.elasticsearch.gradle.PropertyNormalization.DEFAULT import static org.elasticsearch.gradle.PropertyNormalization.IGNORE_VALUE @@ -22,7 +23,8 @@ import static org.elasticsearch.gradle.PropertyNormalization.IGNORE_VALUE * 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 Repository plugin adds support for Azure storage repositories.' @@ -106,18 +108,18 @@ Map expansions = [ 'base_path': azureBasePath + "_integration_tests" ] -processTestResources { +processYamlRestTestResources { inputs.properties(expansions) MavenFilteringHack.filter(it, expansions) } -test { +internalClusterTest { // this is tested explicitly in a separate test task exclude '**/AzureStorageCleanupThirdPartyTests.class' } testClusters { - integTest { + yamlRestTest { keystore 'azure.client.integration_test.account', azureAccount if (azureKey != null && azureKey.isEmpty() == false) { keystore 'azure.client.integration_test.key', azureKey @@ -134,7 +136,11 @@ testClusters { } task azureThirdPartyTest(type: Test) { - dependsOn tasks.integTest + SourceSetContainer sourceSets = project.getExtensions().getByType(SourceSetContainer.class); + SourceSet internalTestSourceSet = sourceSets.getByName(InternalClusterTestPlugin.SOURCE_SET_NAME) + setTestClassesDirs(internalTestSourceSet.getOutput().getClassesDirs()) + dependsOn tasks.internalClusterTest + setClasspath(internalTestSourceSet.getRuntimeClasspath()) include '**/AzureStorageCleanupThirdPartyTests.class' systemProperty 'test.azure.account', azureAccount ? azureAccount : "" systemProperty 'test.azure.key', azureKey ? azureKey : "" diff --git a/plugins/repository-azure/src/test/java/org/elasticsearch/repositories/azure/AzureBlobStoreRepositoryTests.java b/plugins/repository-azure/src/internalClusterTest/java/org/elasticsearch/repositories/azure/AzureBlobStoreRepositoryTests.java similarity index 100% rename from plugins/repository-azure/src/test/java/org/elasticsearch/repositories/azure/AzureBlobStoreRepositoryTests.java rename to plugins/repository-azure/src/internalClusterTest/java/org/elasticsearch/repositories/azure/AzureBlobStoreRepositoryTests.java diff --git a/plugins/repository-azure/src/test/java/org/elasticsearch/repositories/azure/AzureStorageCleanupThirdPartyTests.java b/plugins/repository-azure/src/internalClusterTest/java/org/elasticsearch/repositories/azure/AzureStorageCleanupThirdPartyTests.java similarity index 100% rename from plugins/repository-azure/src/test/java/org/elasticsearch/repositories/azure/AzureStorageCleanupThirdPartyTests.java rename to plugins/repository-azure/src/internalClusterTest/java/org/elasticsearch/repositories/azure/AzureStorageCleanupThirdPartyTests.java diff --git a/plugins/repository-azure/src/test/java/org/elasticsearch/repositories/azure/RepositoryAzureClientYamlTestSuiteIT.java b/plugins/repository-azure/src/yamlRestTest/java/org/elasticsearch/repositories/azure/RepositoryAzureClientYamlTestSuiteIT.java similarity index 100% rename from plugins/repository-azure/src/test/java/org/elasticsearch/repositories/azure/RepositoryAzureClientYamlTestSuiteIT.java rename to plugins/repository-azure/src/yamlRestTest/java/org/elasticsearch/repositories/azure/RepositoryAzureClientYamlTestSuiteIT.java diff --git a/plugins/repository-azure/src/test/resources/rest-api-spec/test/repository_azure/10_basic.yml b/plugins/repository-azure/src/yamlRestTest/resources/rest-api-spec/test/repository_azure/10_basic.yml similarity index 100% rename from plugins/repository-azure/src/test/resources/rest-api-spec/test/repository_azure/10_basic.yml rename to plugins/repository-azure/src/yamlRestTest/resources/rest-api-spec/test/repository_azure/10_basic.yml diff --git a/plugins/repository-azure/src/test/resources/rest-api-spec/test/repository_azure/20_repository.yml b/plugins/repository-azure/src/yamlRestTest/resources/rest-api-spec/test/repository_azure/20_repository.yml similarity index 100% rename from plugins/repository-azure/src/test/resources/rest-api-spec/test/repository_azure/20_repository.yml rename to plugins/repository-azure/src/yamlRestTest/resources/rest-api-spec/test/repository_azure/20_repository.yml From 8682017cb5b923327864e53fe781bd7024b4e870 Mon Sep 17 00:00:00 2001 From: Jake Landis Date: Wed, 22 Jul 2020 12:09:39 -0500 Subject: [PATCH 14/26] repository-gcs --- plugins/repository-azure/build.gradle | 2 +- plugins/repository-gcs/build.gradle | 36 ++++++++++++------- ...eCloudStorageBlobStoreRepositoryTests.java | 0 .../GoogleCloudStorageThirdPartyTests.java | 0 .../RepositoryGcsClientYamlTestSuiteIT.java | 0 .../test/repository_gcs/10_basic.yml | 0 .../test/repository_gcs/20_repository.yml | 0 7 files changed, 25 insertions(+), 13 deletions(-) rename plugins/repository-gcs/src/{test => internalClusterTest}/java/org/elasticsearch/repositories/gcs/GoogleCloudStorageBlobStoreRepositoryTests.java (100%) rename plugins/repository-gcs/src/{test => internalClusterTest}/java/org/elasticsearch/repositories/gcs/GoogleCloudStorageThirdPartyTests.java (100%) rename plugins/repository-gcs/src/{test => yamlRestTest}/java/org/elasticsearch/repositories/gcs/RepositoryGcsClientYamlTestSuiteIT.java (100%) rename plugins/repository-gcs/src/{test => yamlRestTest}/resources/rest-api-spec/test/repository_gcs/10_basic.yml (100%) rename plugins/repository-gcs/src/{test => yamlRestTest}/resources/rest-api-spec/test/repository_gcs/20_repository.yml (100%) diff --git a/plugins/repository-azure/build.gradle b/plugins/repository-azure/build.gradle index 6cfae235d0ab5..308e4ab59bf42 100644 --- a/plugins/repository-azure/build.gradle +++ b/plugins/repository-azure/build.gradle @@ -139,8 +139,8 @@ task azureThirdPartyTest(type: Test) { SourceSetContainer sourceSets = project.getExtensions().getByType(SourceSetContainer.class); SourceSet internalTestSourceSet = sourceSets.getByName(InternalClusterTestPlugin.SOURCE_SET_NAME) setTestClassesDirs(internalTestSourceSet.getOutput().getClassesDirs()) - dependsOn tasks.internalClusterTest setClasspath(internalTestSourceSet.getRuntimeClasspath()) + dependsOn tasks.internalClusterTest include '**/AzureStorageCleanupThirdPartyTests.class' systemProperty 'test.azure.account', azureAccount ? azureAccount : "" systemProperty 'test.azure.key', azureKey ? azureKey : "" diff --git a/plugins/repository-gcs/build.gradle b/plugins/repository-gcs/build.gradle index 5a60f96d8abbd..7b6ff4be342b0 100644 --- a/plugins/repository-gcs/build.gradle +++ b/plugins/repository-gcs/build.gradle @@ -4,6 +4,8 @@ import java.security.KeyPairGenerator import org.elasticsearch.gradle.MavenFilteringHack import org.elasticsearch.gradle.info.BuildParams import org.elasticsearch.gradle.test.RestIntegTestTask +import org.elasticsearch.gradle.test.rest.YamlRestTestPlugin +import org.elasticsearch.gradle.test.InternalClusterTestPlugin import java.nio.file.Files import java.security.KeyPair @@ -28,7 +30,8 @@ import static org.elasticsearch.gradle.PropertyNormalization.IGNORE_VALUE * 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 GCS repository plugin adds Google Cloud Storage support for repositories.' @@ -254,12 +257,12 @@ Map expansions = [ 'base_path': gcsBasePath + "_integration_tests" ] -processTestResources { +processYamlRestTestResources { inputs.properties(expansions) MavenFilteringHack.filter(it, expansions) } -test { +internalClusterTest { // this is tested explicitly in a separate test task exclude '**/GoogleCloudStorageThirdPartyTests.class' } @@ -276,33 +279,39 @@ final Closure testClustersConfiguration = { } } -integTest { +yamlRestTest { if (useFixture) { dependsOn createServiceAccountFile } } -check.dependsOn integTest testClusters { - integTest testClustersConfiguration + all testClustersConfiguration } /* * We only use a small amount of data in these tests, which means that the resumable upload path is not tested. We add * an additional test that forces the large blob threshold to be small to exercise the resumable upload path. */ -task largeBlobIntegTest(type: RestIntegTestTask) { - mustRunAfter integTest +task largeBlobYamlRestTest(type: RestIntegTestTask) { + mustRunAfter yamlRestTest dependsOn project(':plugins:repository-gcs').bundlePlugin if (useFixture) { dependsOn createServiceAccountFile } } -check.dependsOn largeBlobIntegTest +largeBlobYamlRestTest { + runner { + SourceSetContainer sourceSets = project.getExtensions().getByType(SourceSetContainer.class); + SourceSet yamlRestTestSourceSet = sourceSets.getByName(YamlRestTestPlugin.SOURCE_SET_NAME) + setTestClassesDirs(yamlRestTestSourceSet.getOutput().getClassesDirs()) + setClasspath(yamlRestTestSourceSet.getRuntimeClasspath()) + } +} +check.dependsOn largeBlobYamlRestTest -testClusters.largeBlobIntegTest testClustersConfiguration testClusters { - largeBlobIntegTest { + largeBlobYamlRestTest { plugin project(':plugins:repository-gcs').bundlePlugin.archiveFile // force large blob uploads by setting the threshold small, forcing this code path to be tested @@ -311,7 +320,10 @@ testClusters { } task gcsThirdPartyTest(type: Test) { - dependsOn integTest,largeBlobIntegTest + SourceSetContainer sourceSets = project.getExtensions().getByType(SourceSetContainer.class); + SourceSet internalTestSourceSet = sourceSets.getByName(InternalClusterTestPlugin.SOURCE_SET_NAME) + setTestClassesDirs(internalTestSourceSet.getOutput().getClassesDirs()) + setClasspath(internalTestSourceSet.getRuntimeClasspath()) include '**/GoogleCloudStorageThirdPartyTests.class' systemProperty 'tests.security.manager', false systemProperty 'test.google.bucket', gcsBucket diff --git a/plugins/repository-gcs/src/test/java/org/elasticsearch/repositories/gcs/GoogleCloudStorageBlobStoreRepositoryTests.java b/plugins/repository-gcs/src/internalClusterTest/java/org/elasticsearch/repositories/gcs/GoogleCloudStorageBlobStoreRepositoryTests.java similarity index 100% rename from plugins/repository-gcs/src/test/java/org/elasticsearch/repositories/gcs/GoogleCloudStorageBlobStoreRepositoryTests.java rename to plugins/repository-gcs/src/internalClusterTest/java/org/elasticsearch/repositories/gcs/GoogleCloudStorageBlobStoreRepositoryTests.java diff --git a/plugins/repository-gcs/src/test/java/org/elasticsearch/repositories/gcs/GoogleCloudStorageThirdPartyTests.java b/plugins/repository-gcs/src/internalClusterTest/java/org/elasticsearch/repositories/gcs/GoogleCloudStorageThirdPartyTests.java similarity index 100% rename from plugins/repository-gcs/src/test/java/org/elasticsearch/repositories/gcs/GoogleCloudStorageThirdPartyTests.java rename to plugins/repository-gcs/src/internalClusterTest/java/org/elasticsearch/repositories/gcs/GoogleCloudStorageThirdPartyTests.java diff --git a/plugins/repository-gcs/src/test/java/org/elasticsearch/repositories/gcs/RepositoryGcsClientYamlTestSuiteIT.java b/plugins/repository-gcs/src/yamlRestTest/java/org/elasticsearch/repositories/gcs/RepositoryGcsClientYamlTestSuiteIT.java similarity index 100% rename from plugins/repository-gcs/src/test/java/org/elasticsearch/repositories/gcs/RepositoryGcsClientYamlTestSuiteIT.java rename to plugins/repository-gcs/src/yamlRestTest/java/org/elasticsearch/repositories/gcs/RepositoryGcsClientYamlTestSuiteIT.java diff --git a/plugins/repository-gcs/src/test/resources/rest-api-spec/test/repository_gcs/10_basic.yml b/plugins/repository-gcs/src/yamlRestTest/resources/rest-api-spec/test/repository_gcs/10_basic.yml similarity index 100% rename from plugins/repository-gcs/src/test/resources/rest-api-spec/test/repository_gcs/10_basic.yml rename to plugins/repository-gcs/src/yamlRestTest/resources/rest-api-spec/test/repository_gcs/10_basic.yml diff --git a/plugins/repository-gcs/src/test/resources/rest-api-spec/test/repository_gcs/20_repository.yml b/plugins/repository-gcs/src/yamlRestTest/resources/rest-api-spec/test/repository_gcs/20_repository.yml similarity index 100% rename from plugins/repository-gcs/src/test/resources/rest-api-spec/test/repository_gcs/20_repository.yml rename to plugins/repository-gcs/src/yamlRestTest/resources/rest-api-spec/test/repository_gcs/20_repository.yml From 4a1d8c865159caafb08e44721f3a9682d2fda477 Mon Sep 17 00:00:00 2001 From: Jake Landis Date: Wed, 22 Jul 2020 13:37:09 -0500 Subject: [PATCH 15/26] repository-s3 --- plugins/repository-gcs/build.gradle | 5 +-- plugins/repository-s3/build.gradle | 45 +++++++++++++------ .../s3/S3BlobStoreRepositoryTests.java | 3 +- .../s3/S3RepositoryThirdPartyTests.java | 0 .../s3/RepositoryS3ClientYamlTestSuiteIT.java | 0 .../test/repository_s3/10_basic.yml | 0 .../20_repository_permanent_credentials.yml | 0 .../30_repository_temporary_credentials.yml | 0 .../40_repository_ec2_credentials.yml | 0 .../50_repository_ecs_credentials.yml | 0 10 files changed, 35 insertions(+), 18 deletions(-) rename plugins/repository-s3/src/{test => internalClusterTest}/java/org/elasticsearch/repositories/s3/S3BlobStoreRepositoryTests.java (99%) rename plugins/repository-s3/src/{test => internalClusterTest}/java/org/elasticsearch/repositories/s3/S3RepositoryThirdPartyTests.java (100%) rename plugins/repository-s3/src/{test => yamlRestTest}/java/org/elasticsearch/repositories/s3/RepositoryS3ClientYamlTestSuiteIT.java (100%) rename plugins/repository-s3/src/{test => yamlRestTest}/resources/rest-api-spec/test/repository_s3/10_basic.yml (100%) rename plugins/repository-s3/src/{test => yamlRestTest}/resources/rest-api-spec/test/repository_s3/20_repository_permanent_credentials.yml (100%) rename plugins/repository-s3/src/{test => yamlRestTest}/resources/rest-api-spec/test/repository_s3/30_repository_temporary_credentials.yml (100%) rename plugins/repository-s3/src/{test => yamlRestTest}/resources/rest-api-spec/test/repository_s3/40_repository_ec2_credentials.yml (100%) rename plugins/repository-s3/src/{test => yamlRestTest}/resources/rest-api-spec/test/repository_s3/50_repository_ecs_credentials.yml (100%) diff --git a/plugins/repository-gcs/build.gradle b/plugins/repository-gcs/build.gradle index 7b6ff4be342b0..24a9185c5c218 100644 --- a/plugins/repository-gcs/build.gradle +++ b/plugins/repository-gcs/build.gradle @@ -294,13 +294,11 @@ testClusters { * an additional test that forces the large blob threshold to be small to exercise the resumable upload path. */ task largeBlobYamlRestTest(type: RestIntegTestTask) { - mustRunAfter yamlRestTest + mustRunAfter yamlRestTest //to allow maven style filtering dependsOn project(':plugins:repository-gcs').bundlePlugin if (useFixture) { dependsOn createServiceAccountFile } -} -largeBlobYamlRestTest { runner { SourceSetContainer sourceSets = project.getExtensions().getByType(SourceSetContainer.class); SourceSet yamlRestTestSourceSet = sourceSets.getByName(YamlRestTestPlugin.SOURCE_SET_NAME) @@ -308,6 +306,7 @@ largeBlobYamlRestTest { setClasspath(yamlRestTestSourceSet.getRuntimeClasspath()) } } + check.dependsOn largeBlobYamlRestTest testClusters { diff --git a/plugins/repository-s3/build.gradle b/plugins/repository-s3/build.gradle index 38362209228e6..007b4df77aa5a 100644 --- a/plugins/repository-s3/build.gradle +++ b/plugins/repository-s3/build.gradle @@ -1,6 +1,8 @@ import org.elasticsearch.gradle.MavenFilteringHack import org.elasticsearch.gradle.info.BuildParams import org.elasticsearch.gradle.test.RestIntegTestTask +import org.elasticsearch.gradle.test.rest.YamlRestTestPlugin +import org.elasticsearch.gradle.test.InternalClusterTestPlugin import static org.elasticsearch.gradle.PropertyNormalization.IGNORE_VALUE @@ -22,7 +24,8 @@ import static org.elasticsearch.gradle.PropertyNormalization.IGNORE_VALUE * 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 S3 repository plugin adds S3 repositories' @@ -135,7 +138,7 @@ if (!s3EC2Bucket && !s3EC2BasePath && !s3ECSBucket && !s3ECSBasePath) { throw new IllegalArgumentException("not all options specified to run EC2/ECS tests are present") } -processTestResources { +processYamlRestTestResources { Map expansions = [ 'permanent_bucket' : s3PermanentBucket, 'permanent_base_path' : s3PermanentBasePath + "_integration_tests", @@ -151,13 +154,12 @@ processTestResources { MavenFilteringHack.filter(it, expansions) } -test { +internalClusterTest { // this is tested explicitly in a separate test task exclude '**/S3RepositoryThirdPartyTests.class' } -// IntegTest -integTest { +yamlRestTest { runner { systemProperty 'tests.rest.blacklist', ( useFixture ? @@ -172,7 +174,7 @@ integTest { } } -testClusters.integTest { +testClusters.yamlRestTest { keystore 's3.client.integration_test_permanent.access_key', s3PermanentAccessKey keystore 's3.client.integration_test_permanent.secret_key', s3PermanentSecretKey @@ -207,10 +209,16 @@ testClusters.integTest { if (useFixture) { testFixtures.useFixture(':test:fixtures:minio-fixture', 'minio-fixture') - task integTestMinio(type: RestIntegTestTask) { + task yamlRestTestMinio(type: RestIntegTestTask) { + mustRunAfter 'yamlRestTest' //to allow maven style filtering description = "Runs REST tests using the Minio repository." dependsOn tasks.bundlePlugin runner { + SourceSetContainer sourceSets = project.getExtensions().getByType(SourceSetContainer.class); + SourceSet yamlRestTestSourceSet = sourceSets.getByName(YamlRestTestPlugin.SOURCE_SET_NAME) + setTestClassesDirs(yamlRestTestSourceSet.getOutput().getClassesDirs()) + setClasspath(yamlRestTestSourceSet.getRuntimeClasspath()) + // Minio only supports a single access key, see https://github.com/minio/minio/pull/5968 systemProperty 'tests.rest.blacklist', [ 'repository_s3/30_repository_temporary_credentials/*', @@ -219,9 +227,9 @@ if (useFixture) { ].join(",") } } - check.dependsOn(integTestMinio) + check.dependsOn(yamlRestTestMinio) - testClusters.integTestMinio { + testClusters.yamlRestTestMinio { keystore 's3.client.integration_test_permanent.access_key', s3PermanentAccessKey keystore 's3.client.integration_test_permanent.secret_key', s3PermanentSecretKey setting 's3.client.integration_test_permanent.endpoint', { "${-> fixtureAddress('minio-fixture', 'minio-fixture', '9000')}" }, IGNORE_VALUE @@ -233,10 +241,15 @@ if (useFixture) { if (useFixture) { testFixtures.useFixture(':test:fixtures:s3-fixture', 's3-fixture-with-ecs') - task integTestECS(type: RestIntegTestTask.class) { + task yamlRestTestECS(type: RestIntegTestTask.class) { + mustRunAfter 'yamlRestTest' //to allow maven style filtering description = "Runs tests using the ECS repository." dependsOn('bundlePlugin') runner { + SourceSetContainer sourceSets = project.getExtensions().getByType(SourceSetContainer.class); + SourceSet yamlRestTestSourceSet = sourceSets.getByName(YamlRestTestPlugin.SOURCE_SET_NAME) + setTestClassesDirs(yamlRestTestSourceSet.getOutput().getClassesDirs()) + setClasspath(yamlRestTestSourceSet.getRuntimeClasspath()) systemProperty 'tests.rest.blacklist', [ 'repository_s3/10_basic/*', 'repository_s3/20_repository_permanent_credentials/*', @@ -245,9 +258,9 @@ if (useFixture) { ].join(",") } } - check.dependsOn(integTestECS) + check.dependsOn(yamlRestTestECS) - testClusters.integTestECS { + testClusters.yamlRestTestECS { setting 's3.client.integration_test_ecs.endpoint', { "${-> fixtureAddress('s3-fixture', 's3-fixture-with-ecs', '80')}" }, IGNORE_VALUE plugin tasks.bundlePlugin.archiveFile environment 'AWS_CONTAINER_CREDENTIALS_FULL_URI', { "${-> fixtureAddress('s3-fixture', 's3-fixture-with-ecs', '80')}/ecs_credentials_endpoint" }, IGNORE_VALUE @@ -256,16 +269,20 @@ if (useFixture) { // 3rd Party Tests task s3ThirdPartyTest(type: Test) { + SourceSetContainer sourceSets = project.getExtensions().getByType(SourceSetContainer.class); + SourceSet internalTestSourceSet = sourceSets.getByName(InternalClusterTestPlugin.SOURCE_SET_NAME) + setTestClassesDirs(internalTestSourceSet.getOutput().getClassesDirs()) + setClasspath(internalTestSourceSet.getRuntimeClasspath()) include '**/S3RepositoryThirdPartyTests.class' systemProperty 'test.s3.account', s3PermanentAccessKey systemProperty 'test.s3.key', s3PermanentSecretKey systemProperty 'test.s3.bucket', s3PermanentBucket nonInputProperties.systemProperty 'test.s3.base', s3PermanentBasePath + "_third_party_tests_" + BuildParams.testSeed if (useFixture) { - dependsOn tasks.integTestMinio + // dependsOn tasks.yamlRestTestMinio nonInputProperties.systemProperty 'test.s3.endpoint', "${-> fixtureAddress('minio-fixture', 'minio-fixture', '9000') }" } else { - dependsOn tasks.integTest + // dependsOn tasks.yamlRestTest } } check.dependsOn(s3ThirdPartyTest) diff --git a/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3BlobStoreRepositoryTests.java b/plugins/repository-s3/src/internalClusterTest/java/org/elasticsearch/repositories/s3/S3BlobStoreRepositoryTests.java similarity index 99% rename from plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3BlobStoreRepositoryTests.java rename to plugins/repository-s3/src/internalClusterTest/java/org/elasticsearch/repositories/s3/S3BlobStoreRepositoryTests.java index d54181001c0fa..3bf452cdb949b 100644 --- a/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3BlobStoreRepositoryTests.java +++ b/plugins/repository-s3/src/internalClusterTest/java/org/elasticsearch/repositories/s3/S3BlobStoreRepositoryTests.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 @@ -304,3 +304,4 @@ private boolean isMultiPartUpload(String request) { } } } + diff --git a/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3RepositoryThirdPartyTests.java b/plugins/repository-s3/src/internalClusterTest/java/org/elasticsearch/repositories/s3/S3RepositoryThirdPartyTests.java similarity index 100% rename from plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3RepositoryThirdPartyTests.java rename to plugins/repository-s3/src/internalClusterTest/java/org/elasticsearch/repositories/s3/S3RepositoryThirdPartyTests.java diff --git a/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/RepositoryS3ClientYamlTestSuiteIT.java b/plugins/repository-s3/src/yamlRestTest/java/org/elasticsearch/repositories/s3/RepositoryS3ClientYamlTestSuiteIT.java similarity index 100% rename from plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/RepositoryS3ClientYamlTestSuiteIT.java rename to plugins/repository-s3/src/yamlRestTest/java/org/elasticsearch/repositories/s3/RepositoryS3ClientYamlTestSuiteIT.java diff --git a/plugins/repository-s3/src/test/resources/rest-api-spec/test/repository_s3/10_basic.yml b/plugins/repository-s3/src/yamlRestTest/resources/rest-api-spec/test/repository_s3/10_basic.yml similarity index 100% rename from plugins/repository-s3/src/test/resources/rest-api-spec/test/repository_s3/10_basic.yml rename to plugins/repository-s3/src/yamlRestTest/resources/rest-api-spec/test/repository_s3/10_basic.yml diff --git a/plugins/repository-s3/src/test/resources/rest-api-spec/test/repository_s3/20_repository_permanent_credentials.yml b/plugins/repository-s3/src/yamlRestTest/resources/rest-api-spec/test/repository_s3/20_repository_permanent_credentials.yml similarity index 100% rename from plugins/repository-s3/src/test/resources/rest-api-spec/test/repository_s3/20_repository_permanent_credentials.yml rename to plugins/repository-s3/src/yamlRestTest/resources/rest-api-spec/test/repository_s3/20_repository_permanent_credentials.yml diff --git a/plugins/repository-s3/src/test/resources/rest-api-spec/test/repository_s3/30_repository_temporary_credentials.yml b/plugins/repository-s3/src/yamlRestTest/resources/rest-api-spec/test/repository_s3/30_repository_temporary_credentials.yml similarity index 100% rename from plugins/repository-s3/src/test/resources/rest-api-spec/test/repository_s3/30_repository_temporary_credentials.yml rename to plugins/repository-s3/src/yamlRestTest/resources/rest-api-spec/test/repository_s3/30_repository_temporary_credentials.yml diff --git a/plugins/repository-s3/src/test/resources/rest-api-spec/test/repository_s3/40_repository_ec2_credentials.yml b/plugins/repository-s3/src/yamlRestTest/resources/rest-api-spec/test/repository_s3/40_repository_ec2_credentials.yml similarity index 100% rename from plugins/repository-s3/src/test/resources/rest-api-spec/test/repository_s3/40_repository_ec2_credentials.yml rename to plugins/repository-s3/src/yamlRestTest/resources/rest-api-spec/test/repository_s3/40_repository_ec2_credentials.yml diff --git a/plugins/repository-s3/src/test/resources/rest-api-spec/test/repository_s3/50_repository_ecs_credentials.yml b/plugins/repository-s3/src/yamlRestTest/resources/rest-api-spec/test/repository_s3/50_repository_ecs_credentials.yml similarity index 100% rename from plugins/repository-s3/src/test/resources/rest-api-spec/test/repository_s3/50_repository_ecs_credentials.yml rename to plugins/repository-s3/src/yamlRestTest/resources/rest-api-spec/test/repository_s3/50_repository_ecs_credentials.yml From 9414e3dfe7933c4c34716f8cb55f3de68382fd88 Mon Sep 17 00:00:00 2001 From: Jake Landis Date: Wed, 22 Jul 2020 13:41:44 -0500 Subject: [PATCH 16/26] store-smb --- plugins/store-smb/build.gradle | 3 ++- .../org/elasticsearch/index/store/AbstractAzureFsTestCase.java | 0 .../java/org/elasticsearch/index/store/SmbMMapFsTests.java | 0 .../java/org/elasticsearch/index/store/SmbSimpleFsTests.java | 0 .../index/store/StoreSmbClientYamlTestSuiteIT.java | 0 .../resources/rest-api-spec/test/store_smb/10_basic.yml | 0 .../rest-api-spec/test/store_smb/15_index_creation.yml | 0 7 files changed, 2 insertions(+), 1 deletion(-) rename plugins/store-smb/src/{test => internalClusterTest}/java/org/elasticsearch/index/store/AbstractAzureFsTestCase.java (100%) rename plugins/store-smb/src/{test => internalClusterTest}/java/org/elasticsearch/index/store/SmbMMapFsTests.java (100%) rename plugins/store-smb/src/{test => internalClusterTest}/java/org/elasticsearch/index/store/SmbSimpleFsTests.java (100%) rename plugins/store-smb/src/{test => yamlRestTest}/java/org/elasticsearch/index/store/StoreSmbClientYamlTestSuiteIT.java (100%) rename plugins/store-smb/src/{test => yamlRestTest}/resources/rest-api-spec/test/store_smb/10_basic.yml (100%) rename plugins/store-smb/src/{test => yamlRestTest}/resources/rest-api-spec/test/store_smb/15_index_creation.yml (100%) diff --git a/plugins/store-smb/build.gradle b/plugins/store-smb/build.gradle index fd137f0e34cc7..2d36900b1491b 100644 --- a/plugins/store-smb/build.gradle +++ b/plugins/store-smb/build.gradle @@ -16,7 +16,8 @@ * 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 Store SMB plugin adds support for SMB stores.' diff --git a/plugins/store-smb/src/test/java/org/elasticsearch/index/store/AbstractAzureFsTestCase.java b/plugins/store-smb/src/internalClusterTest/java/org/elasticsearch/index/store/AbstractAzureFsTestCase.java similarity index 100% rename from plugins/store-smb/src/test/java/org/elasticsearch/index/store/AbstractAzureFsTestCase.java rename to plugins/store-smb/src/internalClusterTest/java/org/elasticsearch/index/store/AbstractAzureFsTestCase.java diff --git a/plugins/store-smb/src/test/java/org/elasticsearch/index/store/SmbMMapFsTests.java b/plugins/store-smb/src/internalClusterTest/java/org/elasticsearch/index/store/SmbMMapFsTests.java similarity index 100% rename from plugins/store-smb/src/test/java/org/elasticsearch/index/store/SmbMMapFsTests.java rename to plugins/store-smb/src/internalClusterTest/java/org/elasticsearch/index/store/SmbMMapFsTests.java diff --git a/plugins/store-smb/src/test/java/org/elasticsearch/index/store/SmbSimpleFsTests.java b/plugins/store-smb/src/internalClusterTest/java/org/elasticsearch/index/store/SmbSimpleFsTests.java similarity index 100% rename from plugins/store-smb/src/test/java/org/elasticsearch/index/store/SmbSimpleFsTests.java rename to plugins/store-smb/src/internalClusterTest/java/org/elasticsearch/index/store/SmbSimpleFsTests.java diff --git a/plugins/store-smb/src/test/java/org/elasticsearch/index/store/StoreSmbClientYamlTestSuiteIT.java b/plugins/store-smb/src/yamlRestTest/java/org/elasticsearch/index/store/StoreSmbClientYamlTestSuiteIT.java similarity index 100% rename from plugins/store-smb/src/test/java/org/elasticsearch/index/store/StoreSmbClientYamlTestSuiteIT.java rename to plugins/store-smb/src/yamlRestTest/java/org/elasticsearch/index/store/StoreSmbClientYamlTestSuiteIT.java diff --git a/plugins/store-smb/src/test/resources/rest-api-spec/test/store_smb/10_basic.yml b/plugins/store-smb/src/yamlRestTest/resources/rest-api-spec/test/store_smb/10_basic.yml similarity index 100% rename from plugins/store-smb/src/test/resources/rest-api-spec/test/store_smb/10_basic.yml rename to plugins/store-smb/src/yamlRestTest/resources/rest-api-spec/test/store_smb/10_basic.yml diff --git a/plugins/store-smb/src/test/resources/rest-api-spec/test/store_smb/15_index_creation.yml b/plugins/store-smb/src/yamlRestTest/resources/rest-api-spec/test/store_smb/15_index_creation.yml similarity index 100% rename from plugins/store-smb/src/test/resources/rest-api-spec/test/store_smb/15_index_creation.yml rename to plugins/store-smb/src/yamlRestTest/resources/rest-api-spec/test/store_smb/15_index_creation.yml From f2cf390cbe195d078bcd42cfdfa528e2c81f6c50 Mon Sep 17 00:00:00 2001 From: Jake Landis Date: Wed, 22 Jul 2020 13:48:53 -0500 Subject: [PATCH 17/26] transport-nio --- plugins/transport-nio/build.gradle | 3 +++ .../java/org/elasticsearch/NioIntegTestCase.java | 0 .../java/org/elasticsearch/http/nio/NioPipeliningIT.java | 0 .../org/elasticsearch/transport/nio/NioTransportLoggingIT.java | 0 4 files changed, 3 insertions(+) rename plugins/transport-nio/src/{test => internalClusterTest}/java/org/elasticsearch/NioIntegTestCase.java (100%) rename plugins/transport-nio/src/{test => internalClusterTest}/java/org/elasticsearch/http/nio/NioPipeliningIT.java (100%) rename plugins/transport-nio/src/{test => internalClusterTest}/java/org/elasticsearch/transport/nio/NioTransportLoggingIT.java (100%) diff --git a/plugins/transport-nio/build.gradle b/plugins/transport-nio/build.gradle index 27ef4a6b1c4fe..464f2760876f8 100644 --- a/plugins/transport-nio/build.gradle +++ b/plugins/transport-nio/build.gradle @@ -19,12 +19,15 @@ import org.elasticsearch.gradle.info.BuildParams * under the License. */ apply plugin: "elasticsearch.publish" +apply plugin: 'elasticsearch.internal-cluster-test' esplugin { description 'The nio transport.' classname 'org.elasticsearch.transport.nio.NioTransportPlugin' } +// integTest have been converted to internalClusterTest +integTest.enabled = false dependencies { api project(':libs:elasticsearch-nio') diff --git a/plugins/transport-nio/src/test/java/org/elasticsearch/NioIntegTestCase.java b/plugins/transport-nio/src/internalClusterTest/java/org/elasticsearch/NioIntegTestCase.java similarity index 100% rename from plugins/transport-nio/src/test/java/org/elasticsearch/NioIntegTestCase.java rename to plugins/transport-nio/src/internalClusterTest/java/org/elasticsearch/NioIntegTestCase.java diff --git a/plugins/transport-nio/src/test/java/org/elasticsearch/http/nio/NioPipeliningIT.java b/plugins/transport-nio/src/internalClusterTest/java/org/elasticsearch/http/nio/NioPipeliningIT.java similarity index 100% rename from plugins/transport-nio/src/test/java/org/elasticsearch/http/nio/NioPipeliningIT.java rename to plugins/transport-nio/src/internalClusterTest/java/org/elasticsearch/http/nio/NioPipeliningIT.java diff --git a/plugins/transport-nio/src/test/java/org/elasticsearch/transport/nio/NioTransportLoggingIT.java b/plugins/transport-nio/src/internalClusterTest/java/org/elasticsearch/transport/nio/NioTransportLoggingIT.java similarity index 100% rename from plugins/transport-nio/src/test/java/org/elasticsearch/transport/nio/NioTransportLoggingIT.java rename to plugins/transport-nio/src/internalClusterTest/java/org/elasticsearch/transport/nio/NioTransportLoggingIT.java From 21cc84a4ecb827d78b8979fbf3bf0bc6a7359222 Mon Sep 17 00:00:00 2001 From: Jake Landis Date: Wed, 22 Jul 2020 13:59:50 -0500 Subject: [PATCH 18/26] Revert "repository-s3" This reverts commit 4a1d8c865159caafb08e44721f3a9682d2fda477. --- plugins/repository-gcs/build.gradle | 5 ++- plugins/repository-s3/build.gradle | 45 ++++++------------- .../s3/RepositoryS3ClientYamlTestSuiteIT.java | 0 .../s3/S3BlobStoreRepositoryTests.java | 3 +- .../s3/S3RepositoryThirdPartyTests.java | 0 .../test/repository_s3/10_basic.yml | 0 .../20_repository_permanent_credentials.yml | 0 .../30_repository_temporary_credentials.yml | 0 .../40_repository_ec2_credentials.yml | 0 .../50_repository_ecs_credentials.yml | 0 10 files changed, 18 insertions(+), 35 deletions(-) rename plugins/repository-s3/src/{yamlRestTest => test}/java/org/elasticsearch/repositories/s3/RepositoryS3ClientYamlTestSuiteIT.java (100%) rename plugins/repository-s3/src/{internalClusterTest => test}/java/org/elasticsearch/repositories/s3/S3BlobStoreRepositoryTests.java (99%) rename plugins/repository-s3/src/{internalClusterTest => test}/java/org/elasticsearch/repositories/s3/S3RepositoryThirdPartyTests.java (100%) rename plugins/repository-s3/src/{yamlRestTest => test}/resources/rest-api-spec/test/repository_s3/10_basic.yml (100%) rename plugins/repository-s3/src/{yamlRestTest => test}/resources/rest-api-spec/test/repository_s3/20_repository_permanent_credentials.yml (100%) rename plugins/repository-s3/src/{yamlRestTest => test}/resources/rest-api-spec/test/repository_s3/30_repository_temporary_credentials.yml (100%) rename plugins/repository-s3/src/{yamlRestTest => test}/resources/rest-api-spec/test/repository_s3/40_repository_ec2_credentials.yml (100%) rename plugins/repository-s3/src/{yamlRestTest => test}/resources/rest-api-spec/test/repository_s3/50_repository_ecs_credentials.yml (100%) diff --git a/plugins/repository-gcs/build.gradle b/plugins/repository-gcs/build.gradle index 24a9185c5c218..7b6ff4be342b0 100644 --- a/plugins/repository-gcs/build.gradle +++ b/plugins/repository-gcs/build.gradle @@ -294,11 +294,13 @@ testClusters { * an additional test that forces the large blob threshold to be small to exercise the resumable upload path. */ task largeBlobYamlRestTest(type: RestIntegTestTask) { - mustRunAfter yamlRestTest //to allow maven style filtering + mustRunAfter yamlRestTest dependsOn project(':plugins:repository-gcs').bundlePlugin if (useFixture) { dependsOn createServiceAccountFile } +} +largeBlobYamlRestTest { runner { SourceSetContainer sourceSets = project.getExtensions().getByType(SourceSetContainer.class); SourceSet yamlRestTestSourceSet = sourceSets.getByName(YamlRestTestPlugin.SOURCE_SET_NAME) @@ -306,7 +308,6 @@ task largeBlobYamlRestTest(type: RestIntegTestTask) { setClasspath(yamlRestTestSourceSet.getRuntimeClasspath()) } } - check.dependsOn largeBlobYamlRestTest testClusters { diff --git a/plugins/repository-s3/build.gradle b/plugins/repository-s3/build.gradle index 007b4df77aa5a..38362209228e6 100644 --- a/plugins/repository-s3/build.gradle +++ b/plugins/repository-s3/build.gradle @@ -1,8 +1,6 @@ import org.elasticsearch.gradle.MavenFilteringHack import org.elasticsearch.gradle.info.BuildParams import org.elasticsearch.gradle.test.RestIntegTestTask -import org.elasticsearch.gradle.test.rest.YamlRestTestPlugin -import org.elasticsearch.gradle.test.InternalClusterTestPlugin import static org.elasticsearch.gradle.PropertyNormalization.IGNORE_VALUE @@ -24,8 +22,7 @@ import static org.elasticsearch.gradle.PropertyNormalization.IGNORE_VALUE * specific language governing permissions and limitations * under the License. */ -apply plugin: 'elasticsearch.yaml-rest-test' -apply plugin: 'elasticsearch.internal-cluster-test' +apply plugin: 'elasticsearch.rest-resources' esplugin { description 'The S3 repository plugin adds S3 repositories' @@ -138,7 +135,7 @@ if (!s3EC2Bucket && !s3EC2BasePath && !s3ECSBucket && !s3ECSBasePath) { throw new IllegalArgumentException("not all options specified to run EC2/ECS tests are present") } -processYamlRestTestResources { +processTestResources { Map expansions = [ 'permanent_bucket' : s3PermanentBucket, 'permanent_base_path' : s3PermanentBasePath + "_integration_tests", @@ -154,12 +151,13 @@ processYamlRestTestResources { MavenFilteringHack.filter(it, expansions) } -internalClusterTest { +test { // this is tested explicitly in a separate test task exclude '**/S3RepositoryThirdPartyTests.class' } -yamlRestTest { +// IntegTest +integTest { runner { systemProperty 'tests.rest.blacklist', ( useFixture ? @@ -174,7 +172,7 @@ yamlRestTest { } } -testClusters.yamlRestTest { +testClusters.integTest { keystore 's3.client.integration_test_permanent.access_key', s3PermanentAccessKey keystore 's3.client.integration_test_permanent.secret_key', s3PermanentSecretKey @@ -209,16 +207,10 @@ testClusters.yamlRestTest { if (useFixture) { testFixtures.useFixture(':test:fixtures:minio-fixture', 'minio-fixture') - task yamlRestTestMinio(type: RestIntegTestTask) { - mustRunAfter 'yamlRestTest' //to allow maven style filtering + task integTestMinio(type: RestIntegTestTask) { description = "Runs REST tests using the Minio repository." dependsOn tasks.bundlePlugin runner { - SourceSetContainer sourceSets = project.getExtensions().getByType(SourceSetContainer.class); - SourceSet yamlRestTestSourceSet = sourceSets.getByName(YamlRestTestPlugin.SOURCE_SET_NAME) - setTestClassesDirs(yamlRestTestSourceSet.getOutput().getClassesDirs()) - setClasspath(yamlRestTestSourceSet.getRuntimeClasspath()) - // Minio only supports a single access key, see https://github.com/minio/minio/pull/5968 systemProperty 'tests.rest.blacklist', [ 'repository_s3/30_repository_temporary_credentials/*', @@ -227,9 +219,9 @@ if (useFixture) { ].join(",") } } - check.dependsOn(yamlRestTestMinio) + check.dependsOn(integTestMinio) - testClusters.yamlRestTestMinio { + testClusters.integTestMinio { keystore 's3.client.integration_test_permanent.access_key', s3PermanentAccessKey keystore 's3.client.integration_test_permanent.secret_key', s3PermanentSecretKey setting 's3.client.integration_test_permanent.endpoint', { "${-> fixtureAddress('minio-fixture', 'minio-fixture', '9000')}" }, IGNORE_VALUE @@ -241,15 +233,10 @@ if (useFixture) { if (useFixture) { testFixtures.useFixture(':test:fixtures:s3-fixture', 's3-fixture-with-ecs') - task yamlRestTestECS(type: RestIntegTestTask.class) { - mustRunAfter 'yamlRestTest' //to allow maven style filtering + task integTestECS(type: RestIntegTestTask.class) { description = "Runs tests using the ECS repository." dependsOn('bundlePlugin') runner { - SourceSetContainer sourceSets = project.getExtensions().getByType(SourceSetContainer.class); - SourceSet yamlRestTestSourceSet = sourceSets.getByName(YamlRestTestPlugin.SOURCE_SET_NAME) - setTestClassesDirs(yamlRestTestSourceSet.getOutput().getClassesDirs()) - setClasspath(yamlRestTestSourceSet.getRuntimeClasspath()) systemProperty 'tests.rest.blacklist', [ 'repository_s3/10_basic/*', 'repository_s3/20_repository_permanent_credentials/*', @@ -258,9 +245,9 @@ if (useFixture) { ].join(",") } } - check.dependsOn(yamlRestTestECS) + check.dependsOn(integTestECS) - testClusters.yamlRestTestECS { + testClusters.integTestECS { setting 's3.client.integration_test_ecs.endpoint', { "${-> fixtureAddress('s3-fixture', 's3-fixture-with-ecs', '80')}" }, IGNORE_VALUE plugin tasks.bundlePlugin.archiveFile environment 'AWS_CONTAINER_CREDENTIALS_FULL_URI', { "${-> fixtureAddress('s3-fixture', 's3-fixture-with-ecs', '80')}/ecs_credentials_endpoint" }, IGNORE_VALUE @@ -269,20 +256,16 @@ if (useFixture) { // 3rd Party Tests task s3ThirdPartyTest(type: Test) { - SourceSetContainer sourceSets = project.getExtensions().getByType(SourceSetContainer.class); - SourceSet internalTestSourceSet = sourceSets.getByName(InternalClusterTestPlugin.SOURCE_SET_NAME) - setTestClassesDirs(internalTestSourceSet.getOutput().getClassesDirs()) - setClasspath(internalTestSourceSet.getRuntimeClasspath()) include '**/S3RepositoryThirdPartyTests.class' systemProperty 'test.s3.account', s3PermanentAccessKey systemProperty 'test.s3.key', s3PermanentSecretKey systemProperty 'test.s3.bucket', s3PermanentBucket nonInputProperties.systemProperty 'test.s3.base', s3PermanentBasePath + "_third_party_tests_" + BuildParams.testSeed if (useFixture) { - // dependsOn tasks.yamlRestTestMinio + dependsOn tasks.integTestMinio nonInputProperties.systemProperty 'test.s3.endpoint', "${-> fixtureAddress('minio-fixture', 'minio-fixture', '9000') }" } else { - // dependsOn tasks.yamlRestTest + dependsOn tasks.integTest } } check.dependsOn(s3ThirdPartyTest) diff --git a/plugins/repository-s3/src/yamlRestTest/java/org/elasticsearch/repositories/s3/RepositoryS3ClientYamlTestSuiteIT.java b/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/RepositoryS3ClientYamlTestSuiteIT.java similarity index 100% rename from plugins/repository-s3/src/yamlRestTest/java/org/elasticsearch/repositories/s3/RepositoryS3ClientYamlTestSuiteIT.java rename to plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/RepositoryS3ClientYamlTestSuiteIT.java diff --git a/plugins/repository-s3/src/internalClusterTest/java/org/elasticsearch/repositories/s3/S3BlobStoreRepositoryTests.java b/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3BlobStoreRepositoryTests.java similarity index 99% rename from plugins/repository-s3/src/internalClusterTest/java/org/elasticsearch/repositories/s3/S3BlobStoreRepositoryTests.java rename to plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3BlobStoreRepositoryTests.java index 3bf452cdb949b..d54181001c0fa 100644 --- a/plugins/repository-s3/src/internalClusterTest/java/org/elasticsearch/repositories/s3/S3BlobStoreRepositoryTests.java +++ b/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3BlobStoreRepositoryTests.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 @@ -304,4 +304,3 @@ private boolean isMultiPartUpload(String request) { } } } - diff --git a/plugins/repository-s3/src/internalClusterTest/java/org/elasticsearch/repositories/s3/S3RepositoryThirdPartyTests.java b/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3RepositoryThirdPartyTests.java similarity index 100% rename from plugins/repository-s3/src/internalClusterTest/java/org/elasticsearch/repositories/s3/S3RepositoryThirdPartyTests.java rename to plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3RepositoryThirdPartyTests.java diff --git a/plugins/repository-s3/src/yamlRestTest/resources/rest-api-spec/test/repository_s3/10_basic.yml b/plugins/repository-s3/src/test/resources/rest-api-spec/test/repository_s3/10_basic.yml similarity index 100% rename from plugins/repository-s3/src/yamlRestTest/resources/rest-api-spec/test/repository_s3/10_basic.yml rename to plugins/repository-s3/src/test/resources/rest-api-spec/test/repository_s3/10_basic.yml diff --git a/plugins/repository-s3/src/yamlRestTest/resources/rest-api-spec/test/repository_s3/20_repository_permanent_credentials.yml b/plugins/repository-s3/src/test/resources/rest-api-spec/test/repository_s3/20_repository_permanent_credentials.yml similarity index 100% rename from plugins/repository-s3/src/yamlRestTest/resources/rest-api-spec/test/repository_s3/20_repository_permanent_credentials.yml rename to plugins/repository-s3/src/test/resources/rest-api-spec/test/repository_s3/20_repository_permanent_credentials.yml diff --git a/plugins/repository-s3/src/yamlRestTest/resources/rest-api-spec/test/repository_s3/30_repository_temporary_credentials.yml b/plugins/repository-s3/src/test/resources/rest-api-spec/test/repository_s3/30_repository_temporary_credentials.yml similarity index 100% rename from plugins/repository-s3/src/yamlRestTest/resources/rest-api-spec/test/repository_s3/30_repository_temporary_credentials.yml rename to plugins/repository-s3/src/test/resources/rest-api-spec/test/repository_s3/30_repository_temporary_credentials.yml diff --git a/plugins/repository-s3/src/yamlRestTest/resources/rest-api-spec/test/repository_s3/40_repository_ec2_credentials.yml b/plugins/repository-s3/src/test/resources/rest-api-spec/test/repository_s3/40_repository_ec2_credentials.yml similarity index 100% rename from plugins/repository-s3/src/yamlRestTest/resources/rest-api-spec/test/repository_s3/40_repository_ec2_credentials.yml rename to plugins/repository-s3/src/test/resources/rest-api-spec/test/repository_s3/40_repository_ec2_credentials.yml diff --git a/plugins/repository-s3/src/yamlRestTest/resources/rest-api-spec/test/repository_s3/50_repository_ecs_credentials.yml b/plugins/repository-s3/src/test/resources/rest-api-spec/test/repository_s3/50_repository_ecs_credentials.yml similarity index 100% rename from plugins/repository-s3/src/yamlRestTest/resources/rest-api-spec/test/repository_s3/50_repository_ecs_credentials.yml rename to plugins/repository-s3/src/test/resources/rest-api-spec/test/repository_s3/50_repository_ecs_credentials.yml From ebb6703ccd642ab7505bb86a822b4995fa705a11 Mon Sep 17 00:00:00 2001 From: Jake Landis Date: Wed, 22 Jul 2020 14:00:02 -0500 Subject: [PATCH 19/26] Revert "repository-gcs" This reverts commit 8682017cb5b923327864e53fe781bd7024b4e870. --- plugins/repository-azure/build.gradle | 2 +- plugins/repository-gcs/build.gradle | 36 +++++++------------ ...eCloudStorageBlobStoreRepositoryTests.java | 0 .../GoogleCloudStorageThirdPartyTests.java | 0 .../RepositoryGcsClientYamlTestSuiteIT.java | 0 .../test/repository_gcs/10_basic.yml | 0 .../test/repository_gcs/20_repository.yml | 0 7 files changed, 13 insertions(+), 25 deletions(-) rename plugins/repository-gcs/src/{internalClusterTest => test}/java/org/elasticsearch/repositories/gcs/GoogleCloudStorageBlobStoreRepositoryTests.java (100%) rename plugins/repository-gcs/src/{internalClusterTest => test}/java/org/elasticsearch/repositories/gcs/GoogleCloudStorageThirdPartyTests.java (100%) rename plugins/repository-gcs/src/{yamlRestTest => test}/java/org/elasticsearch/repositories/gcs/RepositoryGcsClientYamlTestSuiteIT.java (100%) rename plugins/repository-gcs/src/{yamlRestTest => test}/resources/rest-api-spec/test/repository_gcs/10_basic.yml (100%) rename plugins/repository-gcs/src/{yamlRestTest => test}/resources/rest-api-spec/test/repository_gcs/20_repository.yml (100%) diff --git a/plugins/repository-azure/build.gradle b/plugins/repository-azure/build.gradle index 308e4ab59bf42..6cfae235d0ab5 100644 --- a/plugins/repository-azure/build.gradle +++ b/plugins/repository-azure/build.gradle @@ -139,8 +139,8 @@ task azureThirdPartyTest(type: Test) { SourceSetContainer sourceSets = project.getExtensions().getByType(SourceSetContainer.class); SourceSet internalTestSourceSet = sourceSets.getByName(InternalClusterTestPlugin.SOURCE_SET_NAME) setTestClassesDirs(internalTestSourceSet.getOutput().getClassesDirs()) - setClasspath(internalTestSourceSet.getRuntimeClasspath()) dependsOn tasks.internalClusterTest + setClasspath(internalTestSourceSet.getRuntimeClasspath()) include '**/AzureStorageCleanupThirdPartyTests.class' systemProperty 'test.azure.account', azureAccount ? azureAccount : "" systemProperty 'test.azure.key', azureKey ? azureKey : "" diff --git a/plugins/repository-gcs/build.gradle b/plugins/repository-gcs/build.gradle index 7b6ff4be342b0..5a60f96d8abbd 100644 --- a/plugins/repository-gcs/build.gradle +++ b/plugins/repository-gcs/build.gradle @@ -4,8 +4,6 @@ import java.security.KeyPairGenerator import org.elasticsearch.gradle.MavenFilteringHack import org.elasticsearch.gradle.info.BuildParams import org.elasticsearch.gradle.test.RestIntegTestTask -import org.elasticsearch.gradle.test.rest.YamlRestTestPlugin -import org.elasticsearch.gradle.test.InternalClusterTestPlugin import java.nio.file.Files import java.security.KeyPair @@ -30,8 +28,7 @@ import static org.elasticsearch.gradle.PropertyNormalization.IGNORE_VALUE * specific language governing permissions and limitations * under the License. */ -apply plugin: 'elasticsearch.yaml-rest-test' -apply plugin: 'elasticsearch.internal-cluster-test' +apply plugin: 'elasticsearch.rest-resources' esplugin { description 'The GCS repository plugin adds Google Cloud Storage support for repositories.' @@ -257,12 +254,12 @@ Map expansions = [ 'base_path': gcsBasePath + "_integration_tests" ] -processYamlRestTestResources { +processTestResources { inputs.properties(expansions) MavenFilteringHack.filter(it, expansions) } -internalClusterTest { +test { // this is tested explicitly in a separate test task exclude '**/GoogleCloudStorageThirdPartyTests.class' } @@ -279,39 +276,33 @@ final Closure testClustersConfiguration = { } } -yamlRestTest { +integTest { if (useFixture) { dependsOn createServiceAccountFile } } +check.dependsOn integTest testClusters { - all testClustersConfiguration + integTest testClustersConfiguration } /* * We only use a small amount of data in these tests, which means that the resumable upload path is not tested. We add * an additional test that forces the large blob threshold to be small to exercise the resumable upload path. */ -task largeBlobYamlRestTest(type: RestIntegTestTask) { - mustRunAfter yamlRestTest +task largeBlobIntegTest(type: RestIntegTestTask) { + mustRunAfter integTest dependsOn project(':plugins:repository-gcs').bundlePlugin if (useFixture) { dependsOn createServiceAccountFile } } -largeBlobYamlRestTest { - runner { - SourceSetContainer sourceSets = project.getExtensions().getByType(SourceSetContainer.class); - SourceSet yamlRestTestSourceSet = sourceSets.getByName(YamlRestTestPlugin.SOURCE_SET_NAME) - setTestClassesDirs(yamlRestTestSourceSet.getOutput().getClassesDirs()) - setClasspath(yamlRestTestSourceSet.getRuntimeClasspath()) - } -} -check.dependsOn largeBlobYamlRestTest +check.dependsOn largeBlobIntegTest +testClusters.largeBlobIntegTest testClustersConfiguration testClusters { - largeBlobYamlRestTest { + largeBlobIntegTest { plugin project(':plugins:repository-gcs').bundlePlugin.archiveFile // force large blob uploads by setting the threshold small, forcing this code path to be tested @@ -320,10 +311,7 @@ testClusters { } task gcsThirdPartyTest(type: Test) { - SourceSetContainer sourceSets = project.getExtensions().getByType(SourceSetContainer.class); - SourceSet internalTestSourceSet = sourceSets.getByName(InternalClusterTestPlugin.SOURCE_SET_NAME) - setTestClassesDirs(internalTestSourceSet.getOutput().getClassesDirs()) - setClasspath(internalTestSourceSet.getRuntimeClasspath()) + dependsOn integTest,largeBlobIntegTest include '**/GoogleCloudStorageThirdPartyTests.class' systemProperty 'tests.security.manager', false systemProperty 'test.google.bucket', gcsBucket diff --git a/plugins/repository-gcs/src/internalClusterTest/java/org/elasticsearch/repositories/gcs/GoogleCloudStorageBlobStoreRepositoryTests.java b/plugins/repository-gcs/src/test/java/org/elasticsearch/repositories/gcs/GoogleCloudStorageBlobStoreRepositoryTests.java similarity index 100% rename from plugins/repository-gcs/src/internalClusterTest/java/org/elasticsearch/repositories/gcs/GoogleCloudStorageBlobStoreRepositoryTests.java rename to plugins/repository-gcs/src/test/java/org/elasticsearch/repositories/gcs/GoogleCloudStorageBlobStoreRepositoryTests.java diff --git a/plugins/repository-gcs/src/internalClusterTest/java/org/elasticsearch/repositories/gcs/GoogleCloudStorageThirdPartyTests.java b/plugins/repository-gcs/src/test/java/org/elasticsearch/repositories/gcs/GoogleCloudStorageThirdPartyTests.java similarity index 100% rename from plugins/repository-gcs/src/internalClusterTest/java/org/elasticsearch/repositories/gcs/GoogleCloudStorageThirdPartyTests.java rename to plugins/repository-gcs/src/test/java/org/elasticsearch/repositories/gcs/GoogleCloudStorageThirdPartyTests.java diff --git a/plugins/repository-gcs/src/yamlRestTest/java/org/elasticsearch/repositories/gcs/RepositoryGcsClientYamlTestSuiteIT.java b/plugins/repository-gcs/src/test/java/org/elasticsearch/repositories/gcs/RepositoryGcsClientYamlTestSuiteIT.java similarity index 100% rename from plugins/repository-gcs/src/yamlRestTest/java/org/elasticsearch/repositories/gcs/RepositoryGcsClientYamlTestSuiteIT.java rename to plugins/repository-gcs/src/test/java/org/elasticsearch/repositories/gcs/RepositoryGcsClientYamlTestSuiteIT.java diff --git a/plugins/repository-gcs/src/yamlRestTest/resources/rest-api-spec/test/repository_gcs/10_basic.yml b/plugins/repository-gcs/src/test/resources/rest-api-spec/test/repository_gcs/10_basic.yml similarity index 100% rename from plugins/repository-gcs/src/yamlRestTest/resources/rest-api-spec/test/repository_gcs/10_basic.yml rename to plugins/repository-gcs/src/test/resources/rest-api-spec/test/repository_gcs/10_basic.yml diff --git a/plugins/repository-gcs/src/yamlRestTest/resources/rest-api-spec/test/repository_gcs/20_repository.yml b/plugins/repository-gcs/src/test/resources/rest-api-spec/test/repository_gcs/20_repository.yml similarity index 100% rename from plugins/repository-gcs/src/yamlRestTest/resources/rest-api-spec/test/repository_gcs/20_repository.yml rename to plugins/repository-gcs/src/test/resources/rest-api-spec/test/repository_gcs/20_repository.yml From 6147473b2d1993acc4a8b13f2b78f9f307b949e4 Mon Sep 17 00:00:00 2001 From: Jake Landis Date: Wed, 22 Jul 2020 14:00:11 -0500 Subject: [PATCH 20/26] Revert "repository-azure" This reverts commit 4a2d639bec119eafec0a8fe83d72191d372e1f99. --- plugins/repository-azure/build.gradle | 16 +++++----------- .../azure/AzureBlobStoreRepositoryTests.java | 0 .../AzureStorageCleanupThirdPartyTests.java | 0 .../RepositoryAzureClientYamlTestSuiteIT.java | 0 .../test/repository_azure/10_basic.yml | 0 .../test/repository_azure/20_repository.yml | 0 6 files changed, 5 insertions(+), 11 deletions(-) rename plugins/repository-azure/src/{internalClusterTest => test}/java/org/elasticsearch/repositories/azure/AzureBlobStoreRepositoryTests.java (100%) rename plugins/repository-azure/src/{internalClusterTest => test}/java/org/elasticsearch/repositories/azure/AzureStorageCleanupThirdPartyTests.java (100%) rename plugins/repository-azure/src/{yamlRestTest => test}/java/org/elasticsearch/repositories/azure/RepositoryAzureClientYamlTestSuiteIT.java (100%) rename plugins/repository-azure/src/{yamlRestTest => test}/resources/rest-api-spec/test/repository_azure/10_basic.yml (100%) rename plugins/repository-azure/src/{yamlRestTest => test}/resources/rest-api-spec/test/repository_azure/20_repository.yml (100%) diff --git a/plugins/repository-azure/build.gradle b/plugins/repository-azure/build.gradle index 6cfae235d0ab5..723a4c1e0753a 100644 --- a/plugins/repository-azure/build.gradle +++ b/plugins/repository-azure/build.gradle @@ -1,6 +1,5 @@ import org.elasticsearch.gradle.MavenFilteringHack import org.elasticsearch.gradle.info.BuildParams -import org.elasticsearch.gradle.test.InternalClusterTestPlugin import static org.elasticsearch.gradle.PropertyNormalization.DEFAULT import static org.elasticsearch.gradle.PropertyNormalization.IGNORE_VALUE @@ -23,8 +22,7 @@ import static org.elasticsearch.gradle.PropertyNormalization.IGNORE_VALUE * specific language governing permissions and limitations * under the License. */ -apply plugin: 'elasticsearch.yaml-rest-test' -apply plugin: 'elasticsearch.internal-cluster-test' +apply plugin: 'elasticsearch.rest-resources' esplugin { description 'The Azure Repository plugin adds support for Azure storage repositories.' @@ -108,18 +106,18 @@ Map expansions = [ 'base_path': azureBasePath + "_integration_tests" ] -processYamlRestTestResources { +processTestResources { inputs.properties(expansions) MavenFilteringHack.filter(it, expansions) } -internalClusterTest { +test { // this is tested explicitly in a separate test task exclude '**/AzureStorageCleanupThirdPartyTests.class' } testClusters { - yamlRestTest { + integTest { keystore 'azure.client.integration_test.account', azureAccount if (azureKey != null && azureKey.isEmpty() == false) { keystore 'azure.client.integration_test.key', azureKey @@ -136,11 +134,7 @@ testClusters { } task azureThirdPartyTest(type: Test) { - SourceSetContainer sourceSets = project.getExtensions().getByType(SourceSetContainer.class); - SourceSet internalTestSourceSet = sourceSets.getByName(InternalClusterTestPlugin.SOURCE_SET_NAME) - setTestClassesDirs(internalTestSourceSet.getOutput().getClassesDirs()) - dependsOn tasks.internalClusterTest - setClasspath(internalTestSourceSet.getRuntimeClasspath()) + dependsOn tasks.integTest include '**/AzureStorageCleanupThirdPartyTests.class' systemProperty 'test.azure.account', azureAccount ? azureAccount : "" systemProperty 'test.azure.key', azureKey ? azureKey : "" diff --git a/plugins/repository-azure/src/internalClusterTest/java/org/elasticsearch/repositories/azure/AzureBlobStoreRepositoryTests.java b/plugins/repository-azure/src/test/java/org/elasticsearch/repositories/azure/AzureBlobStoreRepositoryTests.java similarity index 100% rename from plugins/repository-azure/src/internalClusterTest/java/org/elasticsearch/repositories/azure/AzureBlobStoreRepositoryTests.java rename to plugins/repository-azure/src/test/java/org/elasticsearch/repositories/azure/AzureBlobStoreRepositoryTests.java diff --git a/plugins/repository-azure/src/internalClusterTest/java/org/elasticsearch/repositories/azure/AzureStorageCleanupThirdPartyTests.java b/plugins/repository-azure/src/test/java/org/elasticsearch/repositories/azure/AzureStorageCleanupThirdPartyTests.java similarity index 100% rename from plugins/repository-azure/src/internalClusterTest/java/org/elasticsearch/repositories/azure/AzureStorageCleanupThirdPartyTests.java rename to plugins/repository-azure/src/test/java/org/elasticsearch/repositories/azure/AzureStorageCleanupThirdPartyTests.java diff --git a/plugins/repository-azure/src/yamlRestTest/java/org/elasticsearch/repositories/azure/RepositoryAzureClientYamlTestSuiteIT.java b/plugins/repository-azure/src/test/java/org/elasticsearch/repositories/azure/RepositoryAzureClientYamlTestSuiteIT.java similarity index 100% rename from plugins/repository-azure/src/yamlRestTest/java/org/elasticsearch/repositories/azure/RepositoryAzureClientYamlTestSuiteIT.java rename to plugins/repository-azure/src/test/java/org/elasticsearch/repositories/azure/RepositoryAzureClientYamlTestSuiteIT.java diff --git a/plugins/repository-azure/src/yamlRestTest/resources/rest-api-spec/test/repository_azure/10_basic.yml b/plugins/repository-azure/src/test/resources/rest-api-spec/test/repository_azure/10_basic.yml similarity index 100% rename from plugins/repository-azure/src/yamlRestTest/resources/rest-api-spec/test/repository_azure/10_basic.yml rename to plugins/repository-azure/src/test/resources/rest-api-spec/test/repository_azure/10_basic.yml diff --git a/plugins/repository-azure/src/yamlRestTest/resources/rest-api-spec/test/repository_azure/20_repository.yml b/plugins/repository-azure/src/test/resources/rest-api-spec/test/repository_azure/20_repository.yml similarity index 100% rename from plugins/repository-azure/src/yamlRestTest/resources/rest-api-spec/test/repository_azure/20_repository.yml rename to plugins/repository-azure/src/test/resources/rest-api-spec/test/repository_azure/20_repository.yml From 885c84adb08116efbcbff1b3fc4b619f7887583b Mon Sep 17 00:00:00 2001 From: Jake Landis Date: Wed, 22 Jul 2020 14:14:59 -0500 Subject: [PATCH 21/26] minor --- plugins/discovery-azure-classic/build.gradle | 1 + .../azure/classic/AbstractAzureComputeServiceTestCase.java | 2 +- .../azure/classic/AzureDiscoveryClusterFormationTests.java | 3 +-- .../discovery/azure/classic/AzureSimpleTests.java | 4 ++-- .../discovery/azure/classic/AzureTwoStartedNodesTests.java | 5 ++--- 5 files changed, 7 insertions(+), 8 deletions(-) rename plugins/discovery-azure-classic/src/internalClusterTest/java/{ => org}/elasticsearch/cloud/azure/classic/AbstractAzureComputeServiceTestCase.java (99%) rename plugins/discovery-azure-classic/src/internalClusterTest/java/{ => org}/elasticsearch/discovery/azure/classic/AzureDiscoveryClusterFormationTests.java (99%) rename plugins/discovery-azure-classic/src/internalClusterTest/java/{ => org}/elasticsearch/discovery/azure/classic/AzureSimpleTests.java (95%) rename plugins/discovery-azure-classic/src/internalClusterTest/java/{ => org}/elasticsearch/discovery/azure/classic/AzureTwoStartedNodesTests.java (92%) diff --git a/plugins/discovery-azure-classic/build.gradle b/plugins/discovery-azure-classic/build.gradle index 328726100c810..8bb934befb7aa 100644 --- a/plugins/discovery-azure-classic/build.gradle +++ b/plugins/discovery-azure-classic/build.gradle @@ -90,6 +90,7 @@ task createKey(type: LoggedExec) { '-keypass', 'keypass', '-storepass', 'keypass' } +//no unit tests test.enabled = false // add keystore to test classpath: it expects it there processInternalClusterTestResources { diff --git a/plugins/discovery-azure-classic/src/internalClusterTest/java/elasticsearch/cloud/azure/classic/AbstractAzureComputeServiceTestCase.java b/plugins/discovery-azure-classic/src/internalClusterTest/java/org/elasticsearch/cloud/azure/classic/AbstractAzureComputeServiceTestCase.java similarity index 99% rename from plugins/discovery-azure-classic/src/internalClusterTest/java/elasticsearch/cloud/azure/classic/AbstractAzureComputeServiceTestCase.java rename to plugins/discovery-azure-classic/src/internalClusterTest/java/org/elasticsearch/cloud/azure/classic/AbstractAzureComputeServiceTestCase.java index b763b2bfe7555..7ad1343557c1b 100644 --- a/plugins/discovery-azure-classic/src/internalClusterTest/java/elasticsearch/cloud/azure/classic/AbstractAzureComputeServiceTestCase.java +++ b/plugins/discovery-azure-classic/src/internalClusterTest/java/org/elasticsearch/cloud/azure/classic/AbstractAzureComputeServiceTestCase.java @@ -17,7 +17,7 @@ * under the License. */ -package elasticsearch.cloud.azure.classic; +package org.elasticsearch.cloud.azure.classic; import com.microsoft.windowsazure.management.compute.models.DeploymentSlot; import com.microsoft.windowsazure.management.compute.models.DeploymentStatus; diff --git a/plugins/discovery-azure-classic/src/internalClusterTest/java/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/internalClusterTest/java/elasticsearch/discovery/azure/classic/AzureDiscoveryClusterFormationTests.java rename to plugins/discovery-azure-classic/src/internalClusterTest/java/org/elasticsearch/discovery/azure/classic/AzureDiscoveryClusterFormationTests.java index 7fccbc7745b65..5c45664235615 100644 --- a/plugins/discovery-azure-classic/src/internalClusterTest/java/elasticsearch/discovery/azure/classic/AzureDiscoveryClusterFormationTests.java +++ b/plugins/discovery-azure-classic/src/internalClusterTest/java/org/elasticsearch/discovery/azure/classic/AzureDiscoveryClusterFormationTests.java @@ -17,7 +17,7 @@ * under the License. */ -package elasticsearch.discovery.azure.classic; +package org.elasticsearch.discovery.azure.classic; import com.microsoft.windowsazure.management.compute.models.DeploymentSlot; import com.microsoft.windowsazure.management.compute.models.DeploymentStatus; @@ -32,7 +32,6 @@ import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.discovery.DiscoveryModule; -import org.elasticsearch.discovery.azure.classic.AzureSeedHostsProvider; import org.elasticsearch.env.Environment; import org.elasticsearch.mocksocket.MockHttpServer; import org.elasticsearch.node.Node; diff --git a/plugins/discovery-azure-classic/src/internalClusterTest/java/elasticsearch/discovery/azure/classic/AzureSimpleTests.java b/plugins/discovery-azure-classic/src/internalClusterTest/java/org/elasticsearch/discovery/azure/classic/AzureSimpleTests.java similarity index 95% rename from plugins/discovery-azure-classic/src/internalClusterTest/java/elasticsearch/discovery/azure/classic/AzureSimpleTests.java rename to plugins/discovery-azure-classic/src/internalClusterTest/java/org/elasticsearch/discovery/azure/classic/AzureSimpleTests.java index 925dc4ad200df..af891da340731 100644 --- a/plugins/discovery-azure-classic/src/internalClusterTest/java/elasticsearch/discovery/azure/classic/AzureSimpleTests.java +++ b/plugins/discovery-azure-classic/src/internalClusterTest/java/org/elasticsearch/discovery/azure/classic/AzureSimpleTests.java @@ -17,9 +17,9 @@ * under the License. */ -package elasticsearch.discovery.azure.classic; +package org.elasticsearch.discovery.azure.classic; -import elasticsearch.cloud.azure.classic.AbstractAzureComputeServiceTestCase; +import org.elasticsearch.cloud.azure.classic.AbstractAzureComputeServiceTestCase; import org.elasticsearch.cloud.azure.classic.management.AzureComputeService.Discovery; import org.elasticsearch.cloud.azure.classic.management.AzureComputeService.Management; import org.elasticsearch.common.settings.Settings; diff --git a/plugins/discovery-azure-classic/src/internalClusterTest/java/elasticsearch/discovery/azure/classic/AzureTwoStartedNodesTests.java b/plugins/discovery-azure-classic/src/internalClusterTest/java/org/elasticsearch/discovery/azure/classic/AzureTwoStartedNodesTests.java similarity index 92% rename from plugins/discovery-azure-classic/src/internalClusterTest/java/elasticsearch/discovery/azure/classic/AzureTwoStartedNodesTests.java rename to plugins/discovery-azure-classic/src/internalClusterTest/java/org/elasticsearch/discovery/azure/classic/AzureTwoStartedNodesTests.java index 6ef3972e66286..cdfe57d41c9de 100644 --- a/plugins/discovery-azure-classic/src/internalClusterTest/java/elasticsearch/discovery/azure/classic/AzureTwoStartedNodesTests.java +++ b/plugins/discovery-azure-classic/src/internalClusterTest/java/org/elasticsearch/discovery/azure/classic/AzureTwoStartedNodesTests.java @@ -17,13 +17,12 @@ * under the License. */ -package elasticsearch.discovery.azure.classic; +package org.elasticsearch.discovery.azure.classic; -import elasticsearch.cloud.azure.classic.AbstractAzureComputeServiceTestCase; +import org.elasticsearch.cloud.azure.classic.AbstractAzureComputeServiceTestCase; import org.elasticsearch.cloud.azure.classic.management.AzureComputeService.Discovery; import org.elasticsearch.cloud.azure.classic.management.AzureComputeService.Management; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.discovery.azure.classic.AzureSeedHostsProvider; import org.elasticsearch.test.ESIntegTestCase; @ESIntegTestCase.ClusterScope(scope = ESIntegTestCase.Scope.TEST, From 4ea875a6179de15305825d38e53a20218b6158eb Mon Sep 17 00:00:00 2001 From: Jake Landis Date: Wed, 22 Jul 2020 14:24:49 -0500 Subject: [PATCH 22/26] manually rollback discovery-* changes --- plugins/discovery-azure-classic/build.gradle | 9 ++-- .../AbstractAzureComputeServiceTestCase.java | 2 +- .../AzureDiscoveryClusterFormationTests.java | 3 +- .../azure/classic/AzureSimpleTests.java | 2 +- .../classic/AzureTwoStartedNodesTests.java | 2 +- ...veryAzureClassicClientYamlTestSuiteIT.java | 0 .../test/discovery_azure_classic/10_basic.yml | 0 plugins/discovery-ec2/build.gradle | 2 +- .../discovery-ec2/qa/amazon-ec2/build.gradle | 42 ++++++++----------- ...azonEC2DiscoveryClientYamlTestSuiteIT.java | 4 +- .../discovery/ec2/AmazonEC2Fixture.java | 2 +- .../test/discovery_ec2/10_basic.yml | 0 .../discovery/ec2/AbstractAwsTestCase.java | 1 - .../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 | 4 +- .../elasticsearch/cloud/gce/GCEFixture.java | 0 .../test/discovery_gce/10_basic.yml | 0 .../DiscoveryGceClientYamlTestSuiteIT.java | 0 .../discovery/gce/GceDiscoverTests.java | 0 .../test/discovery_gce/10_basic.yml | 0 23 files changed, 43 insertions(+), 51 deletions(-) rename plugins/discovery-azure-classic/src/{internalClusterTest => test}/java/org/elasticsearch/cloud/azure/classic/AbstractAzureComputeServiceTestCase.java (99%) rename plugins/discovery-azure-classic/src/{internalClusterTest => test}/java/org/elasticsearch/discovery/azure/classic/AzureDiscoveryClusterFormationTests.java (99%) rename plugins/discovery-azure-classic/src/{internalClusterTest => test}/java/org/elasticsearch/discovery/azure/classic/AzureSimpleTests.java (98%) rename plugins/discovery-azure-classic/src/{internalClusterTest => test}/java/org/elasticsearch/discovery/azure/classic/AzureTwoStartedNodesTests.java (98%) rename plugins/discovery-azure-classic/src/{yamlRestTest => test}/java/org/elasticsearch/discovery/azure/classic/DiscoveryAzureClassicClientYamlTestSuiteIT.java (100%) rename plugins/discovery-azure-classic/src/{yamlRestTest => test}/resources/rest-api-spec/test/discovery_azure_classic/10_basic.yml (100%) rename plugins/discovery-ec2/qa/amazon-ec2/src/{yamlRestTest => test}/java/org/elasticsearch/discovery/ec2/AmazonEC2DiscoveryClientYamlTestSuiteIT.java (92%) rename plugins/discovery-ec2/qa/amazon-ec2/src/{yamlRestTest => test}/java/org/elasticsearch/discovery/ec2/AmazonEC2Fixture.java (99%) rename plugins/discovery-ec2/qa/amazon-ec2/src/{yamlRestTest => test}/resources/rest-api-spec/test/discovery_ec2/10_basic.yml (100%) rename plugins/discovery-ec2/src/{yamlRestTest => test}/java/org/elasticsearch/discovery/ec2/CloudAwsClientYamlTestSuiteIT.java (100%) rename plugins/discovery-ec2/src/{yamlRestTest => test}/resources/rest-api-spec/test/discovery_ec2/10_basic.yml (100%) rename plugins/discovery-gce/qa/gce/src/{yamlRestTest => test}/java/org/elasticsearch/cloud/gce/GCEDiscoveryClientYamlTestSuiteIT.java (92%) rename plugins/discovery-gce/qa/gce/src/{yamlRestTest => test}/java/org/elasticsearch/cloud/gce/GCEFixture.java (100%) rename plugins/discovery-gce/qa/gce/src/{yamlRestTest => test}/resources/rest-api-spec/test/discovery_gce/10_basic.yml (100%) rename plugins/discovery-gce/src/{yamlRestTest => test}/java/org/elasticsearch/discovery/gce/DiscoveryGceClientYamlTestSuiteIT.java (100%) rename plugins/discovery-gce/src/{internalClusterTest => test}/java/org/elasticsearch/discovery/gce/GceDiscoverTests.java (100%) rename plugins/discovery-gce/src/{yamlRestTest => test}/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 8bb934befb7aa..bca5613bbfe56 100644 --- a/plugins/discovery-azure-classic/build.gradle +++ b/plugins/discovery-azure-classic/build.gradle @@ -19,8 +19,7 @@ import org.elasticsearch.gradle.info.BuildParams * specific language governing permissions and limitations * under the License. */ -apply plugin: 'elasticsearch.yaml-rest-test' -apply plugin: 'elasticsearch.internal-cluster-test' +apply plugin: 'elasticsearch.rest-resources' esplugin { description 'The Azure Classic Discovery plugin allows to use Azure Classic API for the unicast discovery mechanism' @@ -64,7 +63,6 @@ restResources { includeCore '_common', 'cluster', 'nodes' } } - // needed to be consistent with ssl host checking String host = InetAddress.getLoopbackAddress().getHostAddress() @@ -90,10 +88,9 @@ task createKey(type: LoggedExec) { '-keypass', 'keypass', '-storepass', 'keypass' } -//no unit tests -test.enabled = false + // add keystore to test classpath: it expects it there -processInternalClusterTestResources { +processTestResources { from createKey } diff --git a/plugins/discovery-azure-classic/src/internalClusterTest/java/org/elasticsearch/cloud/azure/classic/AbstractAzureComputeServiceTestCase.java b/plugins/discovery-azure-classic/src/test/java/org/elasticsearch/cloud/azure/classic/AbstractAzureComputeServiceTestCase.java similarity index 99% rename from plugins/discovery-azure-classic/src/internalClusterTest/java/org/elasticsearch/cloud/azure/classic/AbstractAzureComputeServiceTestCase.java rename to plugins/discovery-azure-classic/src/test/java/org/elasticsearch/cloud/azure/classic/AbstractAzureComputeServiceTestCase.java index 7ad1343557c1b..5bf825b0cd13c 100644 --- a/plugins/discovery-azure-classic/src/internalClusterTest/java/org/elasticsearch/cloud/azure/classic/AbstractAzureComputeServiceTestCase.java +++ b/plugins/discovery-azure-classic/src/test/java/org/elasticsearch/cloud/azure/classic/AbstractAzureComputeServiceTestCase.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-azure-classic/src/internalClusterTest/java/org/elasticsearch/discovery/azure/classic/AzureDiscoveryClusterFormationTests.java b/plugins/discovery-azure-classic/src/test/java/org/elasticsearch/discovery/azure/classic/AzureDiscoveryClusterFormationTests.java similarity index 99% rename from plugins/discovery-azure-classic/src/internalClusterTest/java/org/elasticsearch/discovery/azure/classic/AzureDiscoveryClusterFormationTests.java rename to plugins/discovery-azure-classic/src/test/java/org/elasticsearch/discovery/azure/classic/AzureDiscoveryClusterFormationTests.java index 5c45664235615..e723520f5c8b5 100644 --- a/plugins/discovery-azure-classic/src/internalClusterTest/java/org/elasticsearch/discovery/azure/classic/AzureDiscoveryClusterFormationTests.java +++ b/plugins/discovery-azure-classic/src/test/java/org/elasticsearch/discovery/azure/classic/AzureDiscoveryClusterFormationTests.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 @@ -72,6 +72,7 @@ @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/internalClusterTest/java/org/elasticsearch/discovery/azure/classic/AzureSimpleTests.java b/plugins/discovery-azure-classic/src/test/java/org/elasticsearch/discovery/azure/classic/AzureSimpleTests.java similarity index 98% rename from plugins/discovery-azure-classic/src/internalClusterTest/java/org/elasticsearch/discovery/azure/classic/AzureSimpleTests.java rename to plugins/discovery-azure-classic/src/test/java/org/elasticsearch/discovery/azure/classic/AzureSimpleTests.java index af891da340731..3c174de172e2a 100644 --- a/plugins/discovery-azure-classic/src/internalClusterTest/java/org/elasticsearch/discovery/azure/classic/AzureSimpleTests.java +++ b/plugins/discovery-azure-classic/src/test/java/org/elasticsearch/discovery/azure/classic/AzureSimpleTests.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-azure-classic/src/internalClusterTest/java/org/elasticsearch/discovery/azure/classic/AzureTwoStartedNodesTests.java b/plugins/discovery-azure-classic/src/test/java/org/elasticsearch/discovery/azure/classic/AzureTwoStartedNodesTests.java similarity index 98% rename from plugins/discovery-azure-classic/src/internalClusterTest/java/org/elasticsearch/discovery/azure/classic/AzureTwoStartedNodesTests.java rename to plugins/discovery-azure-classic/src/test/java/org/elasticsearch/discovery/azure/classic/AzureTwoStartedNodesTests.java index cdfe57d41c9de..79fced1801c15 100644 --- a/plugins/discovery-azure-classic/src/internalClusterTest/java/org/elasticsearch/discovery/azure/classic/AzureTwoStartedNodesTests.java +++ b/plugins/discovery-azure-classic/src/test/java/org/elasticsearch/discovery/azure/classic/AzureTwoStartedNodesTests.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-azure-classic/src/yamlRestTest/java/org/elasticsearch/discovery/azure/classic/DiscoveryAzureClassicClientYamlTestSuiteIT.java b/plugins/discovery-azure-classic/src/test/java/org/elasticsearch/discovery/azure/classic/DiscoveryAzureClassicClientYamlTestSuiteIT.java similarity index 100% rename from plugins/discovery-azure-classic/src/yamlRestTest/java/org/elasticsearch/discovery/azure/classic/DiscoveryAzureClassicClientYamlTestSuiteIT.java rename to plugins/discovery-azure-classic/src/test/java/org/elasticsearch/discovery/azure/classic/DiscoveryAzureClassicClientYamlTestSuiteIT.java diff --git a/plugins/discovery-azure-classic/src/yamlRestTest/resources/rest-api-spec/test/discovery_azure_classic/10_basic.yml b/plugins/discovery-azure-classic/src/test/resources/rest-api-spec/test/discovery_azure_classic/10_basic.yml similarity index 100% rename from plugins/discovery-azure-classic/src/yamlRestTest/resources/rest-api-spec/test/discovery_azure_classic/10_basic.yml rename to plugins/discovery-azure-classic/src/test/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 75388494fb6ca..7435571227992 100644 --- a/plugins/discovery-ec2/build.gradle +++ b/plugins/discovery-ec2/build.gradle @@ -18,7 +18,7 @@ import org.elasticsearch.gradle.info.BuildParams * specific language governing permissions and limitations * under the License. */ -apply plugin: 'elasticsearch.yaml-rest-test' +apply plugin: 'elasticsearch.rest-resources' 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 1f85a59de9e92..c7f94ef278b66 100644 --- a/plugins/discovery-ec2/qa/amazon-ec2/build.gradle +++ b/plugins/discovery-ec2/qa/amazon-ec2/build.gradle @@ -22,14 +22,15 @@ 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.yaml-rest-test' +apply plugin: 'elasticsearch.standalone-rest-test' +apply plugin: 'elasticsearch.rest-test' +apply plugin: 'elasticsearch.rest-resources' dependencies { - yamlRestTestImplementation project(':plugins:discovery-ec2') + testImplementation project(':plugins:discovery-ec2') } restResources { @@ -44,13 +45,13 @@ Map expansions = [ 'expected_nodes': ec2NumberOfNodes ] -processYamlRestTestResources { +processTestResources { inputs.properties(expansions) MavenFilteringHack.filter(it, expansions) } -// disable default yamlRestTest task, use spezialized ones below -yamlRestTest.enabled = false +// disable default test task, use spezialized ones below +integTest.enabled = false /* * Test using various credential providers (see also https://docs.aws.amazon.com/sdk-for-java/v2/developer-guide/credentials.html): @@ -65,26 +66,19 @@ yamlRestTest.enabled = false */ ['KeyStore', 'EnvVariables', 'SystemProperties', 'ContainerCredentials', 'InstanceProfile'].forEach { action -> AntFixture fixture = tasks.create(name: "ec2Fixture${action}", type: AntFixture) { - dependsOn compileYamlRestTestJava - env 'CLASSPATH', "${-> project.sourceSets.yamlRestTest.runtimeClasspath.asPath}" + dependsOn compileTestJava + env 'CLASSPATH', "${-> project.sourceSets.test.runtimeClasspath.asPath}" executable = "${BuildParams.runtimeJavaHome}/bin/java" - args 'org.elasticsearch.discovery.ec2.AmazonEC2Fixture', baseDir, "${buildDir}/testclusters/yamlRestTest${action}-1/config/unicast_hosts.txt" + args 'org.elasticsearch.discovery.ec2.AmazonEC2Fixture', baseDir, "${buildDir}/testclusters/integTest${action}-1/config/unicast_hosts.txt" } - tasks.create(name: "yamlRestTest${action}", type: RestIntegTestTask) { + tasks.create(name: "integTest${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}") - testClusters."yamlRestTest${action}" { + check.dependsOn("integTest${action}") + + testClusters."integTest${action}" { numberOfNodes = ec2NumberOfNodes plugin project(':plugins:discovery-ec2').bundlePlugin.archiveFile @@ -97,19 +91,19 @@ yamlRestTest.enabled = false } // Extra config for KeyStore -testClusters.yamlRestTestKeyStore { +testClusters.integTestKeyStore { 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.yamlRestTestEnvVariables { +testClusters.integTestEnvVariables { 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.yamlRestTestSystemProperties { +testClusters.integTestSystemProperties { systemProperty 'aws.accessKeyId', 'ec2_integration_test_access_key' systemProperty 'aws.secretKey', 'ec2_integration_test_secret_key' } @@ -117,7 +111,7 @@ testClusters.yamlRestTestSystemProperties { // Extra config for ContainerCredentials ec2FixtureContainerCredentials.env 'ACTIVATE_CONTAINER_CREDENTIALS', true -testClusters.yamlRestTestContainerCredentials { +testClusters.integTestContainerCredentials { 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/yamlRestTest/java/org/elasticsearch/discovery/ec2/AmazonEC2DiscoveryClientYamlTestSuiteIT.java b/plugins/discovery-ec2/qa/amazon-ec2/src/test/java/org/elasticsearch/discovery/ec2/AmazonEC2DiscoveryClientYamlTestSuiteIT.java similarity index 92% rename from plugins/discovery-ec2/qa/amazon-ec2/src/yamlRestTest/java/org/elasticsearch/discovery/ec2/AmazonEC2DiscoveryClientYamlTestSuiteIT.java rename to plugins/discovery-ec2/qa/amazon-ec2/src/test/java/org/elasticsearch/discovery/ec2/AmazonEC2DiscoveryClientYamlTestSuiteIT.java index 1894b69a6206d..09d5a8d6fdf28 100644 --- a/plugins/discovery-ec2/qa/amazon-ec2/src/yamlRestTest/java/org/elasticsearch/discovery/ec2/AmazonEC2DiscoveryClientYamlTestSuiteIT.java +++ b/plugins/discovery-ec2/qa/amazon-ec2/src/test/java/org/elasticsearch/discovery/ec2/AmazonEC2DiscoveryClientYamlTestSuiteIT.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 @@ -32,6 +32,6 @@ public AmazonEC2DiscoveryClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandi @ParametersFactory public static Iterable parameters() throws Exception { - return createParameters(); + return ESClientYamlSuiteTestCase.createParameters(); } } diff --git a/plugins/discovery-ec2/qa/amazon-ec2/src/yamlRestTest/java/org/elasticsearch/discovery/ec2/AmazonEC2Fixture.java b/plugins/discovery-ec2/qa/amazon-ec2/src/test/java/org/elasticsearch/discovery/ec2/AmazonEC2Fixture.java similarity index 99% rename from plugins/discovery-ec2/qa/amazon-ec2/src/yamlRestTest/java/org/elasticsearch/discovery/ec2/AmazonEC2Fixture.java rename to plugins/discovery-ec2/qa/amazon-ec2/src/test/java/org/elasticsearch/discovery/ec2/AmazonEC2Fixture.java index 1345b806226d5..ecaaceea5cc26 100644 --- a/plugins/discovery-ec2/qa/amazon-ec2/src/yamlRestTest/java/org/elasticsearch/discovery/ec2/AmazonEC2Fixture.java +++ b/plugins/discovery-ec2/qa/amazon-ec2/src/test/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/yamlRestTest/resources/rest-api-spec/test/discovery_ec2/10_basic.yml b/plugins/discovery-ec2/qa/amazon-ec2/src/test/resources/rest-api-spec/test/discovery_ec2/10_basic.yml similarity index 100% rename from plugins/discovery-ec2/qa/amazon-ec2/src/yamlRestTest/resources/rest-api-spec/test/discovery_ec2/10_basic.yml rename to plugins/discovery-ec2/qa/amazon-ec2/src/test/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/test/java/org/elasticsearch/discovery/ec2/AbstractAwsTestCase.java index 702de9ff40fb5..aef5bbeb86967 100644 --- a/plugins/discovery-ec2/src/test/java/org/elasticsearch/discovery/ec2/AbstractAwsTestCase.java +++ b/plugins/discovery-ec2/src/test/java/org/elasticsearch/discovery/ec2/AbstractAwsTestCase.java @@ -39,7 +39,6 @@ * in order to run these tests. */ @ThirdParty -//TODO: move this test case over to an internalClusterTest public abstract class AbstractAwsTestCase extends ESIntegTestCase { @Override diff --git a/plugins/discovery-ec2/src/yamlRestTest/java/org/elasticsearch/discovery/ec2/CloudAwsClientYamlTestSuiteIT.java b/plugins/discovery-ec2/src/test/java/org/elasticsearch/discovery/ec2/CloudAwsClientYamlTestSuiteIT.java similarity index 100% rename from plugins/discovery-ec2/src/yamlRestTest/java/org/elasticsearch/discovery/ec2/CloudAwsClientYamlTestSuiteIT.java rename to plugins/discovery-ec2/src/test/java/org/elasticsearch/discovery/ec2/CloudAwsClientYamlTestSuiteIT.java diff --git a/plugins/discovery-ec2/src/yamlRestTest/resources/rest-api-spec/test/discovery_ec2/10_basic.yml b/plugins/discovery-ec2/src/test/resources/rest-api-spec/test/discovery_ec2/10_basic.yml similarity index 100% rename from plugins/discovery-ec2/src/yamlRestTest/resources/rest-api-spec/test/discovery_ec2/10_basic.yml rename to plugins/discovery-ec2/src/test/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 8f44cccbf6593..70d50d80c5bce 100644 --- a/plugins/discovery-gce/build.gradle +++ b/plugins/discovery-gce/build.gradle @@ -1,5 +1,4 @@ -apply plugin: 'elasticsearch.yaml-rest-test' -apply plugin: 'elasticsearch.internal-cluster-test' +apply plugin: 'elasticsearch.rest-resources' 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 e10e5b7648b14..9ae4dc475fb89 100644 --- a/plugins/discovery-gce/qa/gce/build.gradle +++ b/plugins/discovery-gce/qa/gce/build.gradle @@ -24,12 +24,14 @@ import org.elasticsearch.gradle.test.AntFixture import static org.elasticsearch.gradle.PropertyNormalization.IGNORE_VALUE -apply plugin: 'elasticsearch.yaml-rest-test' +apply plugin: 'elasticsearch.standalone-rest-test' +apply plugin: 'elasticsearch.rest-test' +apply plugin: 'elasticsearch.rest-resources' final int gceNumberOfNodes = 3 dependencies { - yamlRestTestImplementation project(':plugins:discovery-gce') + testImplementation project(':plugins:discovery-gce') } restResources { @@ -40,26 +42,26 @@ restResources { /** A task to start the GCEFixture which emulates a GCE service **/ task gceFixture(type: AntFixture) { - dependsOn compileYamlRestTestJava - env 'CLASSPATH', "${-> project.sourceSets.yamlRestTest.runtimeClasspath.asPath}" + dependsOn compileTestJava + env 'CLASSPATH', "${-> project.sourceSets.test.runtimeClasspath.asPath}" executable = "${BuildParams.runtimeJavaHome}/bin/java" - args 'org.elasticsearch.cloud.gce.GCEFixture', baseDir, "${buildDir}/testclusters/yamlRestTest-1/config/unicast_hosts.txt" + args 'org.elasticsearch.cloud.gce.GCEFixture', baseDir, "${buildDir}/testclusters/integTest-1/config/unicast_hosts.txt" } Map expansions = [ 'expected_nodes': gceNumberOfNodes ] -processYamlRestTestResources { +processTestResources { inputs.properties(expansions) MavenFilteringHack.filter(it, expansions) } -yamlRestTest { +integTest { dependsOn gceFixture, project(':plugins:discovery-gce').bundlePlugin } -testClusters.yamlRestTest { +testClusters.integTest { 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/yamlRestTest/java/org/elasticsearch/cloud/gce/GCEDiscoveryClientYamlTestSuiteIT.java b/plugins/discovery-gce/qa/gce/src/test/java/org/elasticsearch/cloud/gce/GCEDiscoveryClientYamlTestSuiteIT.java similarity index 92% rename from plugins/discovery-gce/qa/gce/src/yamlRestTest/java/org/elasticsearch/cloud/gce/GCEDiscoveryClientYamlTestSuiteIT.java rename to plugins/discovery-gce/qa/gce/src/test/java/org/elasticsearch/cloud/gce/GCEDiscoveryClientYamlTestSuiteIT.java index 34bcfd6e21bf2..6c1ca9c72d3f8 100644 --- a/plugins/discovery-gce/qa/gce/src/yamlRestTest/java/org/elasticsearch/cloud/gce/GCEDiscoveryClientYamlTestSuiteIT.java +++ b/plugins/discovery-gce/qa/gce/src/test/java/org/elasticsearch/cloud/gce/GCEDiscoveryClientYamlTestSuiteIT.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 @@ -32,6 +32,6 @@ public GCEDiscoveryClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate t @ParametersFactory public static Iterable parameters() throws Exception { - return createParameters(); + return ESClientYamlSuiteTestCase.createParameters(); } } diff --git a/plugins/discovery-gce/qa/gce/src/yamlRestTest/java/org/elasticsearch/cloud/gce/GCEFixture.java b/plugins/discovery-gce/qa/gce/src/test/java/org/elasticsearch/cloud/gce/GCEFixture.java similarity index 100% rename from plugins/discovery-gce/qa/gce/src/yamlRestTest/java/org/elasticsearch/cloud/gce/GCEFixture.java rename to plugins/discovery-gce/qa/gce/src/test/java/org/elasticsearch/cloud/gce/GCEFixture.java diff --git a/plugins/discovery-gce/qa/gce/src/yamlRestTest/resources/rest-api-spec/test/discovery_gce/10_basic.yml b/plugins/discovery-gce/qa/gce/src/test/resources/rest-api-spec/test/discovery_gce/10_basic.yml similarity index 100% rename from plugins/discovery-gce/qa/gce/src/yamlRestTest/resources/rest-api-spec/test/discovery_gce/10_basic.yml rename to plugins/discovery-gce/qa/gce/src/test/resources/rest-api-spec/test/discovery_gce/10_basic.yml diff --git a/plugins/discovery-gce/src/yamlRestTest/java/org/elasticsearch/discovery/gce/DiscoveryGceClientYamlTestSuiteIT.java b/plugins/discovery-gce/src/test/java/org/elasticsearch/discovery/gce/DiscoveryGceClientYamlTestSuiteIT.java similarity index 100% rename from plugins/discovery-gce/src/yamlRestTest/java/org/elasticsearch/discovery/gce/DiscoveryGceClientYamlTestSuiteIT.java rename to plugins/discovery-gce/src/test/java/org/elasticsearch/discovery/gce/DiscoveryGceClientYamlTestSuiteIT.java diff --git a/plugins/discovery-gce/src/internalClusterTest/java/org/elasticsearch/discovery/gce/GceDiscoverTests.java b/plugins/discovery-gce/src/test/java/org/elasticsearch/discovery/gce/GceDiscoverTests.java similarity index 100% rename from plugins/discovery-gce/src/internalClusterTest/java/org/elasticsearch/discovery/gce/GceDiscoverTests.java rename to plugins/discovery-gce/src/test/java/org/elasticsearch/discovery/gce/GceDiscoverTests.java diff --git a/plugins/discovery-gce/src/yamlRestTest/resources/rest-api-spec/test/discovery_gce/10_basic.yml b/plugins/discovery-gce/src/test/resources/rest-api-spec/test/discovery_gce/10_basic.yml similarity index 100% rename from plugins/discovery-gce/src/yamlRestTest/resources/rest-api-spec/test/discovery_gce/10_basic.yml rename to plugins/discovery-gce/src/test/resources/rest-api-spec/test/discovery_gce/10_basic.yml From ea705a55a10d685ec52f7d2675ff2e4a070d45f4 Mon Sep 17 00:00:00 2001 From: Jake Landis Date: Wed, 22 Jul 2020 14:28:20 -0500 Subject: [PATCH 23/26] white space change --- .../example/CustomAuthorizationEngineIT.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/plugins/examples/security-authorization-engine/src/javaRestTest/java/org/elasticsearch/example/CustomAuthorizationEngineIT.java b/plugins/examples/security-authorization-engine/src/javaRestTest/java/org/elasticsearch/example/CustomAuthorizationEngineIT.java index 9c08993ae7f11..b9fa7ffd7e82d 100644 --- a/plugins/examples/security-authorization-engine/src/javaRestTest/java/org/elasticsearch/example/CustomAuthorizationEngineIT.java +++ b/plugins/examples/security-authorization-engine/src/javaRestTest/java/org/elasticsearch/example/CustomAuthorizationEngineIT.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 @@ -40,6 +40,7 @@ import java.util.Collections; import java.util.List; +import static org.elasticsearch.xpack.core.security.authc.support.UsernamePasswordToken.basicAuthHeaderValue; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.is; @@ -67,7 +68,7 @@ public void testClusterAction() throws IOException { { RequestOptions.Builder options = RequestOptions.DEFAULT.toBuilder(); options.addHeader(UsernamePasswordToken.BASIC_AUTH_HEADER, - UsernamePasswordToken.basicAuthHeaderValue("custom_user", new SecureString("x-pack-test-password".toCharArray()))); + basicAuthHeaderValue("custom_user", new SecureString("x-pack-test-password".toCharArray()))); Request request = new Request("GET", "_cluster/health"); request.setOptions(options); Response response = client().performRequest(request); @@ -79,7 +80,7 @@ public void testClusterAction() throws IOException { "x-pack-test-password".toCharArray(), true, RefreshPolicy.IMMEDIATE), RequestOptions.DEFAULT); RequestOptions.Builder options = RequestOptions.DEFAULT.toBuilder(); options.addHeader(UsernamePasswordToken.BASIC_AUTH_HEADER, - UsernamePasswordToken.basicAuthHeaderValue("custom_user2", new SecureString("x-pack-test-password".toCharArray()))); + basicAuthHeaderValue("custom_user2", new SecureString("x-pack-test-password".toCharArray()))); Request request = new Request("GET", "_cluster/health"); request.setOptions(options); ResponseException e = expectThrows(ResponseException.class, () -> client().performRequest(request)); @@ -95,7 +96,7 @@ public void testIndexAction() throws IOException { { RequestOptions.Builder options = RequestOptions.DEFAULT.toBuilder(); options.addHeader(UsernamePasswordToken.BASIC_AUTH_HEADER, - UsernamePasswordToken.basicAuthHeaderValue("custom_user", new SecureString("x-pack-test-password".toCharArray()))); + basicAuthHeaderValue("custom_user", new SecureString("x-pack-test-password".toCharArray()))); Request request = new Request("PUT", "/index"); request.setOptions(options); Response response = client().performRequest(request); @@ -107,7 +108,7 @@ public void testIndexAction() throws IOException { "x-pack-test-password".toCharArray(), true, RefreshPolicy.IMMEDIATE), RequestOptions.DEFAULT); RequestOptions.Builder options = RequestOptions.DEFAULT.toBuilder(); options.addHeader(UsernamePasswordToken.BASIC_AUTH_HEADER, - UsernamePasswordToken.basicAuthHeaderValue("custom_user2", new SecureString("x-pack-test-password".toCharArray()))); + basicAuthHeaderValue("custom_user2", new SecureString("x-pack-test-password".toCharArray()))); Request request = new Request("PUT", "/index"); request.setOptions(options); ResponseException e = expectThrows(ResponseException.class, () -> client().performRequest(request)); @@ -140,7 +141,7 @@ public void testRunAs() throws IOException { { RequestOptions.Builder options = RequestOptions.DEFAULT.toBuilder(); options.addHeader(UsernamePasswordToken.BASIC_AUTH_HEADER, - UsernamePasswordToken.basicAuthHeaderValue("custom_user", new SecureString("x-pack-test-password".toCharArray()))); + basicAuthHeaderValue("custom_user", new SecureString("x-pack-test-password".toCharArray()))); options.addHeader("es-security-runas-user", "custom_user3"); Request request = new Request("PUT", "/index"); request.setOptions(options); @@ -151,7 +152,7 @@ public void testRunAs() throws IOException { { RequestOptions.Builder options = RequestOptions.DEFAULT.toBuilder(); options.addHeader(UsernamePasswordToken.BASIC_AUTH_HEADER, - UsernamePasswordToken.basicAuthHeaderValue("custom_user3", new SecureString("x-pack-test-password".toCharArray()))); + basicAuthHeaderValue("custom_user3", new SecureString("x-pack-test-password".toCharArray()))); options.addHeader("es-security-runas-user", "custom_user2"); Request request = new Request("PUT", "/index"); request.setOptions(options); From c89b5de16f777a00a7be76280565debd6014728f Mon Sep 17 00:00:00 2001 From: Jake Landis Date: Wed, 22 Jul 2020 14:30:25 -0500 Subject: [PATCH 24/26] more nits --- .../org/elasticsearch/example/CustomAuthorizationEngineIT.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/examples/security-authorization-engine/src/javaRestTest/java/org/elasticsearch/example/CustomAuthorizationEngineIT.java b/plugins/examples/security-authorization-engine/src/javaRestTest/java/org/elasticsearch/example/CustomAuthorizationEngineIT.java index b9fa7ffd7e82d..4342b2a4b88f0 100644 --- a/plugins/examples/security-authorization-engine/src/javaRestTest/java/org/elasticsearch/example/CustomAuthorizationEngineIT.java +++ b/plugins/examples/security-authorization-engine/src/javaRestTest/java/org/elasticsearch/example/CustomAuthorizationEngineIT.java @@ -128,7 +128,7 @@ public void testRunAs() throws IOException { { RequestOptions.Builder options = RequestOptions.DEFAULT.toBuilder(); options.addHeader(UsernamePasswordToken.BASIC_AUTH_HEADER, - UsernamePasswordToken.basicAuthHeaderValue("custom_user", new SecureString("x-pack-test-password".toCharArray()))); + basicAuthHeaderValue("custom_user", new SecureString("x-pack-test-password".toCharArray()))); options.addHeader("es-security-runas-user", "custom_user2"); Request request = new Request("GET", "/_security/_authenticate"); request.setOptions(options); From 849d19db73f47c21baaa3cb591d28521bd9e6294 Mon Sep 17 00:00:00 2001 From: Jake Landis Date: Thu, 23 Jul 2020 14:02:29 -0500 Subject: [PATCH 25/26] runtimeClasspath and unecessary variable --- plugins/analysis-icu/build.gradle | 8 +++----- plugins/examples/rest-handler/build.gradle | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/plugins/analysis-icu/build.gradle b/plugins/analysis-icu/build.gradle index d9bbb58915408..84106289c6abd 100644 --- a/plugins/analysis-icu/build.gradle +++ b/plugins/analysis-icu/build.gradle @@ -26,12 +26,10 @@ esplugin { classname 'org.elasticsearch.plugin.analysis.icu.AnalysisICUPlugin' } -List forbidden_signatures = new ArrayList<>([ - "com.ibm.icu.text.Collator#getInstance() @ Don't use default locale, use getInstance(ULocale) instead" -]) - forbiddenApisMain { - signatures += forbidden_signatures + signatures += [ + "com.ibm.icu.text.Collator#getInstance() @ Don't use default locale, use getInstance(ULocale) instead" + ] } dependencies { diff --git a/plugins/examples/rest-handler/build.gradle b/plugins/examples/rest-handler/build.gradle index 1a0e48385ba81..672ab436473d8 100644 --- a/plugins/examples/rest-handler/build.gradle +++ b/plugins/examples/rest-handler/build.gradle @@ -34,7 +34,7 @@ esplugin { test.enabled = false tasks.register("exampleFixture", org.elasticsearch.gradle.test.AntFixture) { - dependsOn javaRestTestClasses + dependsOn sourceSets.javaRestTest.runtimeClasspath env 'CLASSPATH', "${-> project.sourceSets.javaRestTest.runtimeClasspath.asPath}" executable = "${BuildParams.runtimeJavaHome}/bin/java" args 'org.elasticsearch.example.resthandler.ExampleFixture', baseDir, 'TEST' From ef3466837535242c2d0c4be28241bde6ff2af951 Mon Sep 17 00:00:00 2001 From: Jake Landis Date: Thu, 23 Jul 2020 14:21:27 -0500 Subject: [PATCH 26/26] remove GradleUtils from build script --- .../examples/security-authorization-engine/build.gradle | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/plugins/examples/security-authorization-engine/build.gradle b/plugins/examples/security-authorization-engine/build.gradle index c68e128625fa1..c6f2b7cf77ef9 100644 --- a/plugins/examples/security-authorization-engine/build.gradle +++ b/plugins/examples/security-authorization-engine/build.gradle @@ -1,8 +1,6 @@ apply plugin: 'elasticsearch.esplugin' apply plugin: 'elasticsearch.java-rest-test' -import org.elasticsearch.gradle.util.GradleUtils - esplugin { name 'security-authorization-engine' description 'An example spi extension plugin for security that implements an Authorization Engine' @@ -12,13 +10,12 @@ esplugin { noticeFile rootProject.file('NOTICE.txt') } -// let the javaRestTest see the classpath of main -GradleUtils.extendSourceSet(project, "main", "javaRestTest") - dependencies { compileOnly "org.elasticsearch.plugin:x-pack-core:${versions.elasticsearch}" javaRestTestImplementation "org.elasticsearch.plugin:x-pack-core:${versions.elasticsearch}" javaRestTestImplementation "org.elasticsearch.client:elasticsearch-rest-high-level-client:${versions.elasticsearch}" + // let the javaRestTest see the classpath of main + javaRestTestImplementation project.sourceSets.main.runtimeClasspath } //no unit tests test.enabled = false