Skip to content

Commit bd398e4

Browse files
authored
Migrate and consolidate x-pack-async-search REST tests (#130832) (#130936)
(cherry picked from commit 06da3a1) # Conflicts: # x-pack/plugin/async-search/qa/rest/build.gradle # x-pack/plugin/async-search/qa/security/build.gradle
1 parent 6ca03ee commit bd398e4

File tree

13 files changed

+49
-55
lines changed

13 files changed

+49
-55
lines changed
Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
apply plugin: 'elasticsearch.internal-es-plugin'
22
apply plugin: 'elasticsearch.internal-cluster-test'
3+
apply plugin: 'elasticsearch.internal-java-rest-test'
4+
apply plugin: 'elasticsearch.internal-yaml-rest-test'
5+
36
esplugin {
47
name = 'x-pack-async-search'
58
description = 'A module which allows to track the progress of a search asynchronously.'
@@ -10,17 +13,24 @@ base {
1013
archivesName = 'x-pack-async-search'
1114
}
1215

13-
addQaCheckDependencies(project)
14-
1516
dependencies {
1617
compileOnly project(":server")
17-
testImplementation testArtifact(project(':server'))
18-
1918
compileOnly project(path: xpackModule('core'))
20-
testImplementation(testArtifact(project(xpackModule('core'))))
21-
testImplementation project(path: xpackModule('async'))
19+
testImplementation testArtifact(project(':server'))
20+
testImplementation testArtifact(project(xpackModule('core')))
21+
testImplementation project(xpackModule('async'))
2222

2323
internalClusterTestImplementation project(":modules:reindex")
24-
}
2524

25+
javaRestTestImplementation testArtifact(project(xpackModule('core')))
26+
27+
clusterModules project(":x-pack:test:deprecated-query")
28+
clusterModules project(':modules:analysis-common')
29+
clusterModules project(':test:external-modules:test-error-query')
30+
}
2631

32+
restResources {
33+
restApi {
34+
include '_common', 'indices', 'index', 'async_search'
35+
}
36+
}

x-pack/plugin/async-search/qa/build.gradle

Whitespace-only changes.

x-pack/plugin/async-search/qa/rest/build.gradle

Lines changed: 0 additions & 32 deletions
This file was deleted.

x-pack/plugin/async-search/qa/security/build.gradle

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* 2.0.
66
*/
77

8-
package org.elasticsearch.qa;
8+
package org.elasticsearch.xpack.search;
99

1010
import org.elasticsearch.client.Request;
1111
import org.elasticsearch.client.Response;
@@ -20,7 +20,7 @@
2020

2121
public class AsyncSearchHeadersIT extends ESRestTestCase {
2222
@ClassRule
23-
public static ElasticsearchCluster cluster = ElasticsearchCluster.local().plugin("x-pack-async-search").build();
23+
public static ElasticsearchCluster cluster = ElasticsearchCluster.local().module("x-pack-async-search").build();
2424

2525
@Override
2626
protected String getTestRestCluster() {
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import org.elasticsearch.search.SearchHit;
2727
import org.elasticsearch.search.SearchResponseUtils;
2828
import org.elasticsearch.test.cluster.ElasticsearchCluster;
29-
import org.elasticsearch.test.cluster.local.distribution.DistributionType;
3029
import org.elasticsearch.test.cluster.util.resource.Resource;
3130
import org.elasticsearch.test.rest.ESRestTestCase;
3231
import org.elasticsearch.xcontent.ConstructingObjectParser;
@@ -95,8 +94,9 @@ public class AsyncSearchSecurityIT extends ESRestTestCase {
9594

9695
@ClassRule
9796
public static ElasticsearchCluster cluster = ElasticsearchCluster.local()
98-
.distribution(DistributionType.DEFAULT)
99-
.nodes(2)
97+
.module("test-error-query")
98+
.module("analysis-common")
99+
.module("x-pack-async-search")
100100
.setting("xpack.license.self_generated.type", "trial")
101101
.setting("xpack.security.enabled", "true")
102102
.rolesFile(Resource.fromClasspath("roles.yml"))
File renamed without changes.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,19 @@
99

1010
import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;
1111

12+
import org.elasticsearch.test.cluster.ElasticsearchCluster;
1213
import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate;
1314
import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase;
15+
import org.junit.ClassRule;
1416

1517
public class AsyncSearchRestIT extends ESClientYamlSuiteTestCase {
1618

19+
@ClassRule
20+
public static ElasticsearchCluster cluster = ElasticsearchCluster.local()
21+
.module("x-pack-test-deprecated-query")
22+
.module("x-pack-async-search")
23+
.build();
24+
1725
public AsyncSearchRestIT(final ClientYamlTestCandidate testCandidate) {
1826
super(testCandidate);
1927
}
@@ -22,4 +30,9 @@ public AsyncSearchRestIT(final ClientYamlTestCandidate testCandidate) {
2230
public static Iterable<Object[]> parameters() throws Exception {
2331
return ESClientYamlSuiteTestCase.createParameters();
2432
}
33+
34+
@Override
35+
protected String getTestRestCluster() {
36+
return cluster.getHttpAddresses();
37+
}
2538
}
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)