From bd2527d7425f86b2e015f265e510cf4ca1f102cd Mon Sep 17 00:00:00 2001 From: Daniel Widdis Date: Wed, 6 Mar 2024 17:16:45 -0800 Subject: [PATCH] Conditionally execute rolling upgrade tasks Signed-off-by: Daniel Widdis --- build.gradle | 50 +++++++++++++++++++++----------------------------- 1 file changed, 21 insertions(+), 29 deletions(-) diff --git a/build.gradle b/build.gradle index b840d4f51..ee9af29d7 100644 --- a/build.gradle +++ b/build.gradle @@ -522,18 +522,14 @@ List> 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) { + onlyIf { opensearch_major_version == bwc_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 { + doFirst { testClusters."${baseName}0".upgradeNodeAndPluginToNextVersion(plugins) - } - filter { - includeTestsMatching "org.opensearch.flowframework.bwc.*IT" - } + } + filter { + includeTestsMatching "org.opensearch.flowframework.bwc.*IT" } systemProperty 'tests.rest.bwcsuite', 'mixed_cluster' systemProperty 'tests.rest.bwcsuite_round', 'first' @@ -546,18 +542,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' @@ -570,20 +562,21 @@ 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}#oldVersionClusterTask0" + doFirst { + testClusters."${baseName}0".upgradeAllNodesAndPluginsToNextVersion(plugins) } } - mustRunAfter "${baseName}#mixedClusterTask" + useCluster testClusters."${baseName}0" + filter { + includeTestsMatching "org.opensearch.flowframework.bwc.*IT" + } systemProperty 'tests.rest.bwcsuite', 'mixed_cluster' systemProperty 'tests.rest.bwcsuite_round', 'third' systemProperty 'tests.plugin_bwc_version', bwcVersion @@ -613,7 +606,6 @@ task bwcTestSuite(type: StandaloneRestIntegTestTask) { exclude '**/*Test*' exclude '**/*IT*' - dependsOn tasks.named("${baseName}#mixedClusterTask") dependsOn tasks.named("${baseName}#rollingUpgradeClusterTask") dependsOn tasks.named("${baseName}#fullRestartClusterTask") }