fastlane-community / xcov

Nice code coverage reporting without hassle
MIT License
556 stars 107 forks source link

Final coverage takes into account only 1 run destination #176

Closed gobetti closed 3 years ago

gobetti commented 4 years ago

(this might be an issue on xcresult instead/as well, sorry I don't know enough about it yet)

I'm on Xcode 11.4.1 and running my tests via fastlane on 2 destinations, so that my code is covered on both iOS 12 & iOS 13.

If I use Apple's xcrun xccov over the generated xcresult file, I can see the covered lines number increasing from 1 to 2 destinations, meaning Apple's tool is merging the 2 results.

However when using xcov, the numbers don't increase as I increase the run destinations, and per xcov logs it seems to take only 1 of the reports into account:

Copying .xccovarchive to ./fastlane/xcov_report/action_0.xccovarchive
Copying .xccovarchive to ./fastlane/xcov_report/action_1.xccovarchive
Copying .xccovreport to ./fastlane/xcov_report/action_0.xccovreport
Copying .xccovreport to ./fastlane/xcov_report/action_1.xccovreport
...
▸ Opening .xccoverage file at path: .../fastlane/xcov_report/action_0.xccovreport

edit: this line is where only the 1st report is taken

gobetti commented 4 years ago

Here's something that would work as a middle step between obtaining the xccovreports and generating the report:

xcrun xccov merge --outReport out.xccovreport action_0.xccovreport action_0.xccovarchive action_1.xccovreport action_1.xccovarchive

now, if I specify the new file out.xccovreport in xccov_file_direct_path, the reported coverage takes into account the 2 destinations

CorbinMontague commented 4 years ago

This PR and this PR both fix this issue for me.

gobetti commented 3 years ago

https://github.com/fastlane-community/xcov/pull/173 closed this issue 👍 thanks everybody!