Skip to content

Code Coverage is calculated incorrectly #696

Open
@Catah97

Description

@Catah97

Describe the bug
Code Coverage is calculated incorrectly. This happens in reports and verification tasks.

Errors
As you can see in this picture:
Snímek obrazovky 2024-10-25 v 17 24 19

Kover thinks that lines 52,53 are not covered with tests, but they are.
Snímek obrazovky 2024-10-25 v 17 23 41

And if I move deleteAll up, then this happends.

Snímek obrazovky 2024-10-25 v 17 26 05

This starts happening after migrate to Kotlin 2.0.0 and Kover v0.8.3. I have tested it on v0.9.0-RC and it was same.
With Kkotlin = "1.9.23" and Kover = "0.7.6" everything were fine.

Expected behavior
All lines in CacheStoreFactoryTest should be covered.

Reproducer
Project is here:
https://github.com/Catah97/KoverCoverageBugs

Module multiplatform/cache.
Run koverHtmlReport gradle task.

Environment

  • Kover Gradle Plugin version: 0.8.3
  • Gradle version: 8.7
  • Kotlin project type: Kotlin/Multiplatform + Android
  • Other context important for this bug: Test on MacOs

Metadata

Metadata

Assignees

Labels

BugBug issue type

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions