Closed vivart closed 2 years ago
Hi! At the moment, the API of the plugin does not imply the exclusion of specific classes from the report. See #17
includes
and excludes
controls the instrumentation of the specified classes but not the report.
Duplicate #17
Hi! At the moment, the API of the plugin does not imply the exclusion of specific classes from the report. See #17
includes
andexcludes
controls the instrumentation of the specified classes but not the report.
Why exclude don't work?
I am have next exclude template
but in output I am have
@shanshin Can you see what I'm doing wrong?
This works for me
tasks.withType<Test> {
extensions.configure(kotlinx.kover.api.KoverTaskExtension::class) {
isEnabled = true
binaryReportFile.set(file("$buildDir/custom/result.bin"))
includes = listOf("com\\.example\\..*")
excludes = listOf(
"dagger\\.hilt\\..*",
"com\\.example\\.todo\\.databinding\\..*",
"com\\.example\\.todo\\.di\\..*",
"com\\.example\\.todo\\.ui\\.display\\..*",
"com\\.example\\.todo\\.ui\\.edit\\..*",
"com\\.example\\.settings\\..*",
)
}
}
Hi! At the moment, the API of the plugin does not imply the exclusion of specific classes from the report. See #17
includes
andexcludes
controls the instrumentation of the specified classes but not the report.Why exclude don't work?
I am have next exclude template
but in output I am have
Perhaps you have another test task in your project in which these classes are not excluded?
What is the content of the file build/tmp/koverHtmlReport/intellijreport.args
after the build ?
The first few lines will list reports for completed test tasks
And what do you use as an coverage engine, JaCoCo or IntelliJ?
Hey guys, I have a similar issue. When I exclude some packages from kover it is indeed not taken into account in the percentages Class%, Block% and Line%. But because it is still part of the report, the overall coverage drops. This leads to an even more negative result than when I wouldn't exclude it. I use Kotlin 1.6.0 with Gradle 7.3. My configuration:
kover {
isEnabled = true
coverageEngine.set(kotlinx.kover.api.CoverageEngine.INTELLIJ)
intellijEngineVersion.set(intellijVersion)
generateReportOnCheck.set(true)
}
tasks.test {
extensions.configure(kotlinx.kover.api.KoverTaskExtension::class) {
isEnabled = true
binaryReportFile.set(file("$buildDir/reports/kover/result.bin"))
includes = listOf("org\\.example\\.something\\.blabla\\..*")
excludes = listOf(
"org\\.example\\.something\\.blabla\\.controller\\..*"
)
}
}
@SimonedeGijt, please check in version 0.4.4
.
@Tihon-Ustinov, please, if the problem is reproduced in version 0.4.4
, create a new one issue with a detailed description.
Just for that random soul coming across the same issue above version 0.4.4: I'm currently on version 0.6.0 and this doesn't work for me when I set the exclusions on module level. If I enable koverMerged and run the merged task and set the exclusions on project level this works.
I am able to exclude hilt package but FragmentDirections files are still showing in the report.