-
Notifications
You must be signed in to change notification settings - Fork 0
/
integrationTest.gradle
52 lines (47 loc) · 1.41 KB
/
integrationTest.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
43
44
45
46
47
48
49
50
51
52
configurations {
integrationTestImplementation {
extendsFrom testImplementation
}
integrationTestRuntimeOnly {
extendsFrom testRuntimeOnly
}
integrationTestCompileOnly {
extendsFrom testCompileOnly
}
testCompileOnly {
extendsFrom compileOnly
}
}
sourceSets {
test {
java {
// exclude integration tests from the default test source set
exclude "**/*IT.java"
}
}
integrationTest {
// uses the main application code
compileClasspath += sourceSets.main.output
runtimeClasspath += sourceSets.main.output
java {
// the tests are at the same directory (or directories) as the unit tests
srcDirs = sourceSets.test.java.srcDirs
// exclude the unit tests from the integration tests source set
exclude "**/*Test.java"
}
resources {
// same resources directory (or directories) with the unit tests
srcDirs = sourceSets.test.resources.srcDirs
}
}
}
// define the task for integration tests
task integrationTest(type: Test) {
description = "Runs integration tests."
group = "verification"
testClassesDirs = sourceSets.integrationTest.output.classesDirs
classpath = sourceSets.integrationTest.runtimeClasspath
shouldRunAfter test
useJUnitPlatform()
}
check.dependsOn integrationTest