Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suspend functions break branches coverage #691

Closed
zhkvdm opened this issue Oct 10, 2024 · 4 comments
Closed

Suspend functions break branches coverage #691

zhkvdm opened this issue Oct 10, 2024 · 4 comments
Assignees
Labels
Bug Bug issue type S: untriaged Status: issue reported but unprocessed

Comments

@zhkvdm
Copy link

zhkvdm commented Oct 10, 2024

Describe the bug
Branches coverage is wrong then call suspend functions.
Suspend function break coverage to half. But I check all posible branches.
Branches coverage is ok if I call the same non suspend function. Just delete suspend codeword.

Expected behavior
Branches coverage is not depends on function type (suspend/non suspend)

Reports
Coverage check with suspend function call:
suspend

Coverage check with non suspend function call:
non suspend

Environment

  • Kover Gradle Plugin version: 0.9.0-RC
  • Gradle version: 17.0.1
  • Kotlin project type: Kotlin/Multiplatform + Android
  • Coverage Toolset (if customized in build script): Kover
@zhkvdm zhkvdm added Bug Bug issue type S: untriaged Status: issue reported but unprocessed labels Oct 10, 2024
@zhkvdm
Copy link
Author

zhkvdm commented Oct 17, 2024

@shanshin Hello! Any comments to this issue? Do you reproduce the bug?

@shanshin
Copy link
Collaborator

@zhkvdm, unfortunately, it was not possible to reproduce it locally.

var testVar: Int = 0

suspend fun testFun() {
    testVar = getTestData()
}

private suspend fun getTestData() = 1

Generated report
Screenshot 2024-10-17 at 16 43 44

@zhkvdm
Copy link
Author

zhkvdm commented Oct 17, 2024

Okay, in new empty project it works well. Looks like it is project specific issue..

@zhkvdm
Copy link
Author

zhkvdm commented Oct 17, 2024

Find the way how to reproduce this. Just add jacoco. Without jacoco everything is okay.

@zhkvdm zhkvdm closed this as completed Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug issue type S: untriaged Status: issue reported but unprocessed
Projects
None yet
Development

No branches or pull requests

2 participants