Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Merged
merged 6 commits into from
Mar 3, 2023

Conversation

camillof
Copy link
Contributor

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

@camillof camillof changed the title QUA:948/ - Support .NET DotCover coverage reporting QUA:948 - Support .NET DotCover coverage reporting Feb 27, 2023
@camillof camillof changed the title QUA:948 - Support .NET DotCover coverage reporting QUA-948: Support .NET DotCover coverage reporting Feb 27, 2023
@camillof camillof requested review from a team, bobpattersonjr and larkinscott and removed request for a team February 27, 2023 18:16
@@ -52,6 +53,7 @@ var formatterMap = map[string]formatters.Formatter{
"lcov-json": &lcovjson.Formatter{},
"simplecov": &simplecov.Formatter{},
"xccov": &xccov.Formatter{},
"dotcover": &dotcover.Formatter{},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This got formatted a little weird. Do we run gofmt against this repo?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, codeclimate is now set up on this repo 😉

Copy link
Member

@larkinscott larkinscott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@codeclimate
Copy link

codeclimate bot commented Mar 3, 2023

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

View more on Code Climate.

@camillof
Copy link
Contributor Author

camillof commented Mar 3, 2023

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

@camillof camillof merged commit c9aedca into master Mar 3, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants