Skip to content

Commit

Permalink
Conditionally execute mixed cluster bwc
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 8c468ea
Showing 1 changed file with 25 additions and 32 deletions.
57 changes: 25 additions & 32 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -522,18 +522,15 @@ List<Provider<RegularFile>> plugins = [
// This results in a mixed cluster with 2 nodes on the old version and 1 upgraded node.
// This is also used as a one third upgraded cluster for a rolling upgrade.
task "${baseName}#mixedClusterTask"(type: StandaloneRestIntegTestTask) {
// Only do mixed cluster tasks on same major version
onlyIf { bwc_major_version == opensearch_major_version }
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 {
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', 'first'
Expand All @@ -546,18 +543,15 @@ 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) {
// Only do mixed cluster tasks on same major version
onlyIf { bwc_major_version == opensearch_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 +564,15 @@ task "${baseName}#twoThirdsUpgradedClusterTask"(type: StandaloneRestIntegTestTas
// This results in a fully upgraded cluster.
// This is used for rolling upgrade.
task "${baseName}#rollingUpgradeClusterTask"(type: StandaloneRestIntegTestTask) {
// Only do mixed cluster tasks on same major version
onlyIf { bwc_major_version == opensearch_major_version }
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 {
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"
}
mustRunAfter "${baseName}#mixedClusterTask"
systemProperty 'tests.rest.bwcsuite', 'mixed_cluster'
Expand Down Expand Up @@ -613,8 +604,10 @@ task bwcTestSuite(type: StandaloneRestIntegTestTask) {
exclude '**/*Test*'
exclude '**/*IT*'

dependsOn tasks.named("${baseName}#mixedClusterTask")
dependsOn tasks.named("${baseName}#rollingUpgradeClusterTask")
if (bwc_major_version != opensearch_major_version) {
dependsOn tasks.named("${baseName}#mixedClusterTask")
dependsOn tasks.named("${baseName}#rollingUpgradeClusterTask")
}
dependsOn tasks.named("${baseName}#fullRestartClusterTask")
}

Expand Down

0 comments on commit 8c468ea

Please sign in to comment.