Cobertura report shows wrong numbers
tosbaha opened this issue · comments
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.
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
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.