codeclimate / test-reporter

Code Climate Test Reporter
MIT License
154 stars 76 forks source link

QUA-948: Support .NET DotCover coverage reporting #508

Closed camillof closed 1 year ago

camillof commented 1 year ago

This PR adds support for uploading coverage reports generated by DotCover. The report is expected to be located at the project root folder, and it must be named dotcover.xml

Please note that the ReportType should be DetailedXML as it's the only format that prints coverage line by line.

    --ReportType=ARG              : (Optional) [HTML|JSON|XML|DetailedXML|NDependXML|SummaryXML].
                                    Specify to get a report of a certain type instead of a snapshot.
                                    For multiple reports, specify a list of report types separated by comma (,)

An example repo was uploaded here https://github.com/codeclimate/dot-net-coverage-test, and you can generate a test coverage report by running

dotnet build
dotnet dotcover test --dcReportType=DetailedXML --dcOutput="dotcover.xml" --no-build
codeclimate[bot] commented 1 year ago

Code Climate has analyzed commit 93a904d3 and detected 0 issues on this pull request.

View more on Code Climate.

camillof commented 1 year ago

This LGTM. Thanks for adding the integration tests. The only comment I might have about this would be: could this package and the clover package share any code? They seem relatively similar, though I wouldn't call it a blocker since we don't find ourselves adding formatters on a regular basis.

Thanks for the review @larkinscott! Adding codeclimate to the repo allowed me to discover minor improvements. Regarding the similar looks among the formatters, I agree with that. Most of them share some code (for example, the Search() method is identical).

I'll try to refactor that, if possible, but I want to do it on a new PR, for clarity and to unblock this release for the customer asking for .NET support