Skip to content

Commit fc1cb08

Browse files
committed
Build: Add master flag for disabling bwc tests (#25230)
This commit adds a gradle project, set inside the root build.gradle, which controls all our bwc tests. This allows for seamless (ie no errant CI failures) backporting of behavior.
1 parent 2ab9b07 commit fc1cb08

File tree

3 files changed

+32
-5
lines changed

3 files changed

+32
-5
lines changed

build.gradle

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,28 @@ task verifyVersions {
141141
}
142142
}
143143

144+
/*
145+
* When adding backcompat behavior that spans major versions, temporarily
146+
* disabling the backcompat tests is necessary. This flag controls
147+
* the enabled state of every bwc task. It should be set back to true
148+
* after the backport of the backcompat code is complete.
149+
*/
150+
allprojects {
151+
ext.bwc_tests_enabled = true
152+
}
153+
154+
task verifyBwcTestsEnabled {
155+
doLast {
156+
if (project.bwc_tests_enabled == false) {
157+
throw new GradleException('Bwc tests are disabled. They must be re-enabled after completing backcompat behavior backporting.')
158+
}
159+
}
160+
}
161+
144162
task branchConsistency {
145163
description 'Ensures this branch is internally consistent. For example, that versions constants match released versions.'
146164
group 'Verification'
147-
dependsOn verifyVersions
165+
dependsOn verifyVersions, verifyBwcTestsEnabled
148166
}
149167

150168
subprojects {

qa/mixed-cluster/build.gradle

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,18 @@ for (Version version : wireCompatVersions) {
5151
dependsOn = [mixedClusterTest]
5252
}
5353

54-
bwcTest.dependsOn(versionBwcTest)
54+
if (project.bwc_tests_enabled) {
55+
bwcTest.dependsOn(versionBwcTest)
56+
}
5557
}
5658

5759
test.enabled = false // no unit tests for rolling upgrades, only the rest integration test
5860

5961
// basic integ tests includes testing bwc against the most recent version
6062
task integTest {
61-
dependsOn = ["v${wireCompatVersions[-1]}#bwcTest"]
63+
if (project.bwc_tests_enabled) {
64+
dependsOn = ["v${wireCompatVersions[-1]}#bwcTest"]
65+
}
6266
}
6367

6468
check.dependsOn(integTest)

qa/rolling-upgrade/build.gradle

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,17 +90,22 @@ for (Version version : wireCompatVersions) {
9090
}
9191

9292
Task versionBwcTest = tasks.create(name: "${baseName}#bwcTest") {
93+
enabled = project.bwc_tests_enabled
9394
dependsOn = [upgradedClusterTest]
9495
}
9596

96-
bwcTest.dependsOn(versionBwcTest)
97+
if (project.bwc_tests_enabled) {
98+
bwcTest.dependsOn(versionBwcTest)
99+
}
97100
}
98101

99102
test.enabled = false // no unit tests for rolling upgrades, only the rest integration test
100103

101104
// basic integ tests includes testing bwc against the most recent version
102105
task integTest {
103-
dependsOn = ["v${wireCompatVersions[-1]}#bwcTest"]
106+
if (project.bwc_tests_enabled) {
107+
dependsOn = ["v${wireCompatVersions[-1]}#bwcTest"]
108+
}
104109
}
105110

106111
check.dependsOn(integTest)

0 commit comments

Comments
 (0)