Skip to content

Commit

Permalink
Provide better error message when attempting to run incompatible tests (
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-vieira authored Jan 8, 2025
1 parent 7881ea2 commit 85f6a82
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions build-tools-internal/src/main/groovy/elasticsearch.bwc-test.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,14 @@ plugins.withType(InternalJavaRestTestPlugin) {

tasks.matching { it.name.equals("check") }.configureEach { dependsOn(bwcTestSnapshots) }
tasks.matching { it.name.equals("test") }.configureEach { enabled = false }

tasks.addRule("incompatible bwc version") { taskName ->
def incompatible = buildParams.bwcVersions.allIndexCompatible - buildParams.bwcVersions.indexCompatible
if (incompatible.any { taskName.startsWith("v${it.toString()}") }) {
tasks.register(taskName) {
doLast {
throw new GradleException("Cannot execute task '$taskName'. Version is unsupported on this platform. Perhaps you need an x86 host?")
}
}
}
}

0 comments on commit 85f6a82

Please sign in to comment.