kover
Installation
SKILL.md
<essential_principles>
Kover is the official Kotlin code coverage tool. The Gradle plugin instruments JVM bytecode during test execution and generates coverage reports. Version 0.9.8.
Core Rules an Agent Must Know
- Apply with
id("org.jetbrains.kotlinx.kover") version "0.9.8"inplugins {}. In multi-module builds, apply in root (version inherited by submodules). - JVM-only coverage. JS and Native targets are not measured. KMP projects only get coverage for common + JVM source sets.
- Android: local unit tests only. On-device instrumented tests are NOT supported.
- Report tasks auto-trigger tests. Running
koverHtmlReportruns all relevant test tasks first. - Multi-module merging uses
kover(project(":other"))dependencies in a merging module (typically root). Use full task paths like:koverVerify. - Android build variants create matching report variants. Append variant name to tasks:
koverVerifyDebug. - Verification rules check coverage bounds. Default:
COVERED_PERCENTAGEofLINEgrouped byAPPLICATION. UseminBound(100)for 100% line coverage. verify {}replaces rules;verifyAppend {}adds. Same forfilters {}vsfiltersAppend {}.- Filters: excludes beat includes. Use
classes(...)for fully-qualified names with*/?wildcards.annotatedByandinheritedFromare Kover-only (not JaCoCo). - Instrumentation issues (
VerifyError,No instrumentation registered!) — exclude the class from instrumentation. Side effect: 0% coverage for that class. require()with string interpolation creates uncoverable bytecode branches. Use explicitif (...) throwinstead.- The
testsource set is excluded by default. Usesources { excludedSourceSets }for additional exclusions.