-
Notifications
You must be signed in to change notification settings - Fork 466
/
Copy pathspecial-tests.gradle
41 lines (39 loc) · 992 Bytes
/
special-tests.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
apply plugin: 'com.adarshr.test-logger'
// See com.diffplug.spotless.tag package for available JUnit 5 @Tag annotations
def special = [
'black',
'buf',
'clang',
'gofmt',
'npm',
'shfmt'
]
boolean isCiServer = System.getenv().containsKey("CI")
tasks.withType(Test).configureEach {
if (isCiServer) {
retry {
maxRetries = 2
maxFailures = 10
}
}
// selfie https://selfie.dev/jvm/get-started#gradle
environment project.properties.subMap([
"selfie"
]) // optional, see "Overwrite everything" below
inputs.files(fileTree("src/test") {
// optional, improves up-to-date checking
include "**/*.ss"
})
// https://docs.gradle.org/8.8/userguide/performance.html#execute_tests_in_parallel
maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
}
tasks.named('test').configure {
useJUnitPlatform {
excludeTags special as String[]
}
}
special.forEach { tag ->
tasks.register("test${tag.capitalize()}", Test) {
useJUnitPlatform { includeTags tag }
}
}