Skip to content

Commit fc38909

Browse files
author
Christoph Büscher
authored
Expand coverage of :qa:multi-cluster-search (#85281)
Currently this qa module runs integration tests that cover cross-cluster search with both the local and the remote cluster on the same version. In order to also cover cross-cluster communication across multiple versions, this change adds additional test tasks that also start a remote cluster in all wire-compatible previous minor version and run the same tests against this configuration. Relates #84481
1 parent 660d9f7 commit fc38909

File tree

1 file changed

+51
-28
lines changed

1 file changed

+51
-28
lines changed

qa/multi-cluster-search/build.gradle

Lines changed: 51 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,52 +6,75 @@
66
* Side Public License, v 1.
77
*/
88

9+
/*
10+
This qa module runs yaml and java against a local and a remote clusters connected via CCS.
11+
The local cluster is always on the current version, the remote cluster is tested for all wire-compatible versions
12+
that are also CCS compatible (i.e. all versions on the previous minor branch)
13+
*/
14+
915

1016
import org.elasticsearch.gradle.Version
1117
import org.elasticsearch.gradle.internal.info.BuildParams
1218
import org.elasticsearch.gradle.internal.test.RestIntegTestTask
1319

1420
apply plugin: 'elasticsearch.internal-testclusters'
1521
apply plugin: 'elasticsearch.standalone-rest-test'
22+
apply plugin: 'elasticsearch.bwc-test'
1623
apply plugin: 'elasticsearch.rest-resources'
1724

18-
1925
dependencies {
2026
testImplementation project(":client:rest-high-level")
2127
}
2228

23-
testClusters.register('remote-cluster')
24-
25-
tasks.register('remote-cluster', RestIntegTestTask) {
26-
mustRunAfter("precommit")
27-
systemProperty 'tests.rest.suite', 'remote_cluster'
29+
def ccsSupportedVersion = bwcVersion -> {
30+
def currentVersion = Version.fromString(project.version)
31+
// in case the current version is the first in a new major series, all wire compatible versions (i.e. last minor of previous major)
32+
// are CCS compatible
33+
return currentVersion.minor == 0 || (currentVersion.major == bwcVersion.major && currentVersion.minor - bwcVersion.minor <= 1)
2834
}
2935

30-
testClusters.configureEach {
31-
requiresFeature 'es.index_mode_feature_flag_registered', Version.fromString("8.0.0")
32-
}
36+
BuildParams.bwcVersions.withWireCompatible(ccsSupportedVersion) { bwcVersion, baseName ->
3337

34-
testClusters.matching{ it.name == 'remote-cluster' }.configureEach {
35-
numberOfNodes = 2
36-
setting 'node.roles', '[data,ingest,master]'
37-
setting 'xpack.security.enabled', 'false'
38-
}
38+
def remoteCluster = testClusters.register("${baseName}-remote") {
39+
numberOfNodes = 2
40+
versions = [bwcVersion.toString()]
41+
setting 'node.roles', '[data,ingest,master]'
42+
}
3943

40-
tasks.register("mixedClusterTest", RestIntegTestTask) {
41-
useCluster testClusters.named('remote-cluster')
42-
dependsOn 'remote-cluster'
43-
systemProperty 'tests.rest.suite', 'multi_cluster'
44-
}
44+
def localCluster = testClusters.register("${baseName}-local") {
45+
versions = [project.version]
46+
setting 'node.roles', '[data,ingest,master,remote_cluster_client]'
47+
setting 'cluster.remote.connections_per_cluster', '1'
48+
setting 'cluster.remote.my_remote_cluster.seeds',
49+
{ "\"${remoteCluster.get().getAllTransportPortURI().get(0)}\"" }
50+
}
4551

46-
testClusters.matching { it.name == "mixedClusterTest"}.configureEach {
47-
setting 'cluster.remote.my_remote_cluster.seeds',
48-
{ "\"${testClusters.'remote-cluster'.getAllTransportPortURI().get(0)}\"" }
49-
setting 'cluster.remote.connections_per_cluster', '1'
50-
setting 'xpack.security.enabled', 'false'
51-
}
52+
tasks.register("${baseName}#remote-cluster", RestIntegTestTask) {
53+
useCluster remoteCluster
54+
doFirst {
55+
nonInputProperties.systemProperty('tests.rest.suite', 'remote_cluster')
56+
nonInputProperties.systemProperty('tests.rest.cluster', remoteCluster.map(c -> c.allHttpSocketURI.join(",")))
57+
}
58+
dependsOn "processTestResources"
59+
}
60+
61+
tasks.register("${baseName}#multi-cluster", RestIntegTestTask) {
62+
useCluster localCluster
63+
useCluster remoteCluster
64+
doFirst {
65+
nonInputProperties.systemProperty('tests.rest.suite', 'multi_cluster')
66+
nonInputProperties.systemProperty('tests.rest.cluster', localCluster.map(c -> c.allHttpSocketURI.join(",")))
67+
}
68+
dependsOn "${baseName}#remote-cluster"
69+
}
5270

53-
tasks.register("integTest") {
54-
dependsOn "mixedClusterTest"
71+
tasks.register(bwcTaskName(bwcVersion)) {
72+
dependsOn "${baseName}#multi-cluster"
73+
mustRunAfter("precommit")
74+
}
5575
}
5676

57-
tasks.named("check").configure { dependsOn("integTest") }
77+
testClusters.configureEach {
78+
setting 'xpack.security.enabled', 'false'
79+
requiresFeature 'es.index_mode_feature_flag_registered', Version.fromString("8.0.0")
80+
}

0 commit comments

Comments
 (0)