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

Inline operation execution not detected #573

Open
mgroth0 opened this issue Mar 21, 2024 · 2 comments
Open

Inline operation execution not detected #573

mgroth0 opened this issue Mar 21, 2024 · 2 comments
Assignees
Labels
Bug Bug issue type S: confirmed Status: bug is reproduced or present

Comments

@mgroth0
Copy link

mgroth0 commented Mar 21, 2024

Describe the bug

I have discovered a case where an inline operation is not correctly detected by Kover.

Errors

This leads to errors in koverVerify if we exepct to have covered this code block.

Expected behavior

Inline operations should be detected just as non-inline operations are.

Reproducer

I will link a full reproducer project in a few minutes.

Environment

  • Kover Gradle Plugin version: 0.8.0-Beta
  • Gradle version: 8.6
  • Kotlin project type: Kotlin/JVM
@mgroth0 mgroth0 added Bug Bug issue type S: untriaged Status: issue reported but unprocessed labels Mar 21, 2024
@mgroth0
Copy link
Author

mgroth0 commented Mar 21, 2024

Here is the reproducer: https://github.com/mgroth0/kover-573

To reproduce:

  1. ./gradlew test -i and observe that the output is
    hello test fun 1
    hello test fun 1 lambda
    hello test fun 2
    hello test fun 2 lambda
  1. ./gradlew koverVerify and observe it fails with Rule violated: lines covered percentage is 87.500000, but expected minimum is 100

  2. ./gradlew koverHtmlReport and observe in the HTML report that the line of code println("hello test fun 2 lambda") was not detected to have executed.

As the output from step 1 shows, however, the line definitely did execute.

@shanshin
Copy link
Collaborator

Error reproduced when inline function, with a call to other inline functions inside, is used directly in the test

@shanshin shanshin added S: confirmed Status: bug is reproduced or present and removed S: untriaged Status: issue reported but unprocessed labels Mar 21, 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: confirmed Status: bug is reproduced or present
Projects
None yet
Development

No branches or pull requests

2 participants