From 4716151e6b292d903de1c3ab1e03405ea92aab42 Mon Sep 17 00:00:00 2001 From: Jake Landis Date: Mon, 12 Jul 2021 15:59:24 -0500 Subject: [PATCH 1/6] Update task names for rest compatiblity --- .../rest/compat/YamlRestCompatTestPlugin.java | 13 +++++++------ .../gradle/internal/test/rest/RestTestUtil.java | 11 +++++++++-- modules/analysis-common/build.gradle | 2 +- modules/geo/build.gradle | 2 +- modules/ingest-common/build.gradle | 2 +- modules/ingest-user-agent/build.gradle | 2 +- modules/lang-mustache/build.gradle | 2 +- modules/lang-painless/build.gradle | 2 +- modules/parent-join/build.gradle | 2 +- modules/percolator/build.gradle | 2 +- modules/reindex/build.gradle | 4 ++-- modules/repository-url/build.gradle | 2 +- plugins/analysis-icu/build.gradle | 2 +- plugins/ingest-attachment/build.gradle | 2 +- rest-api-spec/build.gradle | 4 ++-- x-pack/plugin/build.gradle | 6 +++--- x-pack/plugin/watcher/qa/rest/build.gradle | 4 ++-- 17 files changed, 36 insertions(+), 28 deletions(-) diff --git a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/rest/compat/YamlRestCompatTestPlugin.java b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/rest/compat/YamlRestCompatTestPlugin.java index b104d1aa3df77..7eb7f26a4b8f8 100644 --- a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/rest/compat/YamlRestCompatTestPlugin.java +++ b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/rest/compat/YamlRestCompatTestPlugin.java @@ -43,8 +43,8 @@ * Apply this plugin to run the YAML based REST tests from a prior major version against this version's cluster. */ public class YamlRestCompatTestPlugin implements Plugin { - public static final String REST_COMPAT_CHECK_TASK_NAME = "checkRestCompat"; - public static final String SOURCE_SET_NAME = "yamlRestCompatTest"; + private static final String REST_COMPAT_CHECK_TASK_NAME = "checkRestCompat"; + private static final String SOURCE_SET_NAME = "yamlRestCompatTest"; private static final Path RELATIVE_API_PATH = Path.of("rest-api-spec/api"); private static final Path RELATIVE_TEST_PATH = Path.of("rest-api-spec/test"); private static final Path RELATIVE_REST_API_RESOURCES = Path.of("rest-api-spec/src/main/resources"); @@ -140,7 +140,7 @@ public void apply(Project project) { // transform the copied tests task TaskProvider transformCompatTestTask = project.getTasks() - .register("transformV" + compatibleVersion + "RestTests", RestCompatTestTransformTask.class, task -> { + .register("transformV" + compatibleVersion + "RestCompatTests", RestCompatTestTransformTask.class, task -> { task.getSourceDirectory().set(copyCompatYamlTestTask.flatMap(CopyRestTestsTask::getOutputResourceDir)); task.getOutputDirectory() .set(project.getLayout().getBuildDirectory().dir(compatTestsDir.resolve("transformed").toString())); @@ -161,9 +161,10 @@ public void apply(Project project) { .named(RestResourcesPlugin.COPY_YAML_TESTS_TASK) .flatMap(CopyRestTestsTask::getOutputResourceDir); - // setup the yamlRestTest task - Provider yamlRestCompatTestTask = RestTestUtil.registerTestTask(project, yamlCompatTestSourceSet); - project.getTasks().withType(RestIntegTestTask.class).named(SOURCE_SET_NAME).configure(testTask -> { + // setup the test task + String testTaskName = "yamlRestTestV"+ compatibleVersion + "Compat"; + Provider yamlRestCompatTestTask = RestTestUtil.registerTestTask(project, yamlCompatTestSourceSet, testTaskName); + project.getTasks().withType(RestIntegTestTask.class).named(testTaskName).configure(testTask -> { // Use test runner and classpath from "normal" yaml source set testTask.setTestClassesDirs( yamlTestSourceSet.getOutput().getClassesDirs().plus(yamlCompatTestSourceSet.getOutput().getClassesDirs()) diff --git a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/RestTestUtil.java b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/RestTestUtil.java index 9b83bccaaa168..42965436daaeb 100644 --- a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/RestTestUtil.java +++ b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/RestTestUtil.java @@ -28,11 +28,18 @@ private RestTestUtil() { } /** - * Creates a task with the source set name of type {@link RestIntegTestTask} + * Creates a {@link RestIntegTestTask} task with the source set of the same name */ public static Provider registerTestTask(Project project, SourceSet sourceSet) { + return registerTestTask(project, sourceSet, sourceSet.getName()); + } + + /** + * Creates a {@link RestIntegTestTask} task with a custom name for the provided source set + */ + public static Provider registerTestTask(Project project, SourceSet sourceSet, String taskName) { // lazily create the test task - return project.getTasks().register(sourceSet.getName(), RestIntegTestTask.class, testTask -> { + return project.getTasks().register(taskName, RestIntegTestTask.class, testTask -> { testTask.setGroup(JavaBasePlugin.VERIFICATION_GROUP); testTask.setDescription("Runs the REST tests against an external cluster"); project.getPlugins().withType(JavaPlugin.class, t -> diff --git a/modules/analysis-common/build.gradle b/modules/analysis-common/build.gradle index 4b4cdfd4d75a4..aa25803105414 100644 --- a/modules/analysis-common/build.gradle +++ b/modules/analysis-common/build.gradle @@ -25,7 +25,7 @@ dependencies { compileOnly project(':modules:lang-painless') } -tasks.named("yamlRestCompatTest").configure { +tasks.named("yamlRestTestV7Compat").configure { systemProperty 'tests.rest.blacklist', [ 'search.query/50_queries_with_synonyms/Test common terms query with stacked tokens', 'indices.analyze/10_analyze/htmlStrip_deprecated', diff --git a/modules/geo/build.gradle b/modules/geo/build.gradle index 1c8537df6fc25..33187dff0afc7 100644 --- a/modules/geo/build.gradle +++ b/modules/geo/build.gradle @@ -29,5 +29,5 @@ if (BuildParams.inFipsJvm){ // The geo module is replaced by spatial in the default distribution and in FIPS 140 mode, we set the testclusters to // use the default distribution, so there is no need to run these tests tasks.named("yamlRestTest").configure{enabled = false } - tasks.named("yamlRestCompatTest").configure{enabled = false } + tasks.named("yamlRestTestV7Compat").configure{enabled = false } } diff --git a/modules/ingest-common/build.gradle b/modules/ingest-common/build.gradle index 97b6f29a91324..29ee223b8314c 100644 --- a/modules/ingest-common/build.gradle +++ b/modules/ingest-common/build.gradle @@ -44,7 +44,7 @@ tasks.named("thirdPartyAudit").configure { ) } -tasks.named("yamlRestCompatTest").configure { +tasks.named("yamlRestTestV7Compat").configure { systemProperty 'tests.rest.blacklist', [ 'ingest/80_foreach/Test foreach Processor', 'ingest/230_change_target_index/Test Change Target Index with Explicit Pipeline', diff --git a/modules/ingest-user-agent/build.gradle b/modules/ingest-user-agent/build.gradle index d28dab21e598a..2f53e89c337e8 100644 --- a/modules/ingest-user-agent/build.gradle +++ b/modules/ingest-user-agent/build.gradle @@ -23,7 +23,7 @@ testClusters.all { extraConfigFile 'ingest-user-agent/test-regexes.yml', file('src/test/test-regexes.yml') } -tasks.named("yamlRestCompatTest").configure { +tasks.named("yamlRestTestV7Compat").configure { systemProperty 'tests.rest.blacklist', [ 'ingest-useragent/30_custom_regex/Test user agent processor with custom regex file', 'ingest-useragent/20_useragent_processor/Test user agent processor with parameters' diff --git a/modules/lang-mustache/build.gradle b/modules/lang-mustache/build.gradle index 319061d6c5a3b..a8cf43f445b9f 100644 --- a/modules/lang-mustache/build.gradle +++ b/modules/lang-mustache/build.gradle @@ -26,7 +26,7 @@ restResources { } } -tasks.named("yamlRestCompatTest").configure { +tasks.named("yamlRestTestV7Compat").configure { systemProperty 'tests.rest.blacklist', [ 'lang_mustache/60_typed_keys/Multisearch template with typed_keys parameter', 'lang_mustache/60_typed_keys/Search template with typed_keys parameter' diff --git a/modules/lang-painless/build.gradle b/modules/lang-painless/build.gradle index 819f193562cff..fd5ef5037325e 100644 --- a/modules/lang-painless/build.gradle +++ b/modules/lang-painless/build.gradle @@ -49,7 +49,7 @@ tasks.named("test").configure { jvmArgs '-XX:-OmitStackTraceInFastThrow', '-XX:-HeapDumpOnOutOfMemoryError' } -tasks.named("yamlRestCompatTest").configure { +tasks.named("yamlRestTestV7Compat").configure { systemProperty 'tests.rest.blacklist', [ ].join(',') } diff --git a/modules/parent-join/build.gradle b/modules/parent-join/build.gradle index 78ba7688c1b70..83aa2c2e54641 100644 --- a/modules/parent-join/build.gradle +++ b/modules/parent-join/build.gradle @@ -20,7 +20,7 @@ restResources { } } -tasks.named("yamlRestCompatTest").configure { +tasks.named("yamlRestTestV7Compat").configure { systemProperty 'tests.rest.blacklist', [ '/30_inner_hits/Test two sub-queries with only one having inner_hits' ].join(',') diff --git a/modules/percolator/build.gradle b/modules/percolator/build.gradle index 81936f44a7ec6..b749762da5328 100644 --- a/modules/percolator/build.gradle +++ b/modules/percolator/build.gradle @@ -25,6 +25,6 @@ restResources { } } -tasks.named("transformV7RestTests").configure({ task -> +tasks.named("transformV7RestCompatTests").configure({ task -> task.addAllowedWarningRegex("\\[types removal\\].*") }) diff --git a/modules/reindex/build.gradle b/modules/reindex/build.gradle index 960b310af6946..6f28abd54a214 100644 --- a/modules/reindex/build.gradle +++ b/modules/reindex/build.gradle @@ -164,7 +164,7 @@ if (Os.isFamily(Os.FAMILY_WINDOWS)) { } } } -tasks.named("transformV7RestTests").configure({ task -> +tasks.named("transformV7RestCompatTests").configure({ task -> task.addAllowedWarningRegex("\\[types removal\\].*") }) @@ -175,7 +175,7 @@ def v7compatibilityNotSupportedTests = { ] } -tasks.named("yamlRestCompatTest").configure { +tasks.named("yamlRestTestV7Compat").configure { systemProperty 'tests.rest.blacklist', v7compatibilityNotSupportedTests().join(',') } diff --git a/modules/repository-url/build.gradle b/modules/repository-url/build.gradle index d003380519512..4717d2061c080 100644 --- a/modules/repository-url/build.gradle +++ b/modules/repository-url/build.gradle @@ -63,7 +63,7 @@ testClusters.all { }, PropertyNormalization.IGNORE_VALUE } -tasks.named("yamlRestCompatTest").configure { +tasks.named("yamlRestTestV7Compat").configure { systemProperty 'tests.rest.blacklist', [ 'repository_url/10_basic/Get a non existing snapshot', 'repository_url/10_basic/Restore with repository-url using http://', diff --git a/plugins/analysis-icu/build.gradle b/plugins/analysis-icu/build.gradle index b41cd5b93f923..52349b29b72a4 100644 --- a/plugins/analysis-icu/build.gradle +++ b/plugins/analysis-icu/build.gradle @@ -37,7 +37,7 @@ tasks.named("dependencyLicenses").configure { mapping from: /lucene-.*/, to: 'lucene' } -tasks.named("yamlRestCompatTest").configure { +tasks.named("yamlRestTestV7Compat").configure { systemProperty 'tests.rest.blacklist', [ 'analysis_icu/10_basic/Normalization with deprecated unicodeSetFilter' ].join(',') diff --git a/plugins/ingest-attachment/build.gradle b/plugins/ingest-attachment/build.gradle index 0f5f7a4031789..5e13bc872c0cb 100644 --- a/plugins/ingest-attachment/build.gradle +++ b/plugins/ingest-attachment/build.gradle @@ -96,6 +96,6 @@ if (BuildParams.inFipsJvm) { tasks.named("jarHell").configure { enabled = false } tasks.named("test").configure { enabled = false } tasks.named("yamlRestTest").configure { enabled = false }; - tasks.named("yamlRestCompatTest").configure { enabled = false }; + tasks.named("yamlRestTestV7Compat").configure { enabled = false }; tasks.named("testingConventions").configure { enabled = false }; } diff --git a/rest-api-spec/build.gradle b/rest-api-spec/build.gradle index 81a8bc75d997b..5d9aff74d962f 100644 --- a/rest-api-spec/build.gradle +++ b/rest-api-spec/build.gradle @@ -74,7 +74,7 @@ def v7compatibilityNotSupportedTests = { 'indices.upgrade/*/*' ] } -tasks.named("yamlRestCompatTest").configure { +tasks.named("yamlRestTestV7Compat").configure { onlyIf { // Skip these tests on Windows since the blacklist exceeds Windows CLI limits OS.current() != OS.WINDOWS @@ -103,7 +103,7 @@ tasks.named("yamlRestCompatTest").configure { .join(',') } -tasks.named("transformV7RestTests").configure({ task -> +tasks.named("transformV7RestCompatTests").configure({ task -> task.replaceValueInMatch("_type", "_doc") task.addAllowedWarningRegex("\\[types removal\\].*") task.replaceValueInMatch("nodes.\$node_id.roles.8", "ml", "node_info role test") diff --git a/x-pack/plugin/build.gradle b/x-pack/plugin/build.gradle index 2c3ba2f2686f5..01b58aacc1d07 100644 --- a/x-pack/plugin/build.gradle +++ b/x-pack/plugin/build.gradle @@ -94,7 +94,7 @@ tasks.named("yamlRestTest").configure { dependsOn "copyExtraResources" } -tasks.named("transformV7RestTests").configure({ task -> +tasks.named("transformV7RestCompatTests").configure({ task -> task.replaceKeyInDo("license.delete", "xpack-license.delete") task.replaceKeyInDo("license.get", "xpack-license.get") task.replaceKeyInDo("license.get_basic_status", "xpack-license.get_basic_status") @@ -142,7 +142,7 @@ def v7compatibilityNotSupportedTests = { ] } -tasks.named("yamlRestCompatTest").configure { +tasks.named("yamlRestTestV7Compat").configure { /* * We have to disable setting the number of available processors as tests in the same JVM randomize processors and will step on each * other if we allow them to set the number of available processors as it's set-once in Netty. @@ -217,7 +217,7 @@ tasks.named("precommit").configure { dependsOn 'enforceYamlTestConvention', 'enforceApiSpecsConvention' } -tasks.named("transformV7RestTests").configure({ task -> +tasks.named("transformV7RestCompatTests").configure({ task -> task.replaceValueInMatch("_type", "_doc") task.addAllowedWarningRegex("\\[types removal\\].*") }) diff --git a/x-pack/plugin/watcher/qa/rest/build.gradle b/x-pack/plugin/watcher/qa/rest/build.gradle index 5cf58720fc374..e932f652bc35a 100644 --- a/x-pack/plugin/watcher/qa/rest/build.gradle +++ b/x-pack/plugin/watcher/qa/rest/build.gradle @@ -35,7 +35,7 @@ if (BuildParams.inFipsJvm){ tasks.named("yamlRestTest").configure{enabled = false } } -tasks.named("transformV7RestTests").configure({ task -> +tasks.named("transformV7RestCompatTests").configure({ task -> task.replaceKeyInDo("watcher.ack_watch", "xpack-watcher.ack_watch") task.replaceKeyInDo("watcher.activate_watch", "xpack-watcher.activate_watch") task.replaceKeyInDo("watcher.deactivate_watch", "xpack-watcher.deactivate_watch") @@ -54,7 +54,7 @@ tasks.named("transformV7RestTests").configure({ task -> }) -tasks.named("yamlRestCompatTest").configure { +tasks.named("yamlRestTestV7Compat").configure { systemProperty 'tests.rest.blacklist', [ 'mustache/25_array_compare/Basic array_compare watch', 'mustache/30_search_input/Test search input mustache integration (using request body and rest_total_hits_as_int)', From e9ee90cb34946ddcb4f96ed6e93908210302d57c Mon Sep 17 00:00:00 2001 From: Jake Landis Date: Mon, 12 Jul 2021 16:12:28 -0500 Subject: [PATCH 2/6] update taskname --- .../internal/rest/compat/YamlRestCompatTestPlugin.java | 5 +++-- modules/percolator/build.gradle | 2 +- modules/reindex/build.gradle | 2 +- rest-api-spec/build.gradle | 2 +- x-pack/plugin/build.gradle | 4 ++-- x-pack/plugin/watcher/qa/rest/build.gradle | 2 +- 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/rest/compat/YamlRestCompatTestPlugin.java b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/rest/compat/YamlRestCompatTestPlugin.java index 7eb7f26a4b8f8..74d233a5d8209 100644 --- a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/rest/compat/YamlRestCompatTestPlugin.java +++ b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/rest/compat/YamlRestCompatTestPlugin.java @@ -138,9 +138,11 @@ public void apply(Project project) { task.onlyIf(t -> isEnabled(project)); }); + String testTaskName = "yamlRestTestV"+ compatibleVersion + "Compat"; + // transform the copied tests task TaskProvider transformCompatTestTask = project.getTasks() - .register("transformV" + compatibleVersion + "RestCompatTests", RestCompatTestTransformTask.class, task -> { + .register(testTaskName + "Transform", RestCompatTestTransformTask.class, task -> { task.getSourceDirectory().set(copyCompatYamlTestTask.flatMap(CopyRestTestsTask::getOutputResourceDir)); task.getOutputDirectory() .set(project.getLayout().getBuildDirectory().dir(compatTestsDir.resolve("transformed").toString())); @@ -162,7 +164,6 @@ public void apply(Project project) { .flatMap(CopyRestTestsTask::getOutputResourceDir); // setup the test task - String testTaskName = "yamlRestTestV"+ compatibleVersion + "Compat"; Provider yamlRestCompatTestTask = RestTestUtil.registerTestTask(project, yamlCompatTestSourceSet, testTaskName); project.getTasks().withType(RestIntegTestTask.class).named(testTaskName).configure(testTask -> { // Use test runner and classpath from "normal" yaml source set diff --git a/modules/percolator/build.gradle b/modules/percolator/build.gradle index b749762da5328..bf366cf398f7e 100644 --- a/modules/percolator/build.gradle +++ b/modules/percolator/build.gradle @@ -25,6 +25,6 @@ restResources { } } -tasks.named("transformV7RestCompatTests").configure({ task -> +tasks.named("yamlRestTestV7CompatTransform").configure({ task -> task.addAllowedWarningRegex("\\[types removal\\].*") }) diff --git a/modules/reindex/build.gradle b/modules/reindex/build.gradle index 6f28abd54a214..bb4f6365be131 100644 --- a/modules/reindex/build.gradle +++ b/modules/reindex/build.gradle @@ -164,7 +164,7 @@ if (Os.isFamily(Os.FAMILY_WINDOWS)) { } } } -tasks.named("transformV7RestCompatTests").configure({ task -> +tasks.named("yamlRestTestV7CompatTransform").configure({ task -> task.addAllowedWarningRegex("\\[types removal\\].*") }) diff --git a/rest-api-spec/build.gradle b/rest-api-spec/build.gradle index 5d9aff74d962f..60fae0deb1f32 100644 --- a/rest-api-spec/build.gradle +++ b/rest-api-spec/build.gradle @@ -103,7 +103,7 @@ tasks.named("yamlRestTestV7Compat").configure { .join(',') } -tasks.named("transformV7RestCompatTests").configure({ task -> +tasks.named("yamlRestTestV7CompatTransform").configure({ task -> task.replaceValueInMatch("_type", "_doc") task.addAllowedWarningRegex("\\[types removal\\].*") task.replaceValueInMatch("nodes.\$node_id.roles.8", "ml", "node_info role test") diff --git a/x-pack/plugin/build.gradle b/x-pack/plugin/build.gradle index 01b58aacc1d07..d2cbbfd8159de 100644 --- a/x-pack/plugin/build.gradle +++ b/x-pack/plugin/build.gradle @@ -94,7 +94,7 @@ tasks.named("yamlRestTest").configure { dependsOn "copyExtraResources" } -tasks.named("transformV7RestCompatTests").configure({ task -> +tasks.named("yamlRestTestV7CompatTransform").configure({ task -> task.replaceKeyInDo("license.delete", "xpack-license.delete") task.replaceKeyInDo("license.get", "xpack-license.get") task.replaceKeyInDo("license.get_basic_status", "xpack-license.get_basic_status") @@ -217,7 +217,7 @@ tasks.named("precommit").configure { dependsOn 'enforceYamlTestConvention', 'enforceApiSpecsConvention' } -tasks.named("transformV7RestCompatTests").configure({ task -> +tasks.named("yamlRestTestV7CompatTransform").configure({ task -> task.replaceValueInMatch("_type", "_doc") task.addAllowedWarningRegex("\\[types removal\\].*") }) diff --git a/x-pack/plugin/watcher/qa/rest/build.gradle b/x-pack/plugin/watcher/qa/rest/build.gradle index e932f652bc35a..60571d9aab0cd 100644 --- a/x-pack/plugin/watcher/qa/rest/build.gradle +++ b/x-pack/plugin/watcher/qa/rest/build.gradle @@ -35,7 +35,7 @@ if (BuildParams.inFipsJvm){ tasks.named("yamlRestTest").configure{enabled = false } } -tasks.named("transformV7RestCompatTests").configure({ task -> +tasks.named("yamlRestTestV7CompatTransform").configure({ task -> task.replaceKeyInDo("watcher.ack_watch", "xpack-watcher.ack_watch") task.replaceKeyInDo("watcher.activate_watch", "xpack-watcher.activate_watch") task.replaceKeyInDo("watcher.deactivate_watch", "xpack-watcher.deactivate_watch") From e24f62913a6294dd76add63a283e049bc11eb668 Mon Sep 17 00:00:00 2001 From: Jake Landis Date: Tue, 13 Jul 2021 14:40:09 -0500 Subject: [PATCH 3/6] fix tests --- .../YamlRestCompatTestPluginFuncTest.groovy | 28 +++++++++---------- .../rest/compat/YamlRestCompatTestPlugin.java | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/test/rest/YamlRestCompatTestPluginFuncTest.groovy b/build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/test/rest/YamlRestCompatTestPluginFuncTest.groovy index b064f81155ed0..3648b603ab95c 100644 --- a/build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/test/rest/YamlRestCompatTestPluginFuncTest.groovy +++ b/build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/test/rest/YamlRestCompatTestPluginFuncTest.groovy @@ -22,13 +22,13 @@ class YamlRestCompatTestPluginFuncTest extends AbstractRestResourcesFuncTest { def compatibleVersion = Version.fromString(VersionProperties.getVersions().get("elasticsearch")).getMajor() - 1 def specIntermediateDir = "restResources/v${compatibleVersion}/yamlSpecs" def testIntermediateDir = "restResources/v${compatibleVersion}/yamlTests" - def transformTask = ":transformV${compatibleVersion}RestTests" + def transformTask = ":yamlRestTestV${compatibleVersion}CompatTransform" def YAML_FACTORY = new YAMLFactory() def MAPPER = new ObjectMapper(YAML_FACTORY) def READER = MAPPER.readerFor(ObjectNode.class) def WRITER = MAPPER.writerFor(ObjectNode.class) - def "yamlRestCompatTest does nothing when there are no tests"() { + def "yamlRestTestCompat does nothing when there are no tests"() { given: addSubProject(":distribution:bwc:minor") << """ configurations { checkout } @@ -44,16 +44,16 @@ class YamlRestCompatTestPluginFuncTest extends AbstractRestResourcesFuncTest { """ when: - def result = gradleRunner("yamlRestCompatTest", '--stacktrace').build() + def result = gradleRunner("yamlRestTestV${compatibleVersion}Compat", '--stacktrace').build() then: - result.task(':yamlRestCompatTest').outcome == TaskOutcome.NO_SOURCE + result.task(":yamlRestTestV${compatibleVersion}Compat").outcome == TaskOutcome.NO_SOURCE result.task(':copyRestCompatApiTask').outcome == TaskOutcome.NO_SOURCE result.task(':copyRestCompatTestTask').outcome == TaskOutcome.NO_SOURCE result.task(transformTask).outcome == TaskOutcome.NO_SOURCE } - def "yamlRestCompatTest executes and copies api and transforms tests from :bwc:minor"() { + def "yamlRestTestCompat executes and copies api and transforms tests from :bwc:minor"() { given: internalBuild() @@ -93,10 +93,10 @@ class YamlRestCompatTestPluginFuncTest extends AbstractRestResourcesFuncTest { file("distribution/bwc/minor/checkoutDir/src/yamlRestTest/resources/rest-api-spec/test/" + test) << "" when: - def result = gradleRunner("yamlRestCompatTest").build() + def result = gradleRunner("yamlRestTestV${compatibleVersion}Compat").build() then: - result.task(':yamlRestCompatTest').outcome == TaskOutcome.SKIPPED + result.task(":yamlRestTestV${compatibleVersion}Compat").outcome == TaskOutcome.SKIPPED result.task(':copyRestCompatApiTask').outcome == TaskOutcome.SUCCESS result.task(':copyRestCompatTestTask').outcome == TaskOutcome.SUCCESS result.task(transformTask).outcome == TaskOutcome.SUCCESS @@ -123,16 +123,16 @@ class YamlRestCompatTestPluginFuncTest extends AbstractRestResourcesFuncTest { result.task(':copyYamlTestsTask').outcome == TaskOutcome.NO_SOURCE when: - result = gradleRunner("yamlRestCompatTest").build() + result = gradleRunner("yamlRestTestV${compatibleVersion}Compat").build() then: - result.task(':yamlRestCompatTest').outcome == TaskOutcome.SKIPPED + result.task(":yamlRestTestV${compatibleVersion}Compat").outcome == TaskOutcome.SKIPPED result.task(':copyRestCompatApiTask').outcome == TaskOutcome.UP_TO_DATE result.task(':copyRestCompatTestTask').outcome == TaskOutcome.UP_TO_DATE result.task(transformTask).outcome == TaskOutcome.UP_TO_DATE } - def "yamlRestCompatTest is wired into check and checkRestCompat"() { + def "yamlRestTestCompat is wired into check and checkRestCompat"() { given: addSubProject(":distribution:bwc:minor") << """ @@ -155,7 +155,7 @@ class YamlRestCompatTestPluginFuncTest extends AbstractRestResourcesFuncTest { then: result.task(':check').outcome == TaskOutcome.UP_TO_DATE result.task(':checkRestCompat').outcome == TaskOutcome.UP_TO_DATE - result.task(':yamlRestCompatTest').outcome == TaskOutcome.NO_SOURCE + result.task(":yamlRestTestV${compatibleVersion}Compat").outcome == TaskOutcome.NO_SOURCE result.task(':copyRestCompatApiTask').outcome == TaskOutcome.NO_SOURCE result.task(':copyRestCompatTestTask').outcome == TaskOutcome.NO_SOURCE result.task(transformTask).outcome == TaskOutcome.NO_SOURCE @@ -169,7 +169,7 @@ class YamlRestCompatTestPluginFuncTest extends AbstractRestResourcesFuncTest { then: result.task(':check').outcome == TaskOutcome.UP_TO_DATE result.task(':checkRestCompat').outcome == TaskOutcome.UP_TO_DATE - result.task(':yamlRestCompatTest').outcome == TaskOutcome.SKIPPED + result.task(":yamlRestTestV${compatibleVersion}Compat").outcome == TaskOutcome.SKIPPED result.task(':copyRestCompatApiTask').outcome == TaskOutcome.SKIPPED result.task(':copyRestCompatTestTask').outcome == TaskOutcome.SKIPPED result.task(transformTask).outcome == TaskOutcome.SKIPPED @@ -195,7 +195,7 @@ class YamlRestCompatTestPluginFuncTest extends AbstractRestResourcesFuncTest { dependencies { yamlRestTestImplementation "junit:junit:4.12" } - tasks.named("transformV7RestTests").configure({ task -> + tasks.named("yamlRestTestV${compatibleVersion}CompatTransform").configure({ task -> task.replaceValueInMatch("_type", "_doc") task.replaceValueInMatch("_source.values", ["z", "x", "y"], "one") task.removeMatch("_source.blah") @@ -261,7 +261,7 @@ class YamlRestCompatTestPluginFuncTest extends AbstractRestResourcesFuncTest { - match: {} """.stripIndent() when: - def result = gradleRunner("yamlRestCompatTest").build() + def result = gradleRunner("yamlRestTestV${compatibleVersion}Compat").build() then: diff --git a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/rest/compat/YamlRestCompatTestPlugin.java b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/rest/compat/YamlRestCompatTestPlugin.java index 74d233a5d8209..55475f476b763 100644 --- a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/rest/compat/YamlRestCompatTestPlugin.java +++ b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/rest/compat/YamlRestCompatTestPlugin.java @@ -139,7 +139,7 @@ public void apply(Project project) { }); String testTaskName = "yamlRestTestV"+ compatibleVersion + "Compat"; - + // transform the copied tests task TaskProvider transformCompatTestTask = project.getTasks() .register(testTaskName + "Transform", RestCompatTestTransformTask.class, task -> { From eb738fd626ee3925b241b25e723db11cf455d8ad Mon Sep 17 00:00:00 2001 From: Jake Landis Date: Thu, 2 Sep 2021 14:44:06 -0500 Subject: [PATCH 4/6] update tasks names --- .../gradle/internal/rest/compat/YamlRestCompatTestPlugin.java | 4 ++-- modules/analysis-common/build.gradle | 2 +- modules/geo/build.gradle | 2 +- modules/ingest-common/build.gradle | 2 +- modules/ingest-user-agent/build.gradle | 2 +- modules/lang-mustache/build.gradle | 2 +- modules/lang-painless/build.gradle | 2 +- modules/parent-join/build.gradle | 2 +- modules/reindex/build.gradle | 2 +- modules/repository-url/build.gradle | 2 +- plugins/analysis-icu/build.gradle | 2 +- plugins/ingest-attachment/build.gradle | 2 +- rest-api-spec/build.gradle | 2 +- x-pack/plugin/build.gradle | 2 +- x-pack/plugin/watcher/qa/rest/build.gradle | 2 +- 15 files changed, 16 insertions(+), 16 deletions(-) diff --git a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/rest/compat/YamlRestCompatTestPlugin.java b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/rest/compat/YamlRestCompatTestPlugin.java index 55475f476b763..0219323713044 100644 --- a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/rest/compat/YamlRestCompatTestPlugin.java +++ b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/rest/compat/YamlRestCompatTestPlugin.java @@ -138,11 +138,11 @@ public void apply(Project project) { task.onlyIf(t -> isEnabled(project)); }); - String testTaskName = "yamlRestTestV"+ compatibleVersion + "Compat"; + String testTaskName = "yamlRestTestV"+ compatibleVersion + "CompatTest"; // transform the copied tests task TaskProvider transformCompatTestTask = project.getTasks() - .register(testTaskName + "Transform", RestCompatTestTransformTask.class, task -> { + .register("yamlRestTestV"+ compatibleVersion + "CompatTransform", RestCompatTestTransformTask.class, task -> { task.getSourceDirectory().set(copyCompatYamlTestTask.flatMap(CopyRestTestsTask::getOutputResourceDir)); task.getOutputDirectory() .set(project.getLayout().getBuildDirectory().dir(compatTestsDir.resolve("transformed").toString())); diff --git a/modules/analysis-common/build.gradle b/modules/analysis-common/build.gradle index aa25803105414..d6842153de858 100644 --- a/modules/analysis-common/build.gradle +++ b/modules/analysis-common/build.gradle @@ -25,7 +25,7 @@ dependencies { compileOnly project(':modules:lang-painless') } -tasks.named("yamlRestTestV7Compat").configure { +tasks.named("yamlRestTestV7CompatTest").configure { systemProperty 'tests.rest.blacklist', [ 'search.query/50_queries_with_synonyms/Test common terms query with stacked tokens', 'indices.analyze/10_analyze/htmlStrip_deprecated', diff --git a/modules/geo/build.gradle b/modules/geo/build.gradle index 33187dff0afc7..f5b7040e3f202 100644 --- a/modules/geo/build.gradle +++ b/modules/geo/build.gradle @@ -29,5 +29,5 @@ if (BuildParams.inFipsJvm){ // The geo module is replaced by spatial in the default distribution and in FIPS 140 mode, we set the testclusters to // use the default distribution, so there is no need to run these tests tasks.named("yamlRestTest").configure{enabled = false } - tasks.named("yamlRestTestV7Compat").configure{enabled = false } + tasks.named("yamlRestTestV7CompatTest").configure{enabled = false } } diff --git a/modules/ingest-common/build.gradle b/modules/ingest-common/build.gradle index 29ee223b8314c..d7ee0fc3adcd8 100644 --- a/modules/ingest-common/build.gradle +++ b/modules/ingest-common/build.gradle @@ -44,7 +44,7 @@ tasks.named("thirdPartyAudit").configure { ) } -tasks.named("yamlRestTestV7Compat").configure { +tasks.named("yamlRestTestV7CompatTest").configure { systemProperty 'tests.rest.blacklist', [ 'ingest/80_foreach/Test foreach Processor', 'ingest/230_change_target_index/Test Change Target Index with Explicit Pipeline', diff --git a/modules/ingest-user-agent/build.gradle b/modules/ingest-user-agent/build.gradle index 2f53e89c337e8..782af3b720aab 100644 --- a/modules/ingest-user-agent/build.gradle +++ b/modules/ingest-user-agent/build.gradle @@ -23,7 +23,7 @@ testClusters.all { extraConfigFile 'ingest-user-agent/test-regexes.yml', file('src/test/test-regexes.yml') } -tasks.named("yamlRestTestV7Compat").configure { +tasks.named("yamlRestTestV7CompatTest").configure { systemProperty 'tests.rest.blacklist', [ 'ingest-useragent/30_custom_regex/Test user agent processor with custom regex file', 'ingest-useragent/20_useragent_processor/Test user agent processor with parameters' diff --git a/modules/lang-mustache/build.gradle b/modules/lang-mustache/build.gradle index a8cf43f445b9f..7e111e130c695 100644 --- a/modules/lang-mustache/build.gradle +++ b/modules/lang-mustache/build.gradle @@ -26,7 +26,7 @@ restResources { } } -tasks.named("yamlRestTestV7Compat").configure { +tasks.named("yamlRestTestV7CompatTest").configure { systemProperty 'tests.rest.blacklist', [ 'lang_mustache/60_typed_keys/Multisearch template with typed_keys parameter', 'lang_mustache/60_typed_keys/Search template with typed_keys parameter' diff --git a/modules/lang-painless/build.gradle b/modules/lang-painless/build.gradle index fd5ef5037325e..3ec698ace0933 100644 --- a/modules/lang-painless/build.gradle +++ b/modules/lang-painless/build.gradle @@ -49,7 +49,7 @@ tasks.named("test").configure { jvmArgs '-XX:-OmitStackTraceInFastThrow', '-XX:-HeapDumpOnOutOfMemoryError' } -tasks.named("yamlRestTestV7Compat").configure { +tasks.named("yamlRestTestV7CompatTest").configure { systemProperty 'tests.rest.blacklist', [ ].join(',') } diff --git a/modules/parent-join/build.gradle b/modules/parent-join/build.gradle index 83aa2c2e54641..a8034041fef8d 100644 --- a/modules/parent-join/build.gradle +++ b/modules/parent-join/build.gradle @@ -20,7 +20,7 @@ restResources { } } -tasks.named("yamlRestTestV7Compat").configure { +tasks.named("yamlRestTestV7CompatTest").configure { systemProperty 'tests.rest.blacklist', [ '/30_inner_hits/Test two sub-queries with only one having inner_hits' ].join(',') diff --git a/modules/reindex/build.gradle b/modules/reindex/build.gradle index bb4f6365be131..d7fe2eb1fc292 100644 --- a/modules/reindex/build.gradle +++ b/modules/reindex/build.gradle @@ -175,7 +175,7 @@ def v7compatibilityNotSupportedTests = { ] } -tasks.named("yamlRestTestV7Compat").configure { +tasks.named("yamlRestTestV7CompatTest").configure { systemProperty 'tests.rest.blacklist', v7compatibilityNotSupportedTests().join(',') } diff --git a/modules/repository-url/build.gradle b/modules/repository-url/build.gradle index 4717d2061c080..4de706945b53c 100644 --- a/modules/repository-url/build.gradle +++ b/modules/repository-url/build.gradle @@ -63,7 +63,7 @@ testClusters.all { }, PropertyNormalization.IGNORE_VALUE } -tasks.named("yamlRestTestV7Compat").configure { +tasks.named("yamlRestTestV7CompatTest").configure { systemProperty 'tests.rest.blacklist', [ 'repository_url/10_basic/Get a non existing snapshot', 'repository_url/10_basic/Restore with repository-url using http://', diff --git a/plugins/analysis-icu/build.gradle b/plugins/analysis-icu/build.gradle index 52349b29b72a4..b9c68344d2b6d 100644 --- a/plugins/analysis-icu/build.gradle +++ b/plugins/analysis-icu/build.gradle @@ -37,7 +37,7 @@ tasks.named("dependencyLicenses").configure { mapping from: /lucene-.*/, to: 'lucene' } -tasks.named("yamlRestTestV7Compat").configure { +tasks.named("yamlRestTestV7CompatTest").configure { systemProperty 'tests.rest.blacklist', [ 'analysis_icu/10_basic/Normalization with deprecated unicodeSetFilter' ].join(',') diff --git a/plugins/ingest-attachment/build.gradle b/plugins/ingest-attachment/build.gradle index 5e13bc872c0cb..9477a9ab7e33f 100644 --- a/plugins/ingest-attachment/build.gradle +++ b/plugins/ingest-attachment/build.gradle @@ -96,6 +96,6 @@ if (BuildParams.inFipsJvm) { tasks.named("jarHell").configure { enabled = false } tasks.named("test").configure { enabled = false } tasks.named("yamlRestTest").configure { enabled = false }; - tasks.named("yamlRestTestV7Compat").configure { enabled = false }; + tasks.named("yamlRestTestV7CompatTest").configure { enabled = false }; tasks.named("testingConventions").configure { enabled = false }; } diff --git a/rest-api-spec/build.gradle b/rest-api-spec/build.gradle index 60fae0deb1f32..68ada41b8e9cc 100644 --- a/rest-api-spec/build.gradle +++ b/rest-api-spec/build.gradle @@ -74,7 +74,7 @@ def v7compatibilityNotSupportedTests = { 'indices.upgrade/*/*' ] } -tasks.named("yamlRestTestV7Compat").configure { +tasks.named("yamlRestTestV7CompatTest").configure { onlyIf { // Skip these tests on Windows since the blacklist exceeds Windows CLI limits OS.current() != OS.WINDOWS diff --git a/x-pack/plugin/build.gradle b/x-pack/plugin/build.gradle index d2cbbfd8159de..34b878a6b94b3 100644 --- a/x-pack/plugin/build.gradle +++ b/x-pack/plugin/build.gradle @@ -142,7 +142,7 @@ def v7compatibilityNotSupportedTests = { ] } -tasks.named("yamlRestTestV7Compat").configure { +tasks.named("yamlRestTestV7CompatTest").configure { /* * We have to disable setting the number of available processors as tests in the same JVM randomize processors and will step on each * other if we allow them to set the number of available processors as it's set-once in Netty. diff --git a/x-pack/plugin/watcher/qa/rest/build.gradle b/x-pack/plugin/watcher/qa/rest/build.gradle index 60571d9aab0cd..fd92b510f6be1 100644 --- a/x-pack/plugin/watcher/qa/rest/build.gradle +++ b/x-pack/plugin/watcher/qa/rest/build.gradle @@ -54,7 +54,7 @@ tasks.named("yamlRestTestV7CompatTransform").configure({ task -> }) -tasks.named("yamlRestTestV7Compat").configure { +tasks.named("yamlRestTestV7CompatTest").configure { systemProperty 'tests.rest.blacklist', [ 'mustache/25_array_compare/Basic array_compare watch', 'mustache/30_search_input/Test search input mustache integration (using request body and rest_total_hits_as_int)', From e28009c3857093ae6eddcf7d6f9cb483d843fda8 Mon Sep 17 00:00:00 2001 From: Jake Landis Date: Thu, 2 Sep 2021 15:44:21 -0500 Subject: [PATCH 5/6] clean up merge --- .../YamlRestCompatTestPluginFuncTest.groovy | 24 +++++++++---------- .../rest/compat/YamlRestCompatTestPlugin.java | 5 ++-- modules/lang-painless/build.gradle | 1 + 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/test/rest/YamlRestCompatTestPluginFuncTest.groovy b/build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/test/rest/YamlRestCompatTestPluginFuncTest.groovy index 9d9bd24e58176..6e16b5a7be172 100644 --- a/build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/test/rest/YamlRestCompatTestPluginFuncTest.groovy +++ b/build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/test/rest/YamlRestCompatTestPluginFuncTest.groovy @@ -28,7 +28,7 @@ class YamlRestCompatTestPluginFuncTest extends AbstractRestResourcesFuncTest { def READER = MAPPER.readerFor(ObjectNode.class) def WRITER = MAPPER.writerFor(ObjectNode.class) - def "yamlRestTestCompat does nothing when there are no tests"() { + def "yamlRestTestVxCompatTest does nothing when there are no tests"() { given: addSubProject(":distribution:bwc:minor") << """ configurations { checkout } @@ -44,16 +44,16 @@ class YamlRestCompatTestPluginFuncTest extends AbstractRestResourcesFuncTest { """ when: - def result = gradleRunner("yamlRestTestV${compatibleVersion}Compat", '--stacktrace').build() + def result = gradleRunner("yamlRestTestV${compatibleVersion}CompatTest", '--stacktrace').build() then: - result.task(":yamlRestTestV${compatibleVersion}Compat").outcome == TaskOutcome.NO_SOURCE + result.task(":yamlRestTestV${compatibleVersion}CompatTest").outcome == TaskOutcome.NO_SOURCE result.task(':copyRestCompatApiTask').outcome == TaskOutcome.NO_SOURCE result.task(':copyRestCompatTestTask').outcome == TaskOutcome.NO_SOURCE result.task(transformTask).outcome == TaskOutcome.NO_SOURCE } - def "yamlRestTestCompat executes and copies api and transforms tests from :bwc:minor"() { + def "yamlRestTestVxCompatTest executes and copies api and transforms tests from :bwc:minor"() { given: internalBuild() @@ -93,10 +93,10 @@ class YamlRestCompatTestPluginFuncTest extends AbstractRestResourcesFuncTest { file("distribution/bwc/minor/checkoutDir/src/yamlRestTest/resources/rest-api-spec/test/" + test) << "" when: - def result = gradleRunner("yamlRestTestV${compatibleVersion}Compat").build() + def result = gradleRunner("yamlRestTestV${compatibleVersion}CompatTest").build() then: - result.task(":yamlRestTestV${compatibleVersion}Compat").outcome == TaskOutcome.SKIPPED + result.task(":yamlRestTestV${compatibleVersion}CompatTest").outcome == TaskOutcome.SKIPPED result.task(':copyRestCompatApiTask').outcome == TaskOutcome.SUCCESS result.task(':copyRestCompatTestTask').outcome == TaskOutcome.SUCCESS result.task(transformTask).outcome == TaskOutcome.SUCCESS @@ -123,16 +123,16 @@ class YamlRestCompatTestPluginFuncTest extends AbstractRestResourcesFuncTest { result.task(':copyYamlTestsTask').outcome == TaskOutcome.NO_SOURCE when: - result = gradleRunner("yamlRestTestV${compatibleVersion}Compat").build() + result = gradleRunner("yamlRestTestV${compatibleVersion}CompatTest").build() then: - result.task(":yamlRestTestV${compatibleVersion}Compat").outcome == TaskOutcome.SKIPPED + result.task(":yamlRestTestV${compatibleVersion}CompatTest").outcome == TaskOutcome.SKIPPED result.task(':copyRestCompatApiTask').outcome == TaskOutcome.UP_TO_DATE result.task(':copyRestCompatTestTask').outcome == TaskOutcome.UP_TO_DATE result.task(transformTask).outcome == TaskOutcome.UP_TO_DATE } - def "yamlRestTestCompat is wired into check and checkRestCompat"() { + def "yamlRestTestVxCompatTest is wired into check and checkRestCompat"() { given: addSubProject(":distribution:bwc:minor") << """ @@ -155,7 +155,7 @@ class YamlRestCompatTestPluginFuncTest extends AbstractRestResourcesFuncTest { then: result.task(':check').outcome == TaskOutcome.UP_TO_DATE result.task(':checkRestCompat').outcome == TaskOutcome.UP_TO_DATE - result.task(":yamlRestTestV${compatibleVersion}Compat").outcome == TaskOutcome.NO_SOURCE + result.task(":yamlRestTestV${compatibleVersion}CompatTest").outcome == TaskOutcome.NO_SOURCE result.task(':copyRestCompatApiTask').outcome == TaskOutcome.NO_SOURCE result.task(':copyRestCompatTestTask').outcome == TaskOutcome.NO_SOURCE result.task(transformTask).outcome == TaskOutcome.NO_SOURCE @@ -169,7 +169,7 @@ class YamlRestCompatTestPluginFuncTest extends AbstractRestResourcesFuncTest { then: result.task(':check').outcome == TaskOutcome.UP_TO_DATE result.task(':checkRestCompat').outcome == TaskOutcome.UP_TO_DATE - result.task(":yamlRestTestV${compatibleVersion}Compat").outcome == TaskOutcome.SKIPPED + result.task(":yamlRestTestV${compatibleVersion}CompatTest").outcome == TaskOutcome.SKIPPED result.task(':copyRestCompatApiTask').outcome == TaskOutcome.SKIPPED result.task(':copyRestCompatTestTask').outcome == TaskOutcome.SKIPPED result.task(transformTask).outcome == TaskOutcome.SKIPPED @@ -266,7 +266,7 @@ class YamlRestCompatTestPluginFuncTest extends AbstractRestResourcesFuncTest { - match: {} """.stripIndent() when: - def result = gradleRunner("yamlRestTestV${compatibleVersion}Compat").build() + def result = gradleRunner("yamlRestTestV${compatibleVersion}CompatTest").build() then: diff --git a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/rest/compat/YamlRestCompatTestPlugin.java b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/rest/compat/YamlRestCompatTestPlugin.java index 0ed9ca87ad576..502d3f886fc60 100644 --- a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/rest/compat/YamlRestCompatTestPlugin.java +++ b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/rest/compat/YamlRestCompatTestPlugin.java @@ -138,8 +138,7 @@ public void apply(Project project) { task.onlyIf(t -> isEnabled(project)); }); - String testTaskName = "yamlRestTestV"+ compatibleVersion + "CompatTest"; - + // transform the copied tests task TaskProvider transformCompatTestTask = project.getTasks() .register("yamlRestTestV"+ compatibleVersion + "CompatTransform", RestCompatTestTransformTask.class, task -> { @@ -163,6 +162,8 @@ public void apply(Project project) { .named(RestResourcesPlugin.COPY_YAML_TESTS_TASK) .flatMap(CopyRestTestsTask::getOutputResourceDir); + String testTaskName = "yamlRestTestV"+ compatibleVersion + "CompatTest"; + // setup the test task Provider yamlRestCompatTestTask = RestTestUtil.registerTestTask(project, yamlCompatTestSourceSet, testTaskName); project.getTasks().withType(RestIntegTestTask.class).named(testTaskName).configure(testTask -> { diff --git a/modules/lang-painless/build.gradle b/modules/lang-painless/build.gradle index 699d3d0e93fbc..395daf771dfc7 100644 --- a/modules/lang-painless/build.gradle +++ b/modules/lang-painless/build.gradle @@ -57,6 +57,7 @@ tasks.named("test").configure { // in WhenThingsGoWrongTests we intentionally generate an out of memory error, this prevents the heap from being dumped to disk jvmArgs '-XX:-OmitStackTraceInFastThrow', '-XX:-HeapDumpOnOutOfMemoryError' } + /* Build Javadoc for the Java classes in Painless's public API that are in the * Painless plugin */ tasks.register("apiJavadoc", Javadoc) { From 5065f043ea95398b6e4ebf5be1bb43170331d389 Mon Sep 17 00:00:00 2001 From: Jake Landis Date: Fri, 3 Sep 2021 09:45:39 -0500 Subject: [PATCH 6/6] fix merge --- modules/geo/build.gradle | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 modules/geo/build.gradle diff --git a/modules/geo/build.gradle b/modules/geo/build.gradle deleted file mode 100644 index 8eca5eb076919..0000000000000 --- a/modules/geo/build.gradle +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ -apply plugin: 'elasticsearch.internal-yaml-rest-test' -apply plugin: 'elasticsearch.yaml-rest-compat-test' - -import org.elasticsearch.gradle.internal.info.BuildParams - -esplugin { - description 'Placeholder plugin for geospatial features in ES. only registers geo_shape field mapper for now' - classname 'org.elasticsearch.geo.GeoPlugin' -} - -restResources { - restApi { - include '_common', 'indices', 'index', 'search' - } -} -artifacts { - restTests(project.file('src/yamlRestTest/resources/rest-api-spec/test')) -} -tasks.named("test").configure { enabled = false } - -if (BuildParams.inFipsJvm){ - // The geo module is replaced by spatial in the default distribution and in FIPS 140 mode, we set the testclusters to - // use the default distribution, so there is no need to run these tests - tasks.named("yamlRestTest").configure{enabled = false } - tasks.named("yamlRestTestV7CompatTest").configure{enabled = false } -}