Skip to content

Commit d316013

Browse files
authored
Provide better error message when attempting to run incompatible tests (#119699) (#119768)
1 parent e7ba9f4 commit d316013

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

build-tools-internal/src/main/groovy/elasticsearch.bwc-test.gradle

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,14 @@ plugins.withType(InternalJavaRestTestPlugin) {
5353

5454
tasks.matching { it.name.equals("check") }.configureEach { dependsOn(bwcTestSnapshots) }
5555
tasks.matching { it.name.equals("test") }.configureEach { enabled = false }
56+
57+
tasks.addRule("incompatible bwc version") { taskName ->
58+
def incompatible = buildParams.bwcVersions.allIndexCompatible - buildParams.bwcVersions.indexCompatible
59+
if (incompatible.any { taskName.startsWith("v${it.toString()}") }) {
60+
tasks.register(taskName) {
61+
doLast {
62+
throw new GradleException("Cannot execute task '$taskName'. Version is unsupported on this platform. Perhaps you need an x86 host?")
63+
}
64+
}
65+
}
66+
}

0 commit comments

Comments
 (0)