Skip to content

Commit 8c3bc74

Browse files
authored
Provide better error message when attempting to run incompatible tests (#119699) (#119999)
(cherry picked from commit ecc6c3f) # Conflicts: # build-tools-internal/src/main/groovy/elasticsearch.bwc-test.gradle
1 parent 0f88dde commit 8c3bc74

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
@@ -52,3 +52,14 @@ plugins.withType(InternalJavaRestTestPlugin) {
5252

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

0 commit comments

Comments
 (0)