Skip to content

Commit 106e373

Browse files
authored
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 caf7792 commit 106e373

File tree

4 files changed

+38
-7
lines changed

4 files changed

+38
-7
lines changed

build.gradle

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,28 @@ task verifyVersions {
152152
}
153153
}
154154

155+
/*
156+
* When adding backcompat behavior that spans major versions, temporarily
157+
* disabling the backcompat tests is necessary. This flag controls
158+
* the enabled state of every bwc task. It should be set back to true
159+
* after the backport of the backcompat code is complete.
160+
*/
161+
allprojects {
162+
ext.bwc_tests_enabled = true
163+
}
164+
165+
task verifyBwcTestsEnabled {
166+
doLast {
167+
if (project.bwc_tests_enabled == false) {
168+
throw new GradleException('Bwc tests are disabled. They must be re-enabled after completing backcompat behavior backporting.')
169+
}
170+
}
171+
}
172+
155173
task branchConsistency {
156174
description 'Ensures this branch is internally consistent. For example, that versions constants match released versions.'
157175
group 'Verification'
158-
dependsOn verifyVersions
176+
dependsOn verifyVersions, verifyBwcTestsEnabled
159177
}
160178

161179
subprojects {

qa/full-cluster-restart/build.gradle

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,18 @@ for (Version version : indexCompatVersions) {
7979
dependsOn = [upgradedClusterTest]
8080
}
8181

82-
bwcTest.dependsOn(versionBwcTest)
82+
if (project.bwc_tests_enabled == false) {
83+
bwcTest.dependsOn(versionBwcTest)
84+
}
8385
}
8486

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

8789
// basic integ tests includes testing bwc against the most recent version
8890
task integTest {
89-
dependsOn = ["v${indexCompatVersions[-1]}#bwcTest"]
91+
if (project.bwc_tests_enabled) {
92+
dependsOn = ["v${indexCompatVersions[-1]}#bwcTest"]
93+
}
9094
}
9195

9296
check.dependsOn(integTest)

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
@@ -95,17 +95,22 @@ for (Version version : wireCompatVersions) {
9595
}
9696

9797
Task versionBwcTest = tasks.create(name: "${baseName}#bwcTest") {
98+
enabled = project.bwc_tests_enabled
9899
dependsOn = [upgradedClusterTest]
99100
}
100101

101-
bwcTest.dependsOn(versionBwcTest)
102+
if (project.bwc_tests_enabled) {
103+
bwcTest.dependsOn(versionBwcTest)
104+
}
102105
}
103106

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

106109
// basic integ tests includes testing bwc against the most recent version
107110
task integTest {
108-
dependsOn = ["v${wireCompatVersions[-1]}#bwcTest"]
111+
if (project.bwc_tests_enabled) {
112+
dependsOn = ["v${wireCompatVersions[-1]}#bwcTest"]
113+
}
109114
}
110115

111116
check.dependsOn(integTest)

0 commit comments

Comments
 (0)