Fix issue with bwc tests running wrong cluster versions (#58063)
We were previously configuring BWC testing tasks by matching on task name prefix. This naive approach breaks down when you have versions like 1.0.1 and 1.0.10 since they both share a common prefix. This commit makes the pattern matching more specific so we won't inadvertently spin up the wrong cluster version.
This commit is contained in:
parent
5056f2792d
commit
0ce102a5f4
|
@ -93,7 +93,7 @@ for (Version bwcVersion : BuildParams.bwcVersions.indexCompatible) {
|
|||
}
|
||||
|
||||
String oldVersion = bwcVersion.toString().minus("-SNAPSHOT")
|
||||
tasks.matching { it.name.startsWith(baseName) && it.name.endsWith("ClusterTest") }.configureEach {
|
||||
tasks.matching { it.name.startsWith("${baseName}#") && it.name.endsWith("ClusterTest") }.configureEach {
|
||||
it.systemProperty 'tests.old_cluster_version', oldVersion
|
||||
it.systemProperty 'tests.path.repo', "${buildDir}/cluster/shared/repo/${baseName}"
|
||||
it.nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",")}")
|
||||
|
|
|
@ -21,7 +21,7 @@ for (Version bwcVersion : BuildParams.bwcVersions.wireCompatible) {
|
|||
numberOfNodes = 3
|
||||
}
|
||||
}
|
||||
testClusters.matching { it.name.startsWith(baseName) }.all {
|
||||
testClusters.matching { it.name.startsWith("${baseName}-") }.all {
|
||||
testDistribution = "DEFAULT"
|
||||
versions = [bwcVersion.toString(), project.version]
|
||||
|
||||
|
@ -32,7 +32,7 @@ for (Version bwcVersion : BuildParams.bwcVersions.wireCompatible) {
|
|||
setting 'xpack.license.self_generated.type', 'trial'
|
||||
}
|
||||
|
||||
tasks.withType(RestTestRunnerTask).matching { it.name.startsWith(baseName) }.all {
|
||||
tasks.withType(RestTestRunnerTask).matching { it.name.startsWith("${baseName}#") }.all {
|
||||
useCluster testClusters."${baseName}-leader"
|
||||
useCluster testClusters."${baseName}-follower"
|
||||
systemProperty 'tests.upgrade_from_version', bwcVersion.toString().replace('-SNAPSHOT', '')
|
||||
|
|
Loading…
Reference in New Issue