kotlinx-kover icon indicating copy to clipboard operation
kotlinx-kover copied to clipboard

Code Coverage is calculated incorrectly

Open Catah97 opened this issue 1 year ago • 0 comments

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

Catah97 avatar Oct 25 '24 15:10 Catah97