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:
Mark Vieira 2020-06-12 12:33:56 -07:00
parent 5056f2792d
commit 0ce102a5f4
No known key found for this signature in database
GPG Key ID: CA947EF7E6D4B105
2 changed files with 3 additions and 3 deletions

View File

@ -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(",")}")

View File

@ -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', '')