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

Differences in coverage between XML/HTML and verify #692

Open
glureau opened this issue Oct 11, 2024 · 1 comment
Open

Differences in coverage between XML/HTML and verify #692

glureau opened this issue Oct 11, 2024 · 1 comment
Assignees
Labels
Bug Bug issue type S: waiting for clarification Status: additional information required to proceed

Comments

@glureau
Copy link

glureau commented Oct 11, 2024

Describe the bug
The coverage value is different between XML/HTML and what verify is checking.
I don't have a reproducer but on my project I'm getting :

<report name="Kover Gradle Plugin XML report for ...">
   [...]
    <counter type="INSTRUCTION" missed="4473" covered="8809"/>
    <counter type="BRANCH" missed="171" covered="195"/>
    <counter type="LINE" missed="661" covered="1426"/>
    <counter type="METHOD" missed="288" covered="363"/>
    <counter type="CLASS" missed="152" covered="246"/>
</report>

I compute the branch coverage with 195/(171+195) = 0,5327868852, that we can round to 53.3%

In my HTML report I get the same values (171+195 = 366)
Screenshot 2024-10-11 at 12 10 17

And when I ran koverVerify:

Rule 'global' violated: branches covered percentage is 53.005500, but expected minimum is 80

Not the best example, on some other modules, the difference is way greater than 1%.

Expected behavior
I want the same value in XML and in koverVerify

Reproducer
I can't share my code at the moment. You may be able to reproduce by simply checking values in LegacyVerification. Here another screenshot while debugging (another module).

image

Environment

  • Kover Gradle Plugin version: 0.8.3 (I presume since at least 0.8.0-BETA)
  • Gradle version: 8.8
  • Kotlin project type: Kotlin/Multiplatform
  • Coverage Toolset (if customized in build script): Kover
  • Other context important for this bug: Mac OS X 14.6.1 aarch64, JVM 17.0.12 (Azul Systems, Inc. 17.0.12+7-LTS)
@glureau glureau added Bug Bug issue type S: untriaged Status: issue reported but unprocessed labels Oct 11, 2024
@shanshin
Copy link
Collaborator

Hi,
could you clarify which filters are used during the report generation?

Are annotatedBy filters used?

@shanshin shanshin added S: waiting for clarification Status: additional information required to proceed and removed S: untriaged Status: issue reported but unprocessed labels Oct 14, 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: waiting for clarification Status: additional information required to proceed
Projects
None yet
Development

No branches or pull requests

2 participants