2020-03-03 17:40:55 -05:00
|
|
|
import org.elasticsearch.gradle.Version
|
2020-05-11 03:39:13 -04:00
|
|
|
import org.elasticsearch.gradle.info.BuildParams
|
2020-03-03 17:40:55 -05:00
|
|
|
|
|
|
|
ext.bwcTaskName = { Version version ->
|
|
|
|
return "v${version}#bwcTest"
|
|
|
|
}
|
|
|
|
|
|
|
|
def bwcTestSnapshots = tasks.register("bwcTestSnapshots") {
|
|
|
|
if (project.bwc_tests_enabled) {
|
2020-05-11 03:39:13 -04:00
|
|
|
dependsOn tasks.matching { task -> BuildParams.bwcVersions.unreleased.any { version -> bwcTaskName(version) == task.name } }
|
2020-03-03 17:40:55 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.register("bwcTest") {
|
|
|
|
description = 'Runs backwards compatibility tests.'
|
|
|
|
group = 'verification'
|
|
|
|
|
|
|
|
if (project.bwc_tests_enabled) {
|
|
|
|
dependsOn tasks.matching { it.name ==~ /v[0-9\.]+#bwcTest/ }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.withType(Test).configureEach {
|
|
|
|
onlyIf { project.bwc_tests_enabled }
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.named("check").configure {
|
|
|
|
dependsOn(bwcTestSnapshots)
|
|
|
|
}
|
|
|
|
|
|
|
|
test.enabled = false
|