Skip to content

Commit

Permalink
Skip rolling upgrade bwc on major version change
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Widdis <widdis@gmail.com>
  • Loading branch information
dbwiddis committed Mar 7, 2024
1 parent 6b18d84 commit 873bf6a
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import java.nio.file.Paths
buildscript {
ext {
opensearch_version = System.getProperty("opensearch.version", "3.0.0-SNAPSHOT")
bwcVersionShort = "2.12.0"
buildVersionQualifier = System.getProperty("build.version_qualifier", "")
isSnapshot = "true" == System.getProperty("build.snapshot", "true")
version_tokens = opensearch_version.tokenize('-')
Expand Down Expand Up @@ -207,6 +206,12 @@ jacocoTestReport {
}
tasks.named("check").configure { dependsOn(jacocoTestReport) }

tasks.named("yamlRestTest").configure {
filter {
exclude "**"
includeTestsMatching "**/*YamlTestSuiteIT.*"
}
}

// Set up integration tests
task integTest(type: RestIntegTestTask) {
Expand Down Expand Up @@ -505,6 +510,7 @@ List<Provider<RegularFile>> plugins = [
// Creates 2 test clusters with 3 nodes of the old version.
2.times {i ->
task "${baseName}#oldVersionClusterTask$i"(type: StandaloneRestIntegTestTask) {
onlyIf { isSameMajorVersion || (i == 1) }
useCluster testClusters."${baseName}$i"
filter {
includeTestsMatching "org.opensearch.flowframework.bwc.*IT"
Expand All @@ -521,6 +527,7 @@ 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) {
onlyIf { isSameMajorVersion }
useCluster testClusters."${baseName}0"
dependsOn "${baseName}#oldVersionClusterTask0"
doFirst {
Expand All @@ -540,6 +547,7 @@ 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 { isSameMajorVersion }
dependsOn "${baseName}#mixedClusterTask"
useCluster testClusters."${baseName}0"
doFirst {
Expand All @@ -559,6 +567,7 @@ task "${baseName}#twoThirdsUpgradedClusterTask"(type: StandaloneRestIntegTestTas
// This results in a fully upgraded cluster.
// This is used for rolling upgrade.
task "${baseName}#rollingUpgradeClusterTask"(type: StandaloneRestIntegTestTask) {
onlyIf { isSameMajorVersion }
dependsOn "${baseName}#twoThirdsUpgradedClusterTask"
useCluster testClusters."${baseName}0"
doFirst {
Expand Down Expand Up @@ -614,6 +623,11 @@ allprojects {
}
}
}
// Needed for Gradle 9.0
tasks.withType(StandaloneRestIntegTestTask).configureEach {
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath
}
}

// Automatically sets up the integration test cluster locally
Expand Down

0 comments on commit 873bf6a

Please sign in to comment.