Closed Arc-E-Tect closed 3 years ago
Never mind, the solution is by defining the jacocoTestReport and jacocoTestCoverageVerification as follows:
jacocoTestReport {
sourceSets sourceSets.main // important!
executionData fileTree(project.buildDir.absolutePath).include("jacoco/*.exec")
reports {
xml.enabled false
csv.enabled true
html.destination file("${buildDir}/reports/jacoco/Html")
csv.destination file("${buildDir}/reports/jacoco/jacoco.csv")
}
}
jacocoTestCoverageVerification {
executionData fileTree(project.buildDir.absolutePath).include("jacoco/*.exec")
violationRules {
rule {
limit {
minimum = minCodeCoverage
}
}
}
}
This does require the check to be depending on all relevant test sets otherwise the appropriate .exec files will not be available.
Got to testsets created
When running the generated tasks (
gradlew bddTest intTest
) the filesintTest.exec
andbddTest.exec
are created. But the JaCoCo report is not showing the coverage from the tests in these two sets and the build fails because thejacocoTestCoverageVerification
is not meeting my threshold.What is happening here as I understand from the documentation, the necessary changes related to JaCoCo are also part of the plugin.
Thanks