You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for creating ReportGenerator! I think it provides a great overview of code coverage and I really like all the integration options.
I got however a bit confused about all the options to use it and the best way to use ReportGenerator with Azure DevOps as of now, 2024. I've seen many issues discussing this topic including #398, but many of them are outdated as of 2024. Maybe it could be helpful for new users to have one central up-to-date page with guidance (which the other places including the Azure DevOps Marketplace page could link to). I'd be happy to contribute in that direction if that makes sense, but I guess at this point the best thing I can do is asking the questions I thought about when getting started with Code Coverage in Azure DevOps.
My Goals (decreasing prio)
having some working code coverage report at all
having the "Code Coverage" tab with ReportGenerator's report, not the default one
having a downloadable full-featured Code Coverage Report artifact
short task runtime
a quite general Azure Pipelines task definition that is easy to adapt to/copy around between multiple repos
possibility to configure ReportGenerator, e.g. pass a license key
having the "X.Y% covered" info on the "Summary" tab
Options I came across
PublishCodeCoverageResults@1
PublishCodeCoverageResults@2
reportgenerator@5
A combination of the above
What I think I understood
Many shortcomings of PublishCodeCoverageResults are about V1. V2 made things better but there are even cases when one would rather use v1 than v2 (I'm not sure which exactly though).
PublishCodeCoverageResults uses ReportGenerator under the hood. I think I didn't read it anywhere in docs/readme/website, but from reading the sources I understood that I could use a .netconfig file to configure ReportGenerator while using PublishCodeCoverageResults@2 (maybe this should be documented somewhere, because I think it's a great feature). Mentioning how to use a ReportGenerator license with PublishCodeCoverageResults@2 on https://reportgenerator.io/pro would probably be easy and could even make some people buy a license (I tried this and it works).
Questions
Whats the minimal, optimal but full example to use ReportGenerator with Azure DevOps today? I've seen https://reportgenerator.io/usage but in my testing using only the reportgenerator task didn't produce e.g. the Code Coverage tab.
disable.coverage.autogenerate: 'true' doesn't seem to work for me with PublishCodeCoverageResults@2. Is there a workaround for V2 too? Is it better to use V1 with reportgenerator@5?
I have a DotNetCoreCLI@2 test task like the following. The PublishCodeCoverageResults@2 seems to first publish ReportGenerator's report, which is later overwritten. How to fix this while still publishing the trx test results?
My current production pipeline config is similar to the following. It does fulfil most of my requirements except that the contents of "Code Coverage" are replaced by an autogenerated report when the pipleine finishes. How to get that right?
Thanks for creating ReportGenerator! I think it provides a great overview of code coverage and I really like all the integration options.
I got however a bit confused about all the options to use it and the best way to use ReportGenerator with Azure DevOps as of now, 2024. I've seen many issues discussing this topic including #398, but many of them are outdated as of 2024. Maybe it could be helpful for new users to have one central up-to-date page with guidance (which the other places including the Azure DevOps Marketplace page could link to). I'd be happy to contribute in that direction if that makes sense, but I guess at this point the best thing I can do is asking the questions I thought about when getting started with Code Coverage in Azure DevOps.
My Goals (decreasing prio)
Options I came across
What I think I understood
.netconfig fileto configure ReportGenerator while using PublishCodeCoverageResults@2 (maybe this should be documented somewhere, because I think it's a great feature). Mentioning how to use a ReportGenerator license with PublishCodeCoverageResults@2 on https://reportgenerator.io/pro would probably be easy and could even make some people buy a license (I tried this and it works).Questions
Whats the minimal, optimal but full example to use ReportGenerator with Azure DevOps today? I've seen https://reportgenerator.io/usage but in my testing using only the
reportgeneratortask didn't produce e.g. the Code Coverage tab.Report type HtmlSummary sounds like it could help with PublishCodeCoverageResults is slow with many files in the generated report microsoft/azure-pipelines-tasks#4945, if it's acceptable to e.g. have just the summary in the "Code Coverage" tab but the full report in the zip artifact. Is there an easy way to set this up?
disable.coverage.autogenerate: 'true'doesn't seem to work for me withPublishCodeCoverageResults@2. Is there a workaround for V2 too? Is it better to use V1 withreportgenerator@5?I have a DotNetCoreCLI@2 test task like the following. The PublishCodeCoverageResults@2 seems to first publish ReportGenerator's report, which is later overwritten. How to fix this while still publishing the trx test results?
I hope I didn't miss any obvious places to research this myself. Thanks again for creating ReportGenerator!