Skip to content

koverLog / koverHtmlReport and koverVerify report different line coverage #781

@realdadfish

Description

@realdadfish

Describe the bug
Kover seems to have problems always agreeing on the actual covered lines in a module between koverLog / koverHtmlReport and koverVerify, where the former is correct and the latter is (sometimes) wrong.

For example, for my offline-ui module all is fine:

> Task :offline-ui:koverPrintCoverage
application line coverage: 93.578%
> Task :offline-ui:koverVerify FAILED

FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':offline-ui:koverVerify'.
> Rule violated: lines covered percentage is 93.578000, but expected maximum is 55

i.e. both report 93,578% coverage.

However, in the login-ui module it fails:

> Task :login-ui:koverPrintCoverage
application line coverage: 88.1818%
> Task :login-ui:koverVerify FAILED

FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':login-ui:koverVerify'.
> Rule violated: lines covered percentage is 66.853900, but expected minimum is 86

Cleaning the module was not enough to resolve the issue. Only by disabling Gradle's build cache via -Dorg.gradle.caching=false the wrongly reported value from the verification task vanished. This is only a problem of the koverVerify task, as koverHtmlReport also reported the correct value.

Environment

  • Kover Gradle Plugin version: 0.9.4
  • Gradle version: 9.1.0
  • Kotlin project type: Kotlin/Multiplatform + Android
  • Coverage Toolset (if customized in build script): Kover

Metadata

Metadata

Assignees

Labels

BugBug issue typeS: waiting for clarificationStatus: additional information required to proceed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions