Skip to content

Commit 3de893f

Browse files
authored
[build] enforce jacoco coverage (#564)
Add missing jacoco test coverage verification
1 parent fcbb021 commit 3de893f

File tree

4 files changed

+61
-3
lines changed

4 files changed

+61
-3
lines changed

build.gradle.kts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ subprojects {
6565
}
6666

6767
tasks {
68+
check {
69+
dependsOn(jacocoTestCoverageVerification)
70+
}
6871
detekt {
6972
toolVersion = detektVersion
7073
config = files("${rootProject.projectDir}/detekt.yml")
@@ -75,9 +78,6 @@ subprojects {
7578
jacoco {
7679
toolVersion = jacocoVersion
7780
}
78-
build {
79-
dependsOn(jacocoTestReport)
80-
}
8181
jar {
8282
manifest {
8383
attributes["Built-By"] = "Expedia Group"
@@ -90,6 +90,7 @@ subprojects {
9090
}
9191
test {
9292
useJUnitPlatform()
93+
finalizedBy(jacocoTestReport)
9394
}
9495

9596
// published artifacts

graphql-kotlin-federation/build.gradle.kts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,22 @@ dependencies {
66
api(project(path = ":graphql-kotlin-schema-generator"))
77
testImplementation("org.junit.jupiter:junit-jupiter-params:$junitVersion")
88
}
9+
10+
tasks {
11+
jacocoTestCoverageVerification {
12+
violationRules {
13+
rule {
14+
limit {
15+
counter = "INSTRUCTION"
16+
value = "COVEREDRATIO"
17+
minimum = "0.96".toBigDecimal()
18+
}
19+
limit {
20+
counter = "BRANCH"
21+
value = "COVEREDRATIO"
22+
minimum = "0.94".toBigDecimal()
23+
}
24+
}
25+
}
26+
}
27+
}

graphql-kotlin-schema-generator/build.gradle.kts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,22 @@ dependencies {
1515
api("com.fasterxml.jackson.module:jackson-module-kotlin:$jacksonVersion")
1616
testImplementation("io.reactivex.rxjava2:rxjava:2.2.14")
1717
}
18+
19+
tasks {
20+
jacocoTestCoverageVerification {
21+
violationRules {
22+
rule {
23+
limit {
24+
counter = "INSTRUCTION"
25+
value = "COVEREDRATIO"
26+
minimum = "0.98".toBigDecimal()
27+
}
28+
limit {
29+
counter = "BRANCH"
30+
value = "COVEREDRATIO"
31+
minimum = "0.96".toBigDecimal()
32+
}
33+
}
34+
}
35+
}
36+
}

graphql-kotlin-spring-server/build.gradle.kts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,22 @@ dependencies {
2020
testImplementation("org.springframework.boot:spring-boot-starter-test:$springBootVersion")
2121
testImplementation("io.projectreactor:reactor-test:$reactorVersion")
2222
}
23+
24+
tasks {
25+
jacocoTestCoverageVerification {
26+
violationRules {
27+
rule {
28+
limit {
29+
counter = "INSTRUCTION"
30+
value = "COVEREDRATIO"
31+
minimum = "0.96".toBigDecimal()
32+
}
33+
limit {
34+
counter = "BRANCH"
35+
value = "COVEREDRATIO"
36+
minimum = "0.91".toBigDecimal()
37+
}
38+
}
39+
}
40+
}
41+
}

0 commit comments

Comments
 (0)