Skip to content

Commit e02ab91

Browse files
committed
Skip BWC tests in checkPart1 and checkPart2 (#38730)
Don't run bwc tests for check part 1 and 2
1 parent dd8dab6 commit e02ab91

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

build.gradle

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ task verifyVersions {
163163
* the enabled state of every bwc task. It should be set back to true
164164
* after the backport of the backcompat code is complete.
165165
*/
166-
final boolean bwc_tests_enabled = true
167-
final String bwc_tests_disabled_issue = "" /* place a PR link here when commiting bwc changes */
166+
boolean bwc_tests_enabled = true
167+
final String bwc_tests_disabled_issue = "" /* place a PR link here when committing bwc changes */
168168
if (bwc_tests_enabled == false) {
169169
if (bwc_tests_disabled_issue.isEmpty()) {
170170
throw new GradleException("bwc_tests_disabled_issue must be set when bwc_tests_enabled == false")
@@ -174,6 +174,17 @@ if (bwc_tests_enabled == false) {
174174
println "See ${bwc_tests_disabled_issue}"
175175
println "==========================================================="
176176
}
177+
if (project.gradle.startParameter.taskNames.find { it.startsWith("checkPart") } != null) {
178+
// Disable BWC tests for checkPart* tasks as it's expected that this will run un it's own check
179+
bwc_tests_enabled = false
180+
}
181+
if (project.gradle.startParameter.taskNames.contains("bwcTestSnapshots") && bwc_tests_enabled == false) {
182+
throw new GradleException("BWC tests are disabled. " +
183+
"This can happen if a branch happened to be created when they were disabled and can be solved by mergin at" +
184+
"least to the commit on the parent branch that re-enabled them"
185+
)
186+
}
187+
177188
subprojects {
178189
ext.bwc_tests_enabled = bwc_tests_enabled
179190
/*

0 commit comments

Comments
 (0)