-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
bwc-test.gradle
42 lines (34 loc) · 1.06 KB
/
bwc-test.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/
import org.opensearch.gradle.Version
import org.opensearch.gradle.info.BuildParams
ext.bwcTaskName = { Version version ->
return "v${version}#bwcTest"
}
def bwcTestSnapshots = tasks.register("bwcTestSnapshots") {
if (project.bwc_tests_enabled) {
dependsOn tasks.matching { task -> BuildParams.bwcVersions.unreleased.any { version -> bwcTaskName(version) == task.name } }
}
}
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)
}
tasks.findByName("test")?.enabled = false