diff --git a/x-pack/plugin/async-search/build.gradle b/x-pack/plugin/async-search/build.gradle index b013d1df46b97..6117f8bea15dc 100644 --- a/x-pack/plugin/async-search/build.gradle +++ b/x-pack/plugin/async-search/build.gradle @@ -1,5 +1,8 @@ apply plugin: 'elasticsearch.internal-es-plugin' apply plugin: 'elasticsearch.internal-cluster-test' +apply plugin: 'elasticsearch.internal-java-rest-test' +apply plugin: 'elasticsearch.internal-yaml-rest-test' + esplugin { name = 'x-pack-async-search' description = 'A module which allows to track the progress of a search asynchronously.' @@ -10,17 +13,24 @@ base { archivesName = 'x-pack-async-search' } -addQaCheckDependencies(project) - dependencies { compileOnly project(":server") - testImplementation testArtifact(project(':server')) - compileOnly project(path: xpackModule('core')) - testImplementation(testArtifact(project(xpackModule('core')))) - testImplementation project(path: xpackModule('async')) + testImplementation testArtifact(project(':server')) + testImplementation testArtifact(project(xpackModule('core'))) + testImplementation project(xpackModule('async')) internalClusterTestImplementation project(":modules:reindex") -} + javaRestTestImplementation testArtifact(project(xpackModule('core'))) + + clusterModules project(":x-pack:test:deprecated-query") + clusterModules project(':modules:analysis-common') + clusterModules project(':test:external-modules:test-error-query') +} +restResources { + restApi { + include '_common', 'indices', 'index', 'async_search' + } +} diff --git a/x-pack/plugin/async-search/qa/build.gradle b/x-pack/plugin/async-search/qa/build.gradle deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/x-pack/plugin/async-search/qa/rest/build.gradle b/x-pack/plugin/async-search/qa/rest/build.gradle deleted file mode 100644 index 7363aed336aaf..0000000000000 --- a/x-pack/plugin/async-search/qa/rest/build.gradle +++ /dev/null @@ -1,37 +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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -apply plugin: 'elasticsearch.base-internal-es-plugin' -apply plugin: 'elasticsearch.internal-java-rest-test' -apply plugin: 'elasticsearch.legacy-yaml-rest-test' -apply plugin: 'elasticsearch.legacy-yaml-rest-compat-test' - -esplugin { - name = 'x-pack-test-deprecated-query' - description = 'Deprecated query plugin' - classname ='org.elasticsearch.query.DeprecatedQueryPlugin' -} - -dependencies { - clusterPlugins project(xpackModule('async-search')) -} - -restResources { - restApi { - include '_common', 'indices', 'index', 'async_search' - } -} - -testClusters.configureEach { - testDistribution = 'DEFAULT' - setting 'xpack.security.enabled', 'false' -} - -// Test clusters run with security disabled -tasks.named("yamlRestTest") { - buildParams.withFipsEnabledOnly(it) -} diff --git a/x-pack/plugin/async-search/qa/security/build.gradle b/x-pack/plugin/async-search/qa/security/build.gradle deleted file mode 100644 index 79a379c48bc6e..0000000000000 --- a/x-pack/plugin/async-search/qa/security/build.gradle +++ /dev/null @@ -1,11 +0,0 @@ -apply plugin: 'elasticsearch.internal-java-rest-test' - -dependencies { - javaRestTestImplementation(testArtifact(project(xpackModule('core')))) - javaRestTestImplementation project(xpackModule('async-search')) - javaRestTestImplementation project(':test:framework') -} - -tasks.named("javaRestTest").configure { - usesDefaultDistribution("to be triaged") -} diff --git a/x-pack/plugin/async-search/qa/rest/src/javaRestTest/java/org/elasticsearch/qa/AsyncSearchHeadersIT.java b/x-pack/plugin/async-search/src/javaRestTest/java/org/elasticsearch/xpack/search/AsyncSearchHeadersIT.java similarity index 95% rename from x-pack/plugin/async-search/qa/rest/src/javaRestTest/java/org/elasticsearch/qa/AsyncSearchHeadersIT.java rename to x-pack/plugin/async-search/src/javaRestTest/java/org/elasticsearch/xpack/search/AsyncSearchHeadersIT.java index de2bfd4c98ec9..5fe2eabf43aab 100644 --- a/x-pack/plugin/async-search/qa/rest/src/javaRestTest/java/org/elasticsearch/qa/AsyncSearchHeadersIT.java +++ b/x-pack/plugin/async-search/src/javaRestTest/java/org/elasticsearch/xpack/search/AsyncSearchHeadersIT.java @@ -5,7 +5,7 @@ * 2.0. */ -package org.elasticsearch.qa; +package org.elasticsearch.xpack.search; import org.elasticsearch.client.Request; import org.elasticsearch.client.Response; @@ -20,7 +20,7 @@ public class AsyncSearchHeadersIT extends ESRestTestCase { @ClassRule - public static ElasticsearchCluster cluster = ElasticsearchCluster.local().plugin("x-pack-async-search").build(); + public static ElasticsearchCluster cluster = ElasticsearchCluster.local().module("x-pack-async-search").build(); @Override protected String getTestRestCluster() { diff --git a/x-pack/plugin/async-search/qa/security/src/javaRestTest/java/org/elasticsearch/xpack/search/AsyncSearchSecurityIT.java b/x-pack/plugin/async-search/src/javaRestTest/java/org/elasticsearch/xpack/search/AsyncSearchSecurityIT.java similarity index 99% rename from x-pack/plugin/async-search/qa/security/src/javaRestTest/java/org/elasticsearch/xpack/search/AsyncSearchSecurityIT.java rename to x-pack/plugin/async-search/src/javaRestTest/java/org/elasticsearch/xpack/search/AsyncSearchSecurityIT.java index c5736fb440586..453c721674e01 100644 --- a/x-pack/plugin/async-search/qa/security/src/javaRestTest/java/org/elasticsearch/xpack/search/AsyncSearchSecurityIT.java +++ b/x-pack/plugin/async-search/src/javaRestTest/java/org/elasticsearch/xpack/search/AsyncSearchSecurityIT.java @@ -26,7 +26,6 @@ import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.SearchResponseUtils; import org.elasticsearch.test.cluster.ElasticsearchCluster; -import org.elasticsearch.test.cluster.local.distribution.DistributionType; import org.elasticsearch.test.cluster.util.resource.Resource; import org.elasticsearch.test.rest.ESRestTestCase; import org.elasticsearch.xcontent.ConstructingObjectParser; @@ -95,8 +94,9 @@ public class AsyncSearchSecurityIT extends ESRestTestCase { @ClassRule public static ElasticsearchCluster cluster = ElasticsearchCluster.local() - .distribution(DistributionType.DEFAULT) - .nodes(2) + .module("test-error-query") + .module("analysis-common") + .module("x-pack-async-search") .setting("xpack.license.self_generated.type", "trial") .setting("xpack.security.enabled", "true") .rolesFile(Resource.fromClasspath("roles.yml")) diff --git a/x-pack/plugin/async-search/qa/security/src/javaRestTest/resources/roles.yml b/x-pack/plugin/async-search/src/javaRestTest/resources/roles.yml similarity index 100% rename from x-pack/plugin/async-search/qa/security/src/javaRestTest/resources/roles.yml rename to x-pack/plugin/async-search/src/javaRestTest/resources/roles.yml diff --git a/x-pack/plugin/async-search/qa/rest/src/yamlRestTest/java/org/elasticsearch/qa/AsyncSearchRestIT.java b/x-pack/plugin/async-search/src/yamlRestTest/java/org/elasticsearch/qa/AsyncSearchRestIT.java similarity index 67% rename from x-pack/plugin/async-search/qa/rest/src/yamlRestTest/java/org/elasticsearch/qa/AsyncSearchRestIT.java rename to x-pack/plugin/async-search/src/yamlRestTest/java/org/elasticsearch/qa/AsyncSearchRestIT.java index cfcf2705c19c6..acc494318726b 100644 --- a/x-pack/plugin/async-search/qa/rest/src/yamlRestTest/java/org/elasticsearch/qa/AsyncSearchRestIT.java +++ b/x-pack/plugin/async-search/src/yamlRestTest/java/org/elasticsearch/qa/AsyncSearchRestIT.java @@ -9,11 +9,19 @@ import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; +import org.elasticsearch.test.cluster.ElasticsearchCluster; import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; +import org.junit.ClassRule; public class AsyncSearchRestIT extends ESClientYamlSuiteTestCase { + @ClassRule + public static ElasticsearchCluster cluster = ElasticsearchCluster.local() + .module("x-pack-test-deprecated-query") + .module("x-pack-async-search") + .build(); + public AsyncSearchRestIT(final ClientYamlTestCandidate testCandidate) { super(testCandidate); } @@ -22,4 +30,9 @@ public AsyncSearchRestIT(final ClientYamlTestCandidate testCandidate) { public static Iterable parameters() throws Exception { return ESClientYamlSuiteTestCase.createParameters(); } + + @Override + protected String getTestRestCluster() { + return cluster.getHttpAddresses(); + } } diff --git a/x-pack/plugin/async-search/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/async-search/10_deprecation.yml b/x-pack/plugin/async-search/src/yamlRestTest/resources/rest-api-spec/test/async-search/10_deprecation.yml similarity index 100% rename from x-pack/plugin/async-search/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/async-search/10_deprecation.yml rename to x-pack/plugin/async-search/src/yamlRestTest/resources/rest-api-spec/test/async-search/10_deprecation.yml diff --git a/x-pack/plugin/async-search/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/async-search/20_keep_alive.yml b/x-pack/plugin/async-search/src/yamlRestTest/resources/rest-api-spec/test/async-search/20_keep_alive.yml similarity index 100% rename from x-pack/plugin/async-search/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/async-search/20_keep_alive.yml rename to x-pack/plugin/async-search/src/yamlRestTest/resources/rest-api-spec/test/async-search/20_keep_alive.yml diff --git a/x-pack/test/deprecated-query/build.gradle b/x-pack/test/deprecated-query/build.gradle new file mode 100644 index 0000000000000..b0c14cd6b5d42 --- /dev/null +++ b/x-pack/test/deprecated-query/build.gradle @@ -0,0 +1,14 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +apply plugin: 'elasticsearch.base-internal-es-plugin' + +esplugin { + name = 'x-pack-test-deprecated-query' + description = 'Deprecated query plugin' + classname ='org.elasticsearch.query.DeprecatedQueryPlugin' +} diff --git a/x-pack/plugin/async-search/qa/rest/src/main/java/org/elasticsearch/query/DeprecatedQueryBuilder.java b/x-pack/test/deprecated-query/src/main/java/org/elasticsearch/query/DeprecatedQueryBuilder.java similarity index 100% rename from x-pack/plugin/async-search/qa/rest/src/main/java/org/elasticsearch/query/DeprecatedQueryBuilder.java rename to x-pack/test/deprecated-query/src/main/java/org/elasticsearch/query/DeprecatedQueryBuilder.java diff --git a/x-pack/plugin/async-search/qa/rest/src/main/java/org/elasticsearch/query/DeprecatedQueryPlugin.java b/x-pack/test/deprecated-query/src/main/java/org/elasticsearch/query/DeprecatedQueryPlugin.java similarity index 100% rename from x-pack/plugin/async-search/qa/rest/src/main/java/org/elasticsearch/query/DeprecatedQueryPlugin.java rename to x-pack/test/deprecated-query/src/main/java/org/elasticsearch/query/DeprecatedQueryPlugin.java