the jacoco task attaches itself to test by default...
# gradle
b
the jacoco task attaches itself to test by default but getting it to run for a custom tasks is neigh impossible
t
Copy code
tasks {
    "test"(Test::class) {
        useJUnitPlatform()
        testLogging {
            events("PASSED", "FAILED", "SKIPPED")
            exceptionFormat = TestExceptionFormat.FULL
        }
        finalizedBy(jacocoTestReport)
    }
}
b
yeah, that
doesn't work if your task is not named "test"
that just allows you to omit jacocoTestReport when running ./gradlew test
try to get this running for this example
Copy code
task<Test>("integrationTest") {
    description = "Runs integration tests"
    useJUnitPlatform {
        includeTags("integration")
    }
    testLogging {
        exceptionFormat = TestExceptionFormat.FULL
    }
}
running ./gradlew integrationTest jacocoTestReport will never generate code coverage
p
Have you tried 'jacocoTestReport.shouldRunAfter integrationTest' ?