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

Cobertura report shows wrong numbers #520

Open
tosbaha opened this issue Aug 10, 2022 · 1 comment
Open

Cobertura report shows wrong numbers #520

tosbaha opened this issue Aug 10, 2022 · 1 comment

Comments

@tosbaha
Copy link

tosbaha commented Aug 10, 2022

I have exported the code coverage report with

coverage = JSON.parse `xcrun xccov view --report --json #{test_path}`

It gave a report with something like the below

  "coverage": {
    "coveredLines": 95,
    "lineCoverage": 1,
    "targets": [
      {

It shows that 95 lines are covered which is the actual value since I see the same number on Xcode.
Screen Shot 2022-08-10 at 11 39 44

Then I run the slather

slather coverage -x --scheme FizzBuzzKit Appcircle.xcodeproj

XML report says this

<?xml version="1.0"?>
<!DOCTYPE coverage SYSTEM "http://cobertura.sourceforge.net/xml/coverage-04.dtd">
<coverage line-rate="1.0000000000000000" branch-rate="1.0000000000000000" lines-covered="88" lines-valid="88" branches-covered="98" branches-valid="98" complexity="0.0" timestamp="1660117022" version="Slather 2.7.2">

Instead of 95, it is reporting as 88 lines.

I attached the Xcode test result as well.
FizzBuzzKit.xcresult.zip

@jarrodlombardo-EventBase
Copy link
Contributor

I was looking at adding a new feature and encountered this when locally running the tests for this project. I'll see if I can fix it and update the tests accordingly.

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

2 participants