Skip to content

Commit ccbf40b

Browse files
authored
Configure Gradle JVM Test Suite Plugin (#133)
1 parent f3659b2 commit ccbf40b

File tree

2 files changed

+30
-18
lines changed

2 files changed

+30
-18
lines changed

build.gradle

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,6 @@ dependencies {
7474

7575
// expiring map
7676
implementation 'net.jodah:expiringmap:0.5.10'
77-
78-
// test
79-
testImplementation 'org.springframework.boot:spring-boot-starter-test'
80-
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
81-
82-
// mongo
83-
testImplementation "org.testcontainers:junit-jupiter:$testContainersVersion"
84-
testImplementation "org.testcontainers:mongodb:$testContainersVersion"
8577
}
8678

8779
dependencyManagement {
@@ -101,12 +93,25 @@ tasks.named("bootJar") {
10193
}
10294
}
10395

104-
test {
105-
useJUnitPlatform()
96+
testing {
97+
suites {
98+
test {
99+
useJUnitJupiter()
100+
dependencies {
101+
implementation 'org.springframework.boot:spring-boot-starter-test'
102+
implementation "org.testcontainers:junit-jupiter:$testContainersVersion"
103+
implementation "org.testcontainers:mongodb:$testContainersVersion"
104+
}
105+
}
106+
}
107+
}
108+
109+
tasks.withType(Test).configureEach {
110+
finalizedBy jacocoTestReport
106111
systemProperty "mongo.image", "mongo:4.4.28-focal"
107112
}
108113

109-
tasks.register('itest') {
114+
tasks.register('itest', Test) {
110115
group 'Verification'
111116
description 'Runs the integration tests.'
112117
}
@@ -117,7 +122,6 @@ jacocoTestReport {
117122
xml.required = true
118123
}
119124
}
120-
tasks.test.finalizedBy tasks.jacocoTestReport
121125
tasks.sonarqube.dependsOn tasks.jacocoTestReport
122126

123127
publishing {

iexec-result-proxy-library/build.gradle

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ plugins {
88
dependencies {
99
implementation "com.iexec.commons:iexec-commons-poco:$iexecCommonsPocoVersion"
1010
implementation "com.iexec.common:iexec-common:$iexecCommonVersion"
11-
testImplementation 'org.junit.jupiter:junit-jupiter:5.8.2'
12-
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
1311
}
1412

1513
java {
@@ -19,8 +17,19 @@ java {
1917
withSourcesJar()
2018
}
2119

22-
test {
23-
useJUnitPlatform()
20+
testing {
21+
suites {
22+
test {
23+
useJUnitJupiter()
24+
dependencies {
25+
implementation 'org.junit.jupiter:junit-jupiter:5.8.2'
26+
}
27+
}
28+
}
29+
}
30+
31+
tasks.withType(Test).configureEach {
32+
finalizedBy jacocoTestReport
2433
}
2534

2635
// sonarqube code coverage requires jacoco XML report
@@ -29,7 +38,6 @@ jacocoTestReport {
2938
xml.required = true
3039
}
3140
}
32-
tasks.test.finalizedBy tasks.jacocoTestReport
3341

3442
publishing {
3543
publications {
@@ -43,7 +51,7 @@ publishing {
4351
username nexusUser
4452
password nexusPassword
4553
}
46-
url = project.hasProperty("nexusUrl")? project.nexusUrl: ''
54+
url = project.hasProperty("nexusUrl") ? project.nexusUrl : ''
4755
}
4856
}
4957
}

0 commit comments

Comments
 (0)