Skip to content

Commit 794aac7

Browse files
authored
[7.x] Convert first 1/2 x-pack plugins from integTest to [yaml | java]RestTest or internalClusterTest (#60630) (#61855)
For 1/2 the plugins in x-pack, the integTest task is now a no-op and all of the tests are now executed via a test, yamlRestTest, javaRestTest, or internalClusterTest. This includes the following projects: async-search, autoscaling, ccr, enrich, eql, frozen-indicies, data-streams, graph, ilm, mapper-constant-keyword, mapper-flattened, ml A few of the more specialized qa projects within these plugins have not been changed with this PR due to additional complexity which should be addressed separately. A follow up PR will address the remaining x-pack plugins (this PR is big enough as-is). related: #61802 related: #56841 related: #59939 related: #55896
1 parent 6eacb6d commit 794aac7

File tree

164 files changed

+277
-347
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

164 files changed

+277
-347
lines changed
Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
import org.elasticsearch.gradle.info.BuildParams
2-
3-
apply plugin: 'elasticsearch.testclusters'
41
apply plugin: 'elasticsearch.esplugin'
5-
apply plugin: 'elasticsearch.rest-resources'
2+
apply plugin: 'elasticsearch.yaml-rest-test'
63

74
esplugin {
85
description 'Deprecated query plugin'
@@ -16,13 +13,9 @@ restResources {
1613
}
1714
}
1815

19-
testClusters.integTest {
16+
testClusters.all {
2017
testDistribution = 'DEFAULT'
21-
// add the deprecated query plugin
22-
plugin file(project(':x-pack:plugin:async-search:qa:rest').tasks.bundlePlugin.archiveFile)
2318
setting 'xpack.security.enabled', 'false'
2419
}
2520

2621
test.enabled = false
27-
28-
check.dependsOn integTest

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

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
apply plugin: 'elasticsearch.testclusters'
2-
apply plugin: 'elasticsearch.standalone-rest-test'
3-
apply plugin: 'elasticsearch.rest-test'
1+
apply plugin: 'elasticsearch.java-rest-test'
42

53
dependencies {
6-
testImplementation project(path: xpackModule('core'), configuration: 'testArtifacts')
7-
testImplementation project(xpackModule('async-search'))
8-
testImplementation project(':x-pack:plugin:async-search:qa')
4+
javaRestTestImplementation project(path: xpackModule('core'), configuration: 'testArtifacts')
5+
javaRestTestImplementation project(xpackModule('async-search'))
6+
javaRestTestImplementation project(':x-pack:plugin:async-search:qa')
97
}
108

11-
testClusters.integTest {
9+
testClusters.all {
1210
testDistribution = 'DEFAULT'
1311
numberOfNodes = 2
1412
setting 'xpack.license.self_generated.type', 'trial'

x-pack/plugin/async-search/src/test/java/org/elasticsearch/xpack/search/BlockingQueryBuilder.java renamed to x-pack/plugin/async-search/src/internalClusterTest/java/org/elasticsearch/xpack/search/BlockingQueryBuilder.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import org.elasticsearch.common.xcontent.XContentBuilder;
1616
import org.elasticsearch.index.query.AbstractQueryBuilder;
1717
import org.elasticsearch.index.query.QueryShardContext;
18-
import org.elasticsearch.xpack.search.AsyncSearchIntegTestCase.SearchResponseIterator;
1918

2019
import java.io.Closeable;
2120
import java.io.IOException;
@@ -125,8 +124,8 @@ public String getWriteableName() {
125124
* A synchronization aid that is used by {@link BlockingQueryBuilder} to block shards executions until
126125
* the consumer calls {@link QueryLatch#countDownAndReset()}.
127126
* The static {@link QueryLatch} is shared in {@link AsyncSearchIntegTestCase#assertBlockingIterator} to provide
128-
* a {@link SearchResponseIterator} that unblocks shards executions whenever {@link SearchResponseIterator#next()}
129-
* is called.
127+
* a {@link AsyncSearchIntegTestCase.SearchResponseIterator} that unblocks shards executions whenever
128+
* {@link AsyncSearchIntegTestCase.SearchResponseIterator#next()} is called.
130129
*/
131130
static class QueryLatch implements Closeable {
132131
private final Set<Integer> failedShards = new HashSet<>();

x-pack/plugin/autoscaling/build.gradle

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,3 @@ gradle.projectsEvaluated {
3333
.findAll { it.path.startsWith(project.path + ":qa") }
3434
.each { check.dependsOn it.check }
3535
}
36-
37-
testingConventions.naming {
38-
IT {
39-
baseClass "org.elasticsearch.xpack.autoscaling.AutoscalingIntegTestCase"
40-
}
41-
}
Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
import org.elasticsearch.gradle.info.BuildParams
2-
import org.elasticsearch.gradle.test.RestIntegTestTask
32

4-
apply plugin: 'elasticsearch.testclusters'
5-
apply plugin: 'elasticsearch.standalone-test'
6-
apply plugin: 'elasticsearch.rest-resources'
3+
apply plugin: 'elasticsearch.yaml-rest-test'
74

85
dependencies {
9-
testImplementation project(path: xpackModule('core'), configuration: 'testArtifacts')
10-
testImplementation project(xpackModule('autoscaling'))
6+
yamlRestTestImplementation project(path: xpackModule('core'), configuration: 'testArtifacts')
117
}
128

139
restResources {
@@ -17,11 +13,7 @@ restResources {
1713
}
1814
}
1915

20-
task restTest(type: RestIntegTestTask) {
21-
mustRunAfter(precommit)
22-
}
23-
24-
testClusters.restTest {
16+
testClusters.all {
2517
testDistribution = 'DEFAULT'
2618
if (BuildParams.isSnapshotBuild() == false) {
2719
systemProperty 'es.autoscaling_feature_flag_registered', 'true'
@@ -32,6 +24,3 @@ testClusters.restTest {
3224
user username: 'autoscaling-admin', password: 'autoscaling-admin-password', role: 'superuser'
3325
user username: 'autoscaling-user', password: 'autoscaling-user-password', role: 'autoscaling'
3426
}
35-
36-
check.dependsOn restTest
37-
test.enabled = false
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public AutoscalingRestIT(final ClientYamlTestCandidate testCandidate) {
2323

2424
@ParametersFactory
2525
public static Iterable<Object[]> parameters() throws Exception {
26-
return ESClientYamlSuiteTestCase.createParameters();
26+
return createParameters();
2727
}
2828

2929
@Override

0 commit comments

Comments
 (0)