From 1d9f246f9fb6c6ba4fb6c3358224751bab30c425 Mon Sep 17 00:00:00 2001 From: Mark Vieira Date: Mon, 13 Sep 2021 14:56:09 -0700 Subject: [PATCH] [7.14] Introduce external build-tools JavaRestTestPlugin (#77603) (#77664) --- build-tools-internal/build.gradle | 6 +- ...n.java => InternalJavaRestTestPlugin.java} | 2 +- build-tools/build.gradle | 4 + .../test/JavaRestTestPluginFuncTest.groovy | 57 ++++++++++++++ .../gradle/test/JavaRestTestPlugin.java | 77 +++++++++++++++++++ .../gradle/test/YamlRestTestPlugin.java | 8 +- modules/kibana/build.gradle | 2 +- modules/lang-mustache/build.gradle | 2 +- modules/reindex/build.gradle | 2 +- modules/transport-netty4/build.gradle | 8 +- plugins/examples/build.gradle | 9 +++ .../build.gradle | 2 +- qa/die-with-dignity/build.gradle | 2 +- qa/system-indices/build.gradle | 2 +- .../async-search/qa/security/build.gradle | 2 +- .../data-streams/qa/multi-node/build.gradle | 2 +- .../plugin/data-streams/qa/rest/build.gradle | 2 +- .../plugin/deprecation/qa/rest/build.gradle | 2 +- .../rest-with-advanced-security/build.gradle | 2 +- .../enrich/qa/rest-with-security/build.gradle | 2 +- x-pack/plugin/enrich/qa/rest/build.gradle | 2 +- x-pack/plugin/eql/qa/correctness/build.gradle | 2 +- x-pack/plugin/eql/qa/rest/build.gradle | 2 +- x-pack/plugin/eql/qa/security/build.gradle | 2 +- x-pack/plugin/fleet/build.gradle | 2 +- .../qa/idp-rest-tests/build.gradle | 2 +- x-pack/plugin/ilm/qa/multi-node/build.gradle | 2 +- .../plugin/ilm/qa/with-security/build.gradle | 2 +- x-pack/plugin/logstash/build.gradle | 2 +- .../ml/qa/basic-multi-node/build.gradle | 2 +- x-pack/plugin/ml/qa/disabled/build.gradle | 2 +- .../qa/native-multi-node-tests/build.gradle | 2 +- .../ml/qa/single-node-tests/build.gradle | 2 +- .../searchable-snapshots/qa/rest/build.gradle | 2 +- .../qa/basic-enable-security/build.gradle | 3 +- .../qa/operator-privileges-tests/build.gradle | 2 +- .../security/qa/security-basic/build.gradle | 2 +- .../qa/security-disabled/build.gradle | 2 +- .../qa/security-not-enabled/build.gradle | 2 +- .../security/qa/security-trial/build.gradle | 2 +- .../security/qa/service-account/build.gradle | 2 +- .../qa/smoke-test-all-realms/build.gradle | 2 +- .../plugin/security/qa/tls-basic/build.gradle | 2 +- .../shutdown/qa/multi-node/build.gradle | 2 +- .../qa/multi-node-tests/build.gradle | 2 +- .../qa/single-node-tests/build.gradle | 2 +- x-pack/plugin/watcher/qa/rest/build.gradle | 2 +- .../watcher/qa/with-monitoring/build.gradle | 2 +- .../watcher/qa/with-security/build.gradle | 2 +- .../runtime-fields/with-security/build.gradle | 2 +- .../build.gradle | 2 +- 51 files changed, 204 insertions(+), 54 deletions(-) rename build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/{JavaRestTestPlugin.java => InternalJavaRestTestPlugin.java} (97%) create mode 100644 build-tools/src/integTest/groovy/org/elasticsearch/gradle/test/JavaRestTestPluginFuncTest.groovy create mode 100644 build-tools/src/main/java/org/elasticsearch/gradle/test/JavaRestTestPlugin.java diff --git a/build-tools-internal/build.gradle b/build-tools-internal/build.gradle index 2e37663e0bc17..6c3578ff13d22 100644 --- a/build-tools-internal/build.gradle +++ b/build-tools-internal/build.gradle @@ -103,9 +103,9 @@ gradlePlugin { id = 'elasticsearch.java' implementationClass = 'org.elasticsearch.gradle.internal.ElasticsearchJavaPlugin' } - javaRestTest { - id = 'elasticsearch.java-rest-test' - implementationClass = 'org.elasticsearch.gradle.internal.test.rest.JavaRestTestPlugin' + internalJavaRestTest { + id = 'elasticsearch.internal-java-rest-test' + implementationClass = 'org.elasticsearch.gradle.internal.test.rest.InternalJavaRestTestPlugin' } repositories { id = 'elasticsearch.repositories' diff --git a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/JavaRestTestPlugin.java b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/InternalJavaRestTestPlugin.java similarity index 97% rename from build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/JavaRestTestPlugin.java rename to build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/InternalJavaRestTestPlugin.java index b0539ca276786..291e8c78228ac 100644 --- a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/JavaRestTestPlugin.java +++ b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/InternalJavaRestTestPlugin.java @@ -27,7 +27,7 @@ /** * Apply this plugin to run the Java based REST tests. */ -public class JavaRestTestPlugin implements Plugin { +public class InternalJavaRestTestPlugin implements Plugin { public static final String SOURCE_SET_NAME = "javaRestTest"; diff --git a/build-tools/build.gradle b/build-tools/build.gradle index 772beae1747a2..8c63c7e60d8f4 100644 --- a/build-tools/build.gradle +++ b/build-tools/build.gradle @@ -49,6 +49,10 @@ gradlePlugin { id = 'elasticsearch.esplugin' implementationClass = 'org.elasticsearch.gradle.plugin.PluginBuildPlugin' } + javaRestTest { + id = 'elasticsearch.java-rest-test' + implementationClass = 'org.elasticsearch.gradle.test.JavaRestTestPlugin' + } testclusters { id = 'elasticsearch.testclusters' implementationClass = 'org.elasticsearch.gradle.testclusters.TestClustersPlugin' diff --git a/build-tools/src/integTest/groovy/org/elasticsearch/gradle/test/JavaRestTestPluginFuncTest.groovy b/build-tools/src/integTest/groovy/org/elasticsearch/gradle/test/JavaRestTestPluginFuncTest.groovy new file mode 100644 index 0000000000000..09c078b490f48 --- /dev/null +++ b/build-tools/src/integTest/groovy/org/elasticsearch/gradle/test/JavaRestTestPluginFuncTest.groovy @@ -0,0 +1,57 @@ +/* + * 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. + */ + +package org.elasticsearch.gradle.test + +import org.elasticsearch.gradle.VersionProperties +import org.elasticsearch.gradle.fixtures.AbstractGradleFuncTest +import org.gradle.testkit.runner.TaskOutcome + +class JavaRestTestPluginFuncTest extends AbstractGradleFuncTest { + + def "declares default dependencies"() { + given: + buildFile << """ + plugins { + id 'elasticsearch.java-rest-test' + } + """ + + when: + def result = gradleRunner("dependencies").build() + def output = normalized(result.output) + then: + output.contains(normalized(""" +javaRestTestImplementation - Implementation only dependencies for source set 'java rest test'. (n) +/--- org.elasticsearch.test:framework:${VersionProperties.elasticsearch} (n)""")) + } + + def "javaRestTest does nothing when there are no tests"() { + given: + buildFile << """ + plugins { + id 'elasticsearch.java-rest-test' + } + + repositories { + mavenCentral() + } + + dependencies { + javaRestTestImplementation "org.elasticsearch.test:framework:7.14.0" + } + """ + + when: + def result = gradleRunner("javaRestTest").build() + then: + result.task(':compileJavaRestTestJava').outcome == TaskOutcome.NO_SOURCE + result.task(':javaRestTest').outcome == TaskOutcome.NO_SOURCE + } + +} diff --git a/build-tools/src/main/java/org/elasticsearch/gradle/test/JavaRestTestPlugin.java b/build-tools/src/main/java/org/elasticsearch/gradle/test/JavaRestTestPlugin.java new file mode 100644 index 0000000000000..67628cd1b8923 --- /dev/null +++ b/build-tools/src/main/java/org/elasticsearch/gradle/test/JavaRestTestPlugin.java @@ -0,0 +1,77 @@ +/* + * 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. + */ + +package org.elasticsearch.gradle.test; + +import org.elasticsearch.gradle.VersionProperties; +import org.elasticsearch.gradle.plugin.PluginBuildPlugin; +import org.elasticsearch.gradle.testclusters.ElasticsearchCluster; +import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask; +import org.elasticsearch.gradle.testclusters.TestClustersPlugin; +import org.gradle.api.NamedDomainObjectContainer; +import org.gradle.api.Plugin; +import org.gradle.api.Project; +import org.gradle.api.plugins.JavaBasePlugin; +import org.gradle.api.tasks.SourceSetContainer; +import org.gradle.api.tasks.TaskProvider; +import org.gradle.api.tasks.bundling.Zip; +import org.gradle.language.base.plugins.LifecycleBasePlugin; + +import static org.elasticsearch.gradle.plugin.PluginBuildPlugin.BUNDLE_PLUGIN_TASK_NAME; + +public class JavaRestTestPlugin implements Plugin { + + public static final String JAVA_REST_TEST = "javaRestTest"; + + @Override + public void apply(Project project) { + project.getPluginManager().apply(GradleTestPolicySetupPlugin.class); + project.getPluginManager().apply(TestClustersPlugin.class); + project.getPluginManager().apply(JavaBasePlugin.class); + + // Setup source set and dependencies + var sourceSets = project.getExtensions().getByType(SourceSetContainer.class); + var testSourceSet = sourceSets.maybeCreate(JAVA_REST_TEST); + var javaRestTestImplementation = project.getConfigurations().getByName(testSourceSet.getImplementationConfigurationName()); + + String elasticsearchVersion = VersionProperties.getElasticsearch(); + javaRestTestImplementation.defaultDependencies( + deps -> deps.add(project.getDependencies().create("org.elasticsearch.test:framework:" + elasticsearchVersion)) + ); + + // Register test cluster + NamedDomainObjectContainer testClusters = (NamedDomainObjectContainer) project + .getExtensions() + .getByName(TestClustersPlugin.EXTENSION_NAME); + var cluster = testClusters.maybeCreate(JAVA_REST_TEST); + + // Register test task + TaskProvider javaRestTestTask = project.getTasks() + .register(JAVA_REST_TEST, StandaloneRestIntegTestTask.class, task -> { + task.useCluster(cluster); + task.setTestClassesDirs(testSourceSet.getOutput().getClassesDirs()); + task.setClasspath(testSourceSet.getRuntimeClasspath()); + + var nonInputProperties = new SystemPropertyCommandLineArgumentProvider(); + nonInputProperties.systemProperty("tests.rest.cluster", () -> String.join(",", cluster.getAllHttpSocketURI())); + nonInputProperties.systemProperty("tests.cluster", () -> String.join(",", cluster.getAllTransportPortURI())); + nonInputProperties.systemProperty("tests.clustername", () -> cluster.getName()); + task.getJvmArgumentProviders().add(nonInputProperties); + }); + + // Register plugin bundle with test cluster + project.getPlugins().withType(PluginBuildPlugin.class, p -> { + TaskProvider bundle = project.getTasks().withType(Zip.class).named(BUNDLE_PLUGIN_TASK_NAME); + cluster.plugin(bundle.flatMap(Zip::getArchiveFile)); + javaRestTestTask.configure(t -> t.dependsOn(bundle)); + }); + + // Wire up to check task + project.getTasks().named(LifecycleBasePlugin.CHECK_TASK_NAME).configure(check -> check.dependsOn(javaRestTestTask)); + } +} diff --git a/build-tools/src/main/java/org/elasticsearch/gradle/test/YamlRestTestPlugin.java b/build-tools/src/main/java/org/elasticsearch/gradle/test/YamlRestTestPlugin.java index 1ce03787a0756..2a021ecf537d8 100644 --- a/build-tools/src/main/java/org/elasticsearch/gradle/test/YamlRestTestPlugin.java +++ b/build-tools/src/main/java/org/elasticsearch/gradle/test/YamlRestTestPlugin.java @@ -25,12 +25,15 @@ import org.gradle.api.artifacts.type.ArtifactTypeDefinition; import org.gradle.api.attributes.Attribute; import org.gradle.api.internal.artifacts.ArtifactAttributes; +import org.gradle.api.plugins.BasePlugin; import org.gradle.api.plugins.JavaBasePlugin; +import org.gradle.api.plugins.JavaPlugin; import org.gradle.api.tasks.Copy; import org.gradle.api.tasks.SourceSet; import org.gradle.api.tasks.SourceSetContainer; import org.gradle.api.tasks.TaskProvider; import org.gradle.api.tasks.bundling.Zip; +import org.gradle.language.base.plugins.LifecycleBasePlugin; import java.io.File; @@ -85,6 +88,9 @@ public void apply(Project project) { cluster.plugin(bundle.flatMap(Zip::getArchiveFile)); yamlRestTestTask.configure(t -> t.dependsOn(bundle)); }); + + // Wire up to check task + project.getTasks().named(LifecycleBasePlugin.CHECK_TASK_NAME).configure(check -> check.dependsOn(yamlRestTestTask)); } private static void setupDefaultDependencies( @@ -107,7 +113,7 @@ private TaskProvider setupTestTask( SourceSet testSourceSet, ElasticsearchCluster cluster ) { - return project.getTasks().register("yamlRestTest", StandaloneRestIntegTestTask.class, task -> { + return project.getTasks().register(YAML_REST_TEST, StandaloneRestIntegTestTask.class, task -> { task.useCluster(cluster); task.setTestClassesDirs(testSourceSet.getOutput().getClassesDirs()); task.setClasspath(testSourceSet.getRuntimeClasspath()); diff --git a/modules/kibana/build.gradle b/modules/kibana/build.gradle index 5dbb6a05e9754..896dfb10ce5a8 100644 --- a/modules/kibana/build.gradle +++ b/modules/kibana/build.gradle @@ -5,7 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -apply plugin: 'elasticsearch.java-rest-test' +apply plugin: 'elasticsearch.internal-java-rest-test' esplugin { description 'Plugin exposing APIs for Kibana system indices' diff --git a/modules/lang-mustache/build.gradle b/modules/lang-mustache/build.gradle index 3caee1bfb78b2..7b0d76d55a773 100644 --- a/modules/lang-mustache/build.gradle +++ b/modules/lang-mustache/build.gradle @@ -6,7 +6,7 @@ * Side Public License, v 1. */ apply plugin: 'elasticsearch.internal-yaml-rest-test' -apply plugin: 'elasticsearch.java-rest-test' +apply plugin: 'elasticsearch.internal-java-rest-test' apply plugin: 'elasticsearch.internal-cluster-test' esplugin { diff --git a/modules/reindex/build.gradle b/modules/reindex/build.gradle index 6d6286c848135..3680a4515270a 100644 --- a/modules/reindex/build.gradle +++ b/modules/reindex/build.gradle @@ -15,7 +15,7 @@ import org.elasticsearch.gradle.internal.test.AntFixture apply plugin: 'elasticsearch.test-with-dependencies' apply plugin: 'elasticsearch.jdk-download' apply plugin: 'elasticsearch.internal-yaml-rest-test' -apply plugin: 'elasticsearch.java-rest-test' +apply plugin: 'elasticsearch.internal-java-rest-test' apply plugin: 'elasticsearch.internal-cluster-test' esplugin { diff --git a/modules/transport-netty4/build.gradle b/modules/transport-netty4/build.gradle index 15ca3626cd173..9c19e9888eedd 100644 --- a/modules/transport-netty4/build.gradle +++ b/modules/transport-netty4/build.gradle @@ -6,14 +6,12 @@ * Side Public License, v 1. */ - -import org.elasticsearch.gradle.internal.info.BuildParams import org.elasticsearch.gradle.internal.test.RestIntegTestTask -import org.elasticsearch.gradle.internal.test.rest.JavaRestTestPlugin +import org.elasticsearch.gradle.internal.test.rest.InternalJavaRestTestPlugin import org.elasticsearch.gradle.internal.test.InternalClusterTestPlugin apply plugin: 'elasticsearch.internal-yaml-rest-test' -apply plugin: 'elasticsearch.java-rest-test' +apply plugin: 'elasticsearch.internal-java-rest-test' apply plugin: 'elasticsearch.internal-cluster-test' /* @@ -84,7 +82,7 @@ TaskProvider pooledInternalClusterTest = tasks.register("pooledInternalClu TaskProvider pooledJavaRestTest = tasks.register("pooledJavaRestTest", RestIntegTestTask) { systemProperty 'es.set.netty.runtime.available.processors', 'false' SourceSetContainer sourceSets = project.getExtensions().getByType(SourceSetContainer.class); - SourceSet javaRestTestSourceSet = sourceSets.getByName(JavaRestTestPlugin.SOURCE_SET_NAME) + SourceSet javaRestTestSourceSet = sourceSets.getByName(InternalJavaRestTestPlugin.SOURCE_SET_NAME) setTestClassesDirs(javaRestTestSourceSet.getOutput().getClassesDirs()) setClasspath(javaRestTestSourceSet.getRuntimeClasspath()) diff --git a/plugins/examples/build.gradle b/plugins/examples/build.gradle index 0aba827dbb584..c6f14263a9e75 100644 --- a/plugins/examples/build.gradle +++ b/plugins/examples/build.gradle @@ -20,6 +20,15 @@ subprojects { p -> p.dependencies.add("restTestSpecs", p.dependencies.project(path:':rest-api-spec', configuration:'basicRestSpecs')) } }) + + // configure project dependencies for java rest test plugin. + // plugin defaults to external available artifacts + p.getPluginManager().withPlugin("elasticsearch.java-rest-test", new Action() { + @Override + void execute(AppliedPlugin appliedPlugin) { + p.dependencies.add("javaRestTestImplementation", project(":test:framework")) + } + }) } configure(project('painless-whitelist')) { diff --git a/plugins/examples/security-authorization-engine/build.gradle b/plugins/examples/security-authorization-engine/build.gradle index f5875bd8bb7a0..67dcfbc30b0e8 100644 --- a/plugins/examples/security-authorization-engine/build.gradle +++ b/plugins/examples/security-authorization-engine/build.gradle @@ -1,5 +1,5 @@ apply plugin: 'elasticsearch.internal-es-plugin' -apply plugin: 'elasticsearch.java-rest-test' +apply plugin: 'elasticsearch.internal-java-rest-test' esplugin { name 'security-authorization-engine' diff --git a/qa/die-with-dignity/build.gradle b/qa/die-with-dignity/build.gradle index cd7f2b9f738cc..842705319984b 100644 --- a/qa/die-with-dignity/build.gradle +++ b/qa/die-with-dignity/build.gradle @@ -1,7 +1,7 @@ import org.elasticsearch.gradle.internal.info.BuildParams import org.elasticsearch.gradle.util.GradleUtils -apply plugin: 'elasticsearch.java-rest-test' +apply plugin: 'elasticsearch.internal-java-rest-test' apply plugin: 'elasticsearch.internal-es-plugin' esplugin { diff --git a/qa/system-indices/build.gradle b/qa/system-indices/build.gradle index 6762b90588c17..e9a46971fa3d3 100644 --- a/qa/system-indices/build.gradle +++ b/qa/system-indices/build.gradle @@ -7,7 +7,7 @@ */ apply plugin: 'elasticsearch.internal-es-plugin' -apply plugin: 'elasticsearch.java-rest-test' +apply plugin: 'elasticsearch.internal-java-rest-test' esplugin { name 'system-indices-qa' diff --git a/x-pack/plugin/async-search/qa/security/build.gradle b/x-pack/plugin/async-search/qa/security/build.gradle index 399b951f78f62..d0184395b08d5 100644 --- a/x-pack/plugin/async-search/qa/security/build.gradle +++ b/x-pack/plugin/async-search/qa/security/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.java-rest-test' +apply plugin: 'elasticsearch.internal-java-rest-test' dependencies { javaRestTestImplementation(testArtifact(project(xpackModule('core')))) diff --git a/x-pack/plugin/data-streams/qa/multi-node/build.gradle b/x-pack/plugin/data-streams/qa/multi-node/build.gradle index 5536044f0f7ad..0dfc36b3c8561 100644 --- a/x-pack/plugin/data-streams/qa/multi-node/build.gradle +++ b/x-pack/plugin/data-streams/qa/multi-node/build.gradle @@ -1,6 +1,6 @@ import org.elasticsearch.gradle.internal.info.BuildParams -apply plugin: 'elasticsearch.java-rest-test' +apply plugin: 'elasticsearch.internal-java-rest-test' File repoDir = file("$buildDir/testclusters/repo") diff --git a/x-pack/plugin/data-streams/qa/rest/build.gradle b/x-pack/plugin/data-streams/qa/rest/build.gradle index b7ddf86066a98..65463a2d2817a 100644 --- a/x-pack/plugin/data-streams/qa/rest/build.gradle +++ b/x-pack/plugin/data-streams/qa/rest/build.gradle @@ -1,6 +1,6 @@ import org.elasticsearch.gradle.internal.info.BuildParams -apply plugin: 'elasticsearch.java-rest-test' +apply plugin: 'elasticsearch.internal-java-rest-test' apply plugin: 'elasticsearch.internal-yaml-rest-test' restResources { diff --git a/x-pack/plugin/deprecation/qa/rest/build.gradle b/x-pack/plugin/deprecation/qa/rest/build.gradle index 9ffaa4ca2675e..d38c41e7c27dc 100644 --- a/x-pack/plugin/deprecation/qa/rest/build.gradle +++ b/x-pack/plugin/deprecation/qa/rest/build.gradle @@ -2,7 +2,7 @@ import org.elasticsearch.gradle.util.GradleUtils import org.elasticsearch.gradle.internal.info.BuildParams apply plugin: 'elasticsearch.internal-es-plugin' -apply plugin: 'elasticsearch.java-rest-test' +apply plugin: 'elasticsearch.internal-java-rest-test' esplugin { description 'Deprecated query plugin' diff --git a/x-pack/plugin/enrich/qa/rest-with-advanced-security/build.gradle b/x-pack/plugin/enrich/qa/rest-with-advanced-security/build.gradle index d46f3303e9885..fcfe3422b3ad1 100644 --- a/x-pack/plugin/enrich/qa/rest-with-advanced-security/build.gradle +++ b/x-pack/plugin/enrich/qa/rest-with-advanced-security/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.java-rest-test' +apply plugin: 'elasticsearch.internal-java-rest-test' import org.elasticsearch.gradle.internal.info.BuildParams diff --git a/x-pack/plugin/enrich/qa/rest-with-security/build.gradle b/x-pack/plugin/enrich/qa/rest-with-security/build.gradle index c836314945cec..e00d3e47d6221 100644 --- a/x-pack/plugin/enrich/qa/rest-with-security/build.gradle +++ b/x-pack/plugin/enrich/qa/rest-with-security/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.java-rest-test' +apply plugin: 'elasticsearch.internal-java-rest-test' import org.elasticsearch.gradle.internal.info.BuildParams diff --git a/x-pack/plugin/enrich/qa/rest/build.gradle b/x-pack/plugin/enrich/qa/rest/build.gradle index a1dddf52a320d..e6c6bce0dd98f 100644 --- a/x-pack/plugin/enrich/qa/rest/build.gradle +++ b/x-pack/plugin/enrich/qa/rest/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.java-rest-test' +apply plugin: 'elasticsearch.internal-java-rest-test' apply plugin: 'elasticsearch.internal-yaml-rest-test' import org.elasticsearch.gradle.internal.info.BuildParams diff --git a/x-pack/plugin/eql/qa/correctness/build.gradle b/x-pack/plugin/eql/qa/correctness/build.gradle index 9782cbca220d1..d33429eee7cc7 100644 --- a/x-pack/plugin/eql/qa/correctness/build.gradle +++ b/x-pack/plugin/eql/qa/correctness/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.java-rest-test' +apply plugin: 'elasticsearch.internal-java-rest-test' apply plugin: 'elasticsearch.build' apply plugin: 'elasticsearch.internal-testclusters' tasks.named("test").configure { enabled = false } diff --git a/x-pack/plugin/eql/qa/rest/build.gradle b/x-pack/plugin/eql/qa/rest/build.gradle index dd92d10725699..1d9288c483921 100644 --- a/x-pack/plugin/eql/qa/rest/build.gradle +++ b/x-pack/plugin/eql/qa/rest/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.java-rest-test' +apply plugin: 'elasticsearch.internal-java-rest-test' apply plugin: 'elasticsearch.internal-yaml-rest-test' import org.elasticsearch.gradle.internal.info.BuildParams diff --git a/x-pack/plugin/eql/qa/security/build.gradle b/x-pack/plugin/eql/qa/security/build.gradle index 226c12cf4ae54..bb60b1422af47 100644 --- a/x-pack/plugin/eql/qa/security/build.gradle +++ b/x-pack/plugin/eql/qa/security/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.java-rest-test' +apply plugin: 'elasticsearch.internal-java-rest-test' import org.elasticsearch.gradle.internal.info.BuildParams diff --git a/x-pack/plugin/fleet/build.gradle b/x-pack/plugin/fleet/build.gradle index fecc258a16e80..a26791306248f 100644 --- a/x-pack/plugin/fleet/build.gradle +++ b/x-pack/plugin/fleet/build.gradle @@ -7,7 +7,7 @@ apply plugin: 'elasticsearch.internal-es-plugin' apply plugin: 'elasticsearch.internal-cluster-test' -apply plugin: 'elasticsearch.java-rest-test' +apply plugin: 'elasticsearch.internal-java-rest-test' esplugin { name 'x-pack-fleet' diff --git a/x-pack/plugin/identity-provider/qa/idp-rest-tests/build.gradle b/x-pack/plugin/identity-provider/qa/idp-rest-tests/build.gradle index a068518054205..d69b0f9c5282a 100644 --- a/x-pack/plugin/identity-provider/qa/idp-rest-tests/build.gradle +++ b/x-pack/plugin/identity-provider/qa/idp-rest-tests/build.gradle @@ -1,5 +1,5 @@ import org.elasticsearch.gradle.internal.info.BuildParams -apply plugin: 'elasticsearch.java-rest-test' +apply plugin: 'elasticsearch.internal-java-rest-test' dependencies { javaRestTestImplementation(testArtifact(project(xpackModule('core')))) diff --git a/x-pack/plugin/ilm/qa/multi-node/build.gradle b/x-pack/plugin/ilm/qa/multi-node/build.gradle index cd37b553a1772..f4201370223cd 100644 --- a/x-pack/plugin/ilm/qa/multi-node/build.gradle +++ b/x-pack/plugin/ilm/qa/multi-node/build.gradle @@ -1,7 +1,7 @@ import org.elasticsearch.gradle.util.GradleUtils import org.elasticsearch.gradle.internal.info.BuildParams -apply plugin: 'elasticsearch.java-rest-test' +apply plugin: 'elasticsearch.internal-java-rest-test' dependencies { javaRestTestImplementation(testArtifact(project(xpackModule('core')))) diff --git a/x-pack/plugin/ilm/qa/with-security/build.gradle b/x-pack/plugin/ilm/qa/with-security/build.gradle index a97f0aef1bcf0..30422105738d3 100644 --- a/x-pack/plugin/ilm/qa/with-security/build.gradle +++ b/x-pack/plugin/ilm/qa/with-security/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.java-rest-test' +apply plugin: 'elasticsearch.internal-java-rest-test' dependencies { javaRestTestImplementation project(path: xpackModule('core')) diff --git a/x-pack/plugin/logstash/build.gradle b/x-pack/plugin/logstash/build.gradle index 6d1ab3f57d2f9..cc693da2baa6b 100644 --- a/x-pack/plugin/logstash/build.gradle +++ b/x-pack/plugin/logstash/build.gradle @@ -1,5 +1,5 @@ apply plugin: 'elasticsearch.internal-es-plugin' -apply plugin: 'elasticsearch.java-rest-test' +apply plugin: 'elasticsearch.internal-java-rest-test' esplugin { name 'x-pack-logstash' diff --git a/x-pack/plugin/ml/qa/basic-multi-node/build.gradle b/x-pack/plugin/ml/qa/basic-multi-node/build.gradle index 9d6cd9568f6d2..161179a72e1c5 100644 --- a/x-pack/plugin/ml/qa/basic-multi-node/build.gradle +++ b/x-pack/plugin/ml/qa/basic-multi-node/build.gradle @@ -1,6 +1,6 @@ import org.elasticsearch.gradle.internal.info.BuildParams -apply plugin: 'elasticsearch.java-rest-test' +apply plugin: 'elasticsearch.internal-java-rest-test' testClusters.all { testDistribution = 'DEFAULT' diff --git a/x-pack/plugin/ml/qa/disabled/build.gradle b/x-pack/plugin/ml/qa/disabled/build.gradle index 0b6fd5afed824..7b10a37168ff1 100644 --- a/x-pack/plugin/ml/qa/disabled/build.gradle +++ b/x-pack/plugin/ml/qa/disabled/build.gradle @@ -1,6 +1,6 @@ import org.elasticsearch.gradle.internal.info.BuildParams -apply plugin: 'elasticsearch.java-rest-test' +apply plugin: 'elasticsearch.internal-java-rest-test' //dependencies { // testImplementation project(":x-pack:plugin:core") diff --git a/x-pack/plugin/ml/qa/native-multi-node-tests/build.gradle b/x-pack/plugin/ml/qa/native-multi-node-tests/build.gradle index 0dacea41f6ae6..e76be9b056c57 100644 --- a/x-pack/plugin/ml/qa/native-multi-node-tests/build.gradle +++ b/x-pack/plugin/ml/qa/native-multi-node-tests/build.gradle @@ -1,5 +1,5 @@ import org.elasticsearch.gradle.internal.info.BuildParams -apply plugin: 'elasticsearch.java-rest-test' +apply plugin: 'elasticsearch.internal-java-rest-test' dependencies { javaRestTestImplementation(testArtifact(project(xpackModule('core')))) diff --git a/x-pack/plugin/ml/qa/single-node-tests/build.gradle b/x-pack/plugin/ml/qa/single-node-tests/build.gradle index 2f8f3ac3703a0..e47693cdd2629 100644 --- a/x-pack/plugin/ml/qa/single-node-tests/build.gradle +++ b/x-pack/plugin/ml/qa/single-node-tests/build.gradle @@ -1,6 +1,6 @@ import org.elasticsearch.gradle.internal.info.BuildParams -apply plugin: 'elasticsearch.java-rest-test' +apply plugin: 'elasticsearch.internal-java-rest-test' testClusters.all { testDistribution = 'DEFAULT' diff --git a/x-pack/plugin/searchable-snapshots/qa/rest/build.gradle b/x-pack/plugin/searchable-snapshots/qa/rest/build.gradle index 8d55e58500c3a..cc2ff302f4596 100644 --- a/x-pack/plugin/searchable-snapshots/qa/rest/build.gradle +++ b/x-pack/plugin/searchable-snapshots/qa/rest/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.java-rest-test' +apply plugin: 'elasticsearch.internal-java-rest-test' apply plugin: 'elasticsearch.internal-yaml-rest-test' dependencies { diff --git a/x-pack/plugin/security/qa/basic-enable-security/build.gradle b/x-pack/plugin/security/qa/basic-enable-security/build.gradle index 4aae54c3a21e4..be9756c1e8129 100644 --- a/x-pack/plugin/security/qa/basic-enable-security/build.gradle +++ b/x-pack/plugin/security/qa/basic-enable-security/build.gradle @@ -1,8 +1,7 @@ import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask -import org.elasticsearch.gradle.internal.test.rest.JavaRestTestPlugin import org.elasticsearch.gradle.internal.info.BuildParams -apply plugin: 'elasticsearch.java-rest-test' +apply plugin: 'elasticsearch.internal-java-rest-test' //randomise between implicitly and explicitly disabled security boolean implicitlyDisabledSecurity = (new Random(Long.parseUnsignedLong(BuildParams.testSeed.tokenize(':').get(0), 16))).nextBoolean() diff --git a/x-pack/plugin/security/qa/operator-privileges-tests/build.gradle b/x-pack/plugin/security/qa/operator-privileges-tests/build.gradle index 5fa59af0afaf2..062ca2d8d41ad 100644 --- a/x-pack/plugin/security/qa/operator-privileges-tests/build.gradle +++ b/x-pack/plugin/security/qa/operator-privileges-tests/build.gradle @@ -1,5 +1,5 @@ apply plugin: 'elasticsearch.internal-es-plugin' -apply plugin: 'elasticsearch.java-rest-test' +apply plugin: 'elasticsearch.internal-java-rest-test' esplugin { name 'operator-privileges-test' diff --git a/x-pack/plugin/security/qa/security-basic/build.gradle b/x-pack/plugin/security/qa/security-basic/build.gradle index a2114e7d6c0ba..a9cbfb31fe565 100644 --- a/x-pack/plugin/security/qa/security-basic/build.gradle +++ b/x-pack/plugin/security/qa/security-basic/build.gradle @@ -1,5 +1,5 @@ -apply plugin: 'elasticsearch.java-rest-test' +apply plugin: 'elasticsearch.internal-java-rest-test' import org.elasticsearch.gradle.internal.info.BuildParams diff --git a/x-pack/plugin/security/qa/security-disabled/build.gradle b/x-pack/plugin/security/qa/security-disabled/build.gradle index 7decc85b484aa..673a9ecd76f34 100644 --- a/x-pack/plugin/security/qa/security-disabled/build.gradle +++ b/x-pack/plugin/security/qa/security-disabled/build.gradle @@ -7,7 +7,7 @@ */ import org.elasticsearch.gradle.internal.info.BuildParams -apply plugin: 'elasticsearch.java-rest-test' +apply plugin: 'elasticsearch.internal-java-rest-test' dependencies { javaRestTestImplementation(testArtifact(project(xpackModule('security')))) diff --git a/x-pack/plugin/security/qa/security-not-enabled/build.gradle b/x-pack/plugin/security/qa/security-not-enabled/build.gradle index 9b9ba98f53f8a..d24d649940373 100644 --- a/x-pack/plugin/security/qa/security-not-enabled/build.gradle +++ b/x-pack/plugin/security/qa/security-not-enabled/build.gradle @@ -6,7 +6,7 @@ * defined, it should be not fail */ -apply plugin: 'elasticsearch.java-rest-test' +apply plugin: 'elasticsearch.internal-java-rest-test' dependencies { javaRestTestImplementation(testArtifact(project(xpackModule('security')))) diff --git a/x-pack/plugin/security/qa/security-trial/build.gradle b/x-pack/plugin/security/qa/security-trial/build.gradle index eee5259275b84..a848bbb922867 100644 --- a/x-pack/plugin/security/qa/security-trial/build.gradle +++ b/x-pack/plugin/security/qa/security-trial/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.java-rest-test' +apply plugin: 'elasticsearch.internal-java-rest-test' dependencies { javaRestTestImplementation project(path: xpackModule('core')) diff --git a/x-pack/plugin/security/qa/service-account/build.gradle b/x-pack/plugin/security/qa/service-account/build.gradle index 0f2253d9e7a74..883bb9d25dca9 100644 --- a/x-pack/plugin/security/qa/service-account/build.gradle +++ b/x-pack/plugin/security/qa/service-account/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.java-rest-test' +apply plugin: 'elasticsearch.internal-java-rest-test' dependencies { javaRestTestImplementation project(':x-pack:plugin:core') diff --git a/x-pack/plugin/security/qa/smoke-test-all-realms/build.gradle b/x-pack/plugin/security/qa/smoke-test-all-realms/build.gradle index b2d41146eecf8..14a113cacc318 100644 --- a/x-pack/plugin/security/qa/smoke-test-all-realms/build.gradle +++ b/x-pack/plugin/security/qa/smoke-test-all-realms/build.gradle @@ -6,7 +6,7 @@ * This test is also intended to work correctly on FIPS mode because we also want to know if a realm breaks on FIPS. */ -apply plugin: 'elasticsearch.java-rest-test' +apply plugin: 'elasticsearch.internal-java-rest-test' dependencies { javaRestTestImplementation(testArtifact(project(xpackModule('security')))) diff --git a/x-pack/plugin/security/qa/tls-basic/build.gradle b/x-pack/plugin/security/qa/tls-basic/build.gradle index c297ff01c263f..c839446dbd84f 100644 --- a/x-pack/plugin/security/qa/tls-basic/build.gradle +++ b/x-pack/plugin/security/qa/tls-basic/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.java-rest-test' +apply plugin: 'elasticsearch.internal-java-rest-test' import org.elasticsearch.gradle.internal.info.BuildParams diff --git a/x-pack/plugin/shutdown/qa/multi-node/build.gradle b/x-pack/plugin/shutdown/qa/multi-node/build.gradle index a09a3021d4451..e06f12cf522b6 100644 --- a/x-pack/plugin/shutdown/qa/multi-node/build.gradle +++ b/x-pack/plugin/shutdown/qa/multi-node/build.gradle @@ -1,6 +1,6 @@ import org.elasticsearch.gradle.VersionProperties -apply plugin: 'elasticsearch.java-rest-test' +apply plugin: 'elasticsearch.internal-java-rest-test' dependencies { javaRestTestImplementation(testArtifact(project(xpackModule('core')))) diff --git a/x-pack/plugin/transform/qa/multi-node-tests/build.gradle b/x-pack/plugin/transform/qa/multi-node-tests/build.gradle index aa7a07c166754..fd4943afe89fc 100644 --- a/x-pack/plugin/transform/qa/multi-node-tests/build.gradle +++ b/x-pack/plugin/transform/qa/multi-node-tests/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.java-rest-test' +apply plugin: 'elasticsearch.internal-java-rest-test' dependencies { javaRestTestImplementation(testArtifact(project(xpackModule('core')))) diff --git a/x-pack/plugin/transform/qa/single-node-tests/build.gradle b/x-pack/plugin/transform/qa/single-node-tests/build.gradle index f4a194eb83fbb..0f0003807277e 100644 --- a/x-pack/plugin/transform/qa/single-node-tests/build.gradle +++ b/x-pack/plugin/transform/qa/single-node-tests/build.gradle @@ -1,5 +1,5 @@ -apply plugin: 'elasticsearch.java-rest-test' +apply plugin: 'elasticsearch.internal-java-rest-test' dependencies { javaRestTestImplementation(testArtifact(project(xpackModule('core')))) diff --git a/x-pack/plugin/watcher/qa/rest/build.gradle b/x-pack/plugin/watcher/qa/rest/build.gradle index cdd781c4979ad..7e910d738edfd 100644 --- a/x-pack/plugin/watcher/qa/rest/build.gradle +++ b/x-pack/plugin/watcher/qa/rest/build.gradle @@ -1,6 +1,6 @@ import org.elasticsearch.gradle.internal.info.BuildParams -apply plugin: 'elasticsearch.java-rest-test' +apply plugin: 'elasticsearch.internal-java-rest-test' apply plugin: 'elasticsearch.internal-yaml-rest-test' dependencies { diff --git a/x-pack/plugin/watcher/qa/with-monitoring/build.gradle b/x-pack/plugin/watcher/qa/with-monitoring/build.gradle index 369b0bd15c118..1b824f349e115 100644 --- a/x-pack/plugin/watcher/qa/with-monitoring/build.gradle +++ b/x-pack/plugin/watcher/qa/with-monitoring/build.gradle @@ -1,6 +1,6 @@ import org.elasticsearch.gradle.internal.info.BuildParams -apply plugin: 'elasticsearch.java-rest-test' +apply plugin: 'elasticsearch.internal-java-rest-test' dependencies { javaRestTestImplementation project(':x-pack:qa') diff --git a/x-pack/plugin/watcher/qa/with-security/build.gradle b/x-pack/plugin/watcher/qa/with-security/build.gradle index 45c6470448bac..0b52e208a8c6a 100644 --- a/x-pack/plugin/watcher/qa/with-security/build.gradle +++ b/x-pack/plugin/watcher/qa/with-security/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.java-rest-test' +apply plugin: 'elasticsearch.internal-java-rest-test' apply plugin: 'elasticsearch.internal-yaml-rest-test' dependencies { diff --git a/x-pack/qa/runtime-fields/with-security/build.gradle b/x-pack/qa/runtime-fields/with-security/build.gradle index 8f3d2ba31ee91..a1a64866a3c28 100644 --- a/x-pack/qa/runtime-fields/with-security/build.gradle +++ b/x-pack/qa/runtime-fields/with-security/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.java-rest-test' +apply plugin: 'elasticsearch.internal-java-rest-test' dependencies { javaRestTestImplementation(testArtifact(project(xpackModule('core')))) diff --git a/x-pack/qa/security-example-spi-extension/build.gradle b/x-pack/qa/security-example-spi-extension/build.gradle index 1a29b9c5ee55e..ada919152cdcb 100644 --- a/x-pack/qa/security-example-spi-extension/build.gradle +++ b/x-pack/qa/security-example-spi-extension/build.gradle @@ -1,6 +1,6 @@ import org.elasticsearch.gradle.util.GradleUtils -apply plugin: 'elasticsearch.java-rest-test' +apply plugin: 'elasticsearch.internal-java-rest-test' apply plugin: 'elasticsearch.internal-es-plugin' esplugin {