-
Notifications
You must be signed in to change notification settings - Fork 3
/
jacoco.gradle
44 lines (38 loc) · 1.25 KB
/
jacoco.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
// Apply Jacoco only to the main modules
if (!project.hasProperty("disableJacoco")) {
if (!['baseline',
'schemaregistry-junit-test',
'schemaregistry-junit-test-utils',
'schemaregistry-junit-regression-test']
.contains(project.name)
&& !(project.name ==~ /.[0-9\\.]+/)) {
// Jacoco configuration
apply plugin: 'jacoco'
jacoco {
toolVersion = "0.8.5"
reportsDir = file("$buildDir/jacoco")
}
test {
finalizedBy jacocoTestReport // report is always generated after tests run
}
jacocoTestReport {
dependsOn test // tests are required to run before generating the report
reports {
xml.enabled true
csv.enabled false
html.destination file("${buildDir}/jacocoHtml")
}
}
jacocoTestCoverageVerification {
violationRules {
rule {
limit {
minimum = 0.6
}
}
}
}
// to run coverage verification during the build (and fail when appropriate)
check.dependsOn jacocoTestCoverageVerification
}
}