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

Coverage results should be taken from package coverage, not overall coverage #56

Open
jefim opened this issue May 8, 2023 · 0 comments
Assignees

Comments

@jefim
Copy link
Contributor

jefim commented May 8, 2023

Currently we take unit take coverate figure from top-level coverage element in cobertura XML. However to get better results we need to target the actual coverage for the package. See example below:

<coverage line-rate="0.5" branch-rate="0.5" version="1.9" timestamp="1683293601" lines-covered="152" lines-valid="348" branches-covered="16" branches-valid="52">
  <sources>
    <source>...</source>
  </sources>
  <packages>
    <package name="Frends......" line-rate="0.9" branch-rate="0.75" complexity="10">
    </package>
    <package name="Frends......" line-rate="0.1" branch-rate="0.1" complexity="10">
    </package>
  </packages>
</coverage>

In the example above you can see that overall coverage can sometimes be diluted by neighbouring packages, which makes results inaccurate. So onstead of using /covarage attribute line-rate we should use /coverage/packages/package[@name='PackageName'].

@jefim jefim self-assigned this May 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant