Skip to content

Commit

Permalink
Fix remaining tests requiring nextNodeToNextVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
breskeby committed Jan 7, 2025
1 parent 4c5a836 commit 81036e6
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 74 deletions.
50 changes: 16 additions & 34 deletions qa/mixed-cluster/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -96,50 +96,32 @@ buildParams.bwcVersions.withWireCompatible { bwcVersion, baseName ->
tasks.register("${baseName}#mixedClusterTest", StandaloneRestIntegTestTask) {
useCluster baseCluster
mustRunAfter("precommit")
Provider<TestClustersRegistry> serviceProvider = GradleUtils.getBuildService(
project.gradle.sharedServices,
TestClustersPlugin.REGISTRY_SERVICE_NAME
)

def baseInfo = project.getProviders().of(TestClusterValueSource.class) {
it.parameters.path.set(clusterPath)
it.parameters.clusterName.set(baseName)
it.parameters.service = serviceProvider
}.map { it.getAllHttpSocketURI() }

def baseInfoAfterOneNodeUpdate = project.getProviders().of(TestClusterValueSource.class) {
it.parameters.path.set(clusterPath)
it.parameters.clusterName.set(baseName)
it.parameters.service = serviceProvider
}.map { it.getAllHttpSocketURI() }

def baseInfoAfterTwoNodesUpdate = project.getProviders().of(TestClusterValueSource.class) {
it.parameters.path.set(clusterPath)
it.parameters.clusterName.set(baseName)
it.parameters.service = serviceProvider
}.map { it.getAllHttpSocketURI() }
def nonInputProps = nonInputProperties
def sharedRepoFolder = new File(buildDir, "cluster/shared/repo/${baseName}")
def baseInfo = getClusterInfo(baseName).map { it.allHttpSocketURI.join(",") }
def baseInfoAfterOneNodeUpdate = getClusterInfo(baseName).map { it.allHttpSocketURI.join(",") }
def baseInfoAfterTwoNodesUpdate = getClusterInfo(baseName).map { it.allHttpSocketURI.join(",") }
def sharedRepoFolder = layout.buildDirectory.file("cluster/shared/repo/${baseName}").get().asFile
doFirst {
delete(sharedRepoFolder)
// Getting the endpoints causes a wait for the cluster
println "Test cluster endpoints are: ${-> baseInfo.get().join(",")}"
println "Upgrading one node to create a mixed cluster"
baseCluster.get().nextNodeToNextVersion()
getRegistry().get().nextNodeToNextVersion(baseCluster)

// Getting the endpoints causes a wait for the cluster
println "Upgrade complete, endpoints are: ${-> baseInfoAfterOneNodeUpdate.get().join(",")}"
println "Upgrade complete, endpoints are: ${-> baseInfoAfterOneNodeUpdate.get()}"
println "Upgrading another node to create a mixed cluster"
baseCluster.get().nextNodeToNextVersion()
nonInputProps.systemProperty('tests.rest.cluster', baseInfoAfterTwoNodesUpdate.map(c -> c.join(",")))
nonInputProps.systemProperty('tests.clustername', baseName)
if (excludeList.isEmpty() == false) {
systemProperty 'tests.rest.blacklist', excludeList.join(',')
}
getRegistry().get().nextNodeToNextVersion(baseCluster)
}
if (excludeList.isEmpty() == false) {
systemProperty 'tests.rest.blacklist', excludeList.join(',')
}
systemProperty 'tests.path.repo', "${buildDir}/cluster/shared/repo/${baseName}"
nonInputProperties.systemProperty('tests.rest.cluster', baseInfoAfterTwoNodesUpdate)
nonInputProperties.systemProperty('tests.clustername', baseName)
systemProperty 'tests.path.repo', "${layout.buildDirectory.file("cluster/shared/repo/${baseName}").get().asFile}"
systemProperty 'tests.bwc_nodes_version', bwcVersion.toString().replace('-SNAPSHOT', '')
systemProperty 'tests.new_nodes_version', project.version.toString().replace('-SNAPSHOT', '')
// onlyIf("BWC tests disabled") { project.bwc_tests_enabled }
def bwcEnabled = project.bwc_tests_enabled
onlyIf("BWC tests disabled") { bwcEnabled }
}

tasks.register(bwcTaskName(bwcVersion)) {
Expand Down
18 changes: 9 additions & 9 deletions qa/rolling-upgrade-legacy/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ buildParams.bwcVersions.withWireCompatible { bwcVersion, baseName ->
numberOfNodes = 3

setting 'repositories.url.allowed_urls', 'http://snapshot.test*'
setting 'path.repo', "${buildDir}/cluster/shared/repo/${baseName}"
setting 'path.repo', "${layout.buildDirectory.get().asFile}/cluster/shared/repo/${baseName}"
setting 'xpack.security.enabled', 'false'
requiresFeature 'es.index_mode_feature_flag_registered', Version.fromString("8.0.0")
}
Expand All @@ -52,12 +52,12 @@ buildParams.bwcVersions.withWireCompatible { bwcVersion, baseName ->
useCluster baseCluster
mustRunAfter("precommit")
doFirst {
delete("${buildDir}/cluster/shared/repo/${baseName}")
delete("${layout.buildDirectory.get().asFile}/cluster/shared/repo/${baseName}")
}
def excludeList = []
systemProperty 'tests.rest.suite', 'old_cluster'
systemProperty 'tests.upgrade_from_version', oldVersion
nonInputProperties.systemProperty('tests.rest.cluster', baseCluster.map(c -> c.allHttpSocketURI.join(",")))
nonInputProperties.systemProperty('tests.rest.cluster', getClusterInfo(baseName).map { it.allHttpSocketURI.join(",") })
nonInputProperties.systemProperty('tests.clustername', baseName)
if (excludeList.isEmpty() == false) {
systemProperty 'tests.rest.blacklist', excludeList.join(',')
Expand All @@ -68,12 +68,12 @@ buildParams.bwcVersions.withWireCompatible { bwcVersion, baseName ->
dependsOn "${baseName}#oldClusterTest"
useCluster baseCluster
doFirst {
baseCluster.get().nextNodeToNextVersion()
getRegistry().get().nextNodeToNextVersion(baseCluster)
}
systemProperty 'tests.rest.suite', 'mixed_cluster'
systemProperty 'tests.upgrade_from_version', oldVersion
systemProperty 'tests.first_round', 'true'
nonInputProperties.systemProperty('tests.rest.cluster', baseCluster.map(c -> c.allHttpSocketURI.join(",")))
nonInputProperties.systemProperty('tests.rest.cluster', getClusterInfo(baseName).map { it.allHttpSocketURI.join(",") })
nonInputProperties.systemProperty('tests.clustername', baseName)
def excludeList = []
if (excludeList.isEmpty() == false) {
Expand All @@ -85,12 +85,12 @@ buildParams.bwcVersions.withWireCompatible { bwcVersion, baseName ->
dependsOn "${baseName}#oneThirdUpgradedTest"
useCluster baseCluster
doFirst {
baseCluster.get().nextNodeToNextVersion()
getRegistry().get().nextNodeToNextVersion(baseCluster)
}
systemProperty 'tests.rest.suite', 'mixed_cluster'
systemProperty 'tests.upgrade_from_version', oldVersion
systemProperty 'tests.first_round', 'false'
nonInputProperties.systemProperty('tests.rest.cluster', baseCluster.map(c -> c.allHttpSocketURI.join(",")))
nonInputProperties.systemProperty('tests.rest.cluster', getClusterInfo(baseName).map { it.allHttpSocketURI.join(",") })
nonInputProperties.systemProperty('tests.clustername', baseName)
def excludeList = []
if (excludeList.isEmpty() == false) {
Expand All @@ -101,12 +101,12 @@ buildParams.bwcVersions.withWireCompatible { bwcVersion, baseName ->
tasks.register("${baseName}#upgradedClusterTest", StandaloneRestIntegTestTask) {
dependsOn "${baseName}#twoThirdsUpgradedTest"
doFirst {
baseCluster.get().nextNodeToNextVersion()
getRegistry().get().nextNodeToNextVersion(baseCluster)
}
useCluster testClusters.named(baseName)
systemProperty 'tests.rest.suite', 'upgraded_cluster'
systemProperty 'tests.upgrade_from_version', oldVersion
nonInputProperties.systemProperty('tests.rest.cluster', baseCluster.map(c -> c.allHttpSocketURI.join(",")))
nonInputProperties.systemProperty('tests.rest.cluster', getClusterInfo(baseName).map { it.allHttpSocketURI.join(",") })
nonInputProperties.systemProperty('tests.clustername', baseName)
def excludeList = []
if (excludeList.isEmpty() == false) {
Expand Down
17 changes: 9 additions & 8 deletions x-pack/plugin/sql/qa/mixed-node/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,23 @@ buildParams.bwcVersions.withWireCompatible(v -> v.onOrAfter("7.10.3") &&
mustRunAfter("precommit")
testClassesDirs = sourceSets.javaRestTest.output.classesDirs
classpath = sourceSets.javaRestTest.runtimeClasspath
def beforeUpdateInfo = getClusterInfo(baseName).map { it.allHttpSocketURI.join(",") }
def afterUpdateInfo = getClusterInfo(baseName).map { it.allHttpSocketURI.join(",") }
doFirst {
def cluster = baseCluster.get()
// Getting the endpoints causes a wait for the cluster
println "Endpoints are: ${-> cluster.allHttpSocketURI.join(",")}"
println "Endpoints are: ${-> beforeUpdateInfo.get()}"
println "Upgrading one node to create a mixed cluster"
cluster.nextNodeToNextVersion()

println "Upgrade complete, endpoints are: ${-> cluster.allHttpSocketURI.join(",")}"
nonInputProperties.systemProperty('tests.rest.cluster', baseCluster.map(c->c.allHttpSocketURI.join(",")))
nonInputProperties.systemProperty('tests.clustername', baseName)

getRegistry().get().nextNodeToNextVersion(cluster)
println "Upgrade complete, endpoints are: ${-> afterUpdateInfo.get() }"
}
nonInputProperties.systemProperty('tests.rest.cluster', getClusterInfo(baseName).map { it.allHttpSocketURI.join(",") })
nonInputProperties.systemProperty('tests.clustername', baseName)
systemProperty 'tests.bwc_nodes_version', bwcVersion.toString().replace('-SNAPSHOT', '')
systemProperty 'tests.new_nodes_version', project.version.toString().replace('-SNAPSHOT', '')

onlyIf("BWC tests disabled") { project.bwc_tests_enabled }
def bwcEnabled = project.bwc_tests_enabled
onlyIf("BWC tests disabled") { bwcEnabled }
}

tasks.register(bwcTaskName(bwcVersion)) {
Expand Down
10 changes: 5 additions & 5 deletions x-pack/qa/mixed-tier-cluster/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ buildParams.bwcVersions.withWireCompatible(v -> v.onOrAfter("7.9.0") &&
tasks.register("${baseName}#mixedClusterTest", StandaloneRestIntegTestTask) {
useCluster baseCluster
mustRunAfter("precommit")
def beforeEndpoints = getClusterInfo(baseName).map { it.allHttpSocketURI.join(",") }
doFirst {
// Getting the endpoints causes a wait for the cluster
println "Endpoints are: ${-> baseCluster.get().allHttpSocketURI.join(",")}"
baseCluster.get().nextNodeToNextVersion()

nonInputProperties.systemProperty('tests.rest.cluster', baseCluster.map(c->c.allHttpSocketURI.join(",")))
nonInputProperties.systemProperty('tests.clustername', baseName)
println "Endpoints are: ${-> beforeEndpoints.get()}"
getRegistry().get().nextNodeToNextVersion(baseCluster)
}
nonInputProperties.systemProperty('tests.rest.cluster', getClusterInfo(baseName).map { it.allHttpSocketURI.join(",") })
nonInputProperties.systemProperty('tests.clustername', baseName)
onlyIf("BWC tests disabled") { project.bwc_tests_enabled }
}

Expand Down
14 changes: 7 additions & 7 deletions x-pack/qa/rolling-upgrade-multi-cluster/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ buildParams.bwcVersions.withWireCompatible { bwcVersion, baseName ->
def baseCluster = testClusters.named("${baseName}-${kindExt}").get()
if (name.endsWith("#clusterTest") == false) {
println "Upgrade node $it"
baseCluster.nextNodeToNextVersion()
getRegistry().get().nextNodeToNextVersion(baseCluster)
}
nonInputProperties.systemProperty('tests.rest.cluster', baseCluster.allHttpSocketURI.join(","))
nonInputProperties.systemProperty('tests.clustername', baseName)
nonInputProperties.systemProperty('tests.leader_host', baseLeaderCluster.map(c->c.allHttpSocketURI.last()))
nonInputProperties.systemProperty('tests.leader_remote_cluster_seed', baseLeaderCluster.map(c -> c.allTransportPortURI.last()))
nonInputProperties.systemProperty('tests.follower_host', baseFollowerCluster.map(c -> c.allHttpSocketURI.last()))
nonInputProperties.systemProperty('tests.follower_remote_cluster_seed', baseFollowerCluster.map(c -> c.allTransportPortURI.last()))
}
nonInputProperties.systemProperty('tests.rest.cluster', getClusterInfo(baseCluster.name).map { it.allHttpSocketURI.join(",") })
nonInputProperties.systemProperty('tests.clustername', baseName)
nonInputProperties.systemProperty('tests.leader_host', getClusterInfo(baseLeaderCluster.name).map { c->c.allHttpSocketURI.last() })
nonInputProperties.systemProperty('tests.leader_remote_cluster_seed', getClusterInfo(baseLeaderCluster.name).map { c -> c.allTransportPortURI.last() })
nonInputProperties.systemProperty('tests.follower_host', getClusterInfo(baseFollowerCluster.name).map { c->c.allHttpSocketURI.last() })
nonInputProperties.systemProperty('tests.follower_remote_cluster_seed', getClusterInfo(baseFollowerCluster.name).map { c -> c.allTransportPortURI.last() })
}

["follower", "leader"].each { kind ->
Expand Down
22 changes: 11 additions & 11 deletions x-pack/qa/rolling-upgrade/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ tasks.named("forbiddenPatterns").configure {
exclude '**/system_key'
}

String outputDir = "${buildDir}/generated-resources/${project.name}"
String outputDir = "${layout.buildDirectory.get().asFile}/generated-resources/${project.name}"

tasks.register("copyTestNodeKeyMaterial", Copy) {
from project(':x-pack:plugin:core').files('src/test/resources/org/elasticsearch/xpack/security/transport/ssl/certs/simple/testnode.pem',
Expand All @@ -41,7 +41,7 @@ buildParams.bwcVersions.withWireCompatible { bwcVersion, baseName ->
String oldVersion = bwcVersion.toString()

// SearchableSnapshotsRollingUpgradeIT uses a specific repository to not interfere with other tests
String searchableSnapshotRepository = "${buildDir}/cluster/shared/searchable-snapshots-repo/${baseName}"
String searchableSnapshotRepository = "${layout.buildDirectory.get().asFile}/cluster/shared/searchable-snapshots-repo/${baseName}"

def baseCluster = testClusters.register(baseName) {
testDistribution = "DEFAULT"
Expand All @@ -56,7 +56,7 @@ buildParams.bwcVersions.withWireCompatible { bwcVersion, baseName ->
}

setting 'repositories.url.allowed_urls', 'http://snapshot.test*'
setting 'path.repo', "['${buildDir}/cluster/shared/repo/${baseName}', '${searchableSnapshotRepository}']"
setting 'path.repo', "['${layout.buildDirectory.get().asFile}/cluster/shared/repo/${baseName}', '${searchableSnapshotRepository}']"
setting 'xpack.license.self_generated.type', 'trial'
setting 'xpack.security.enabled', 'true'
setting 'xpack.security.transport.ssl.enabled', 'true'
Expand Down Expand Up @@ -125,14 +125,14 @@ buildParams.bwcVersions.withWireCompatible { bwcVersion, baseName ->
mustRunAfter("precommit")
dependsOn "copyTestNodeKeyMaterial"
doFirst {
delete("${buildDir}/cluster/shared/repo/${baseName}")
delete("${layout.buildDirectory.get().asFile}/cluster/shared/repo/${baseName}")
delete("${searchableSnapshotRepository}")
}

systemProperty 'tests.rest.suite', 'old_cluster'
systemProperty 'tests.upgrade_from_version', oldVersion
systemProperty 'tests.path.searchable.snapshots.repo', searchableSnapshotRepository
nonInputProperties.systemProperty('tests.rest.cluster', baseCluster.map(c->c.allHttpSocketURI.join(",")))
nonInputProperties.systemProperty('tests.rest.cluster', getClusterInfo(baseName).map { it.allHttpSocketURI.join(",") })
nonInputProperties.systemProperty('tests.clustername', baseName)

// Disable ML tests for incompatible systems
Expand All @@ -146,9 +146,9 @@ buildParams.bwcVersions.withWireCompatible { bwcVersion, baseName ->
dependsOn "${baseName}#oldClusterTest"
useCluster baseCluster
doFirst {
baseCluster.get().nextNodeToNextVersion()
getRegistry().get().nextNodeToNextVersion(baseCluster)
}
nonInputProperties.systemProperty('tests.rest.cluster', baseCluster.map(c->c.allHttpSocketURI.join(",")))
nonInputProperties.systemProperty('tests.rest.cluster', getClusterInfo(baseName).map { it.allHttpSocketURI.join(",") })
nonInputProperties.systemProperty('tests.clustername', baseName)
systemProperty 'tests.rest.suite', 'mixed_cluster'
systemProperty 'tests.first_round', 'true'
Expand Down Expand Up @@ -183,9 +183,9 @@ buildParams.bwcVersions.withWireCompatible { bwcVersion, baseName ->
dependsOn "${baseName}#oneThirdUpgradedTest"
useCluster baseCluster
doFirst {
baseCluster.get().nextNodeToNextVersion()
getRegistry().get().nextNodeToNextVersion(baseCluster)
}
nonInputProperties.systemProperty('tests.rest.cluster', "${-> baseCluster.get().allHttpSocketURI.join(",")}")
nonInputProperties.systemProperty('tests.rest.cluster', getClusterInfo(baseName).map { it.allHttpSocketURI.join(",") })
nonInputProperties.systemProperty('tests.clustername', baseName)
systemProperty 'tests.rest.suite', 'mixed_cluster'
systemProperty 'tests.first_round', 'false'
Expand All @@ -203,9 +203,9 @@ buildParams.bwcVersions.withWireCompatible { bwcVersion, baseName ->
dependsOn "${baseName}#twoThirdsUpgradedTest"
useCluster baseCluster
doFirst {
baseCluster.get().nextNodeToNextVersion()
getRegistry().get().nextNodeToNextVersion(baseCluster)
}
nonInputProperties.systemProperty('tests.rest.cluster', "${-> baseCluster.get().allHttpSocketURI.join(",")}")
nonInputProperties.systemProperty('tests.rest.cluster', getClusterInfo(baseName).map { it.allHttpSocketURI.join(",") })
nonInputProperties.systemProperty('tests.clustername', baseName)
systemProperty 'tests.rest.suite', 'upgraded_cluster'
systemProperty 'tests.upgrade_from_version', oldVersion
Expand Down

0 comments on commit 81036e6

Please sign in to comment.