a7ex / xcresultparser

Parse the binary xcresult bundle from Xcode builds and testruns
MIT License
83 stars 24 forks source link

First pass of adding support for cobertura XML output format #7

Closed fadookie closed 1 year ago

fadookie commented 1 year ago

Problem statement

I have a need to convert from .xcresult to cobertura XML (this format is the only one supported by GitLab coverage visualizer) and I couldn't find any other converters that worked directly with .xcresult bundle, all the other ones like Slather require an xcode project but I am working from a swift package.

This PR adds a new cobertura output format available in coverage mode. The cobertura output formatting code comes from XcodeCoverageConverter which is also MIT-licensed, and I have added the required license notices for that. The XCC tool does not parse line coverage information but only uses coarse function-level coverage, which is why I abandoned it and switched to forking xcresultparser instead.

Some of the values in the cobertura report are fake, such as cyclomatic complexity, branch-level coverage, and a few instances of aggregate line coverage stats. I think as a first pass I would prefer for these to be out of scope because they would require a lot more effort to calculate. What I have now is good enough for my purposes of importing into GitLab coverage visualizer, and has accurate line-level coverage metrics.

Summary of changes

a7ex commented 1 year ago

Thanks for sharing your enhancements to xcresultparser!

fadookie commented 1 year ago

Thank you for reviewing and making this project available as open source. I will try to address your feedback soon and request a re-review then.

fadookie commented 1 year ago

@a7ex I've addressed your comments, PR is ready for re-review at your convenience.