Skip to content

Commit

Permalink
Conditionally execute rolling upgrade tasks
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Widdis <[email protected]>
  • Loading branch information
dbwiddis committed Mar 7, 2024
1 parent d421109 commit 20def19
Showing 1 changed file with 24 additions and 25 deletions.
49 changes: 24 additions & 25 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -524,15 +524,19 @@ List<Provider<RegularFile>> plugins = [
task "${baseName}#mixedClusterTask"(type: StandaloneRestIntegTestTask) {
dependsOn "${baseName}#oldVersionClusterTask0"
useCluster testClusters."${baseName}0"
// Only do mixed cluster tasks on same major version
if (bwc_major_version != opensearch_major_version) {
ignoreFailures = true
} else {
doFirst {
doFirst {
if (opensearch_major_version == bwc_major_version) {
testClusters."${baseName}0".upgradeNodeAndPluginToNextVersion(plugins)
} else {
testClusters."${baseName}0".upgradeAllNodesAndPluginsToNextVersion(plugins)
}
filter {
}
filter {
if (opensearch_major_version == bwc_major_version) {
includeTestsMatching "org.opensearch.flowframework.bwc.*IT"
} else {
exclude '**/*Test*'
exclude '**/*IT*'
}
}
systemProperty 'tests.rest.bwcsuite', 'mixed_cluster'
Expand All @@ -546,18 +550,14 @@ task "${baseName}#mixedClusterTask"(type: StandaloneRestIntegTestTask) {
// This results in a mixed cluster with 1 node on the old version and 2 upgraded nodes.
// This is used for rolling upgrade.
task "${baseName}#twoThirdsUpgradedClusterTask"(type: StandaloneRestIntegTestTask) {
onlyIf { opensearch_major_version == bwc_major_version }
dependsOn "${baseName}#mixedClusterTask"
useCluster testClusters."${baseName}0"
// Only do mixed cluster tasks on same major version
if (bwc_major_version != opensearch_major_version) {
ignoreFailures = true
} else {
doFirst {
testClusters."${baseName}0".upgradeNodeAndPluginToNextVersion(plugins)
}
filter {
includeTestsMatching "org.opensearch.flowframework.bwc.*IT"
}
doFirst {
testClusters."${baseName}0".upgradeNodeAndPluginToNextVersion(plugins)
}
filter {
includeTestsMatching "org.opensearch.flowframework.bwc.*IT"
}
systemProperty 'tests.rest.bwcsuite', 'mixed_cluster'
systemProperty 'tests.rest.bwcsuite_round', 'second'
Expand All @@ -570,18 +570,17 @@ task "${baseName}#twoThirdsUpgradedClusterTask"(type: StandaloneRestIntegTestTas
// This results in a fully upgraded cluster.
// This is used for rolling upgrade.
task "${baseName}#rollingUpgradeClusterTask"(type: StandaloneRestIntegTestTask) {
dependsOn "${baseName}#twoThirdsUpgradedClusterTask"
useCluster testClusters."${baseName}0"
// Only do mixed cluster tasks on same major version
if (bwc_major_version != opensearch_major_version) {
ignoreFailures = true
} else {
if (opensearch_major_version == bwc_major_version) {
dependsOn "${baseName}#twoThirdsUpgradedClusterTask"
doFirst {
testClusters."${baseName}0".upgradeNodeAndPluginToNextVersion(plugins)
}
filter {
includeTestsMatching "org.opensearch.flowframework.bwc.*IT"
}
} else {
dependsOn "${baseName}#mixedClusterTask"
}
useCluster testClusters."${baseName}0"
filter {
includeTestsMatching "org.opensearch.flowframework.bwc.*IT"
}
mustRunAfter "${baseName}#mixedClusterTask"
systemProperty 'tests.rest.bwcsuite', 'mixed_cluster'
Expand Down

0 comments on commit 20def19

Please sign in to comment.