2021-03-12 13:49:28 -05:00
|
|
|
import org.opensearch.gradle.Version
|
|
|
|
import org.opensearch.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)
|
|
|
|
}
|
|
|
|
|
2020-07-29 13:45:11 -04:00
|
|
|
tasks.findByName("test")?.enabled = false
|