0
Jacoco kann keinen Code-Coverage-Bericht generieren, wenn die Tests fehlschlagen.Verwenden von Jacoco mit Gradle
Unter dem entsprechenden Abschnitt meiner gradle Datei ist:
task unitTest(type: Test) {
forkEvery = 1
jvmArgs = ['-Djava.net.preferIPv4Stack=true']
testClassesDir = sourceSets.unitTest.output.classesDir
classpath = sourceSets.unitTest.runtimeClasspath
exclude '**/**TestBase.*'
outputs.upToDateWhen { false }
ignoreFailures = true
finalizedBy jacocoTestReport
}
task functionalTest(type: Test) {
forkEvery = 1
jvmArgs = ['-Djava.net.preferIPv4Stack=true']
testClassesDir = sourceSets.functionalTest.output.classesDir
classpath = sourceSets.functionalTest.runtimeClasspath
exclude '**/**TestBase.*'
outputs.upToDateWhen { false }
}
jacocoTestReport {
group = "Reporting"
description = "Generate Jacoco coverage reports after running tests."
additionalSourceDirs = files(sourceSets.main.allJava.srcDirs)
reports {
xml.enabled false
csv.enabled false
html.destination "${buildDir}/reports/jacoco/html"
}
executionData = files('build/jacoco/test.exec')
}
Auch wenn ich die „ignoreFailures = true“ angegeben haben, gibt es keine Code-Coverage-Bericht nach dem Testlauf.
There were failing tests. See the report at: file:///unitTest/index.html
:MYModule:jacocoTestReport SKIPPED
BUILD SUCCESSFUL
Total time: 41 mins 34.018 secs