Skip to content

Commit 8e85d13

Browse files
authored
Skip BWC tests in checkPart1 and checkPart2 (#38730)
Don't run bwc tests for check part 1 and 2
1 parent 93b284a commit 8e85d13

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

build.gradle

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,10 @@ task verifyVersions {
159159
* the enabled state of every bwc task. It should be set back to true
160160
* after the backport of the backcompat code is complete.
161161
*/
162-
final boolean bwc_tests_enabled = false
162+
163+
boolean bwc_tests_enabled = false
163164
final String bwc_tests_disabled_issue = "https://github.com/elastic/elasticsearch/pull/38687" /* place a PR link here when committing bwc changes */
165+
164166
if (bwc_tests_enabled == false) {
165167
if (bwc_tests_disabled_issue.isEmpty()) {
166168
throw new GradleException("bwc_tests_disabled_issue must be set when bwc_tests_enabled == false")
@@ -170,6 +172,17 @@ if (bwc_tests_enabled == false) {
170172
println "See ${bwc_tests_disabled_issue}"
171173
println "==========================================================="
172174
}
175+
if (project.gradle.startParameter.taskNames.find { it.startsWith("checkPart") } != null) {
176+
// Disable BWC tests for checkPart* tasks as it's expected that this will run un it's own check
177+
bwc_tests_enabled = false
178+
}
179+
if (project.gradle.startParameter.taskNames.contains("bwcTestSnapshots") && bwc_tests_enabled == false) {
180+
throw new GradleException("BWC tests are disabled. " +
181+
"This can happen if a branch happened to be created when they were disabled and can be solved by mergin at" +
182+
"least to the commit on the parent branch that re-enabled them"
183+
)
184+
}
185+
173186
subprojects {
174187
ext.bwc_tests_enabled = bwc_tests_enabled
175188
}

0 commit comments

Comments
 (0)