Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Hiding and excluding some parameters on the Coverage Code tab (Azure DevOps) #1558

Open
olegsidokhmetov opened this issue Nov 20, 2023 · 3 comments
Labels
question This issue is a question stale waiting for customer Waiting for customer action

Comments

@olegsidokhmetov
Copy link

Hello!

I have a question.
Is it possible to hide "Risk Hotspots" in the "Coverage Code" tab (Azure DevOps pipelines)
aVsz3Sxkn3

and also exclude "Converge.Libraries.NuGetUtilities" and "nameWebApi" from the test results in the "Coverage Code" tab?
BpeBrhn8sy
chrome_WhXDM8VEQa

May it possible from step unit test in Arguments after parameters `--logger:"console;verbosity=normal" --configuration $(buildConfiguration) --collect:"XPlat Code Coverage /p:Exclude="[nameWebApi.], [NuGet.]"
chrome_R6NENmEMZZ

@github-actions github-actions bot added the untriaged To be investigated label Nov 20, 2023
@daveMueller
Copy link
Collaborator

Coverlet is only calculating the coverage report. For visualization it seems you are using reportgenerator. The whole html representation including the Risk Hotspots tab is created by reportgenerator and I don't know if this html report can be customized. Most likely not.
But at least you should be able to exclude "Converge.Libraries.NuGetUtilities" and "nameWebApi" from the coverage report. I see you are using the collector version of coverlet because of --collect:"XPlat Code Coverage" and you try to filter with the msbuild-coverlet parameters (/p:Exclude=...). This will not work.
If you are using the collector you need to define a runnsettings file with the filter which is described here: vstest-docs.
If you are using the msbuild version of coverlet you can use the filter as described here: msbuild-docs

@daveMueller daveMueller added the waiting for customer Waiting for customer action label Dec 1, 2023
@Bertk
Copy link
Collaborator

Bertk commented Dec 4, 2023

Report Generator supports filters which can be used to remove unwanted content from HTML output. There is also a configuration tool available which covers all options.

The coverage results for the test projects are accumulated and the filters are applied before the Cobertura.xml file is created.
Maybe you can use a summary report which does not have "Risk Hotspots".

   Report types:       The output formats and scope (separated by semicolon).
                       Values: Badges, Clover, Cobertura, CsvSummary, 
                       MarkdownSummary, MarkdownSummaryGithub, MarkdownDeltaSummary
                       OpenCover
                       Html, Html_Light, Html_Dark, Html_BlueRed
                       HtmlChart, HtmlInline, HtmlSummary, Html_BlueRed_Summary
                       HtmlInline_AzurePipelines, HtmlInline_AzurePipelines_Light, HtmlInline_AzurePipelines_Dark
                       JsonSummary, Latex, LatexSummary, lcov, MHtml, SvgChart, SonarQube, TeamCitySummary
                       TextSummary, TextDeltaSummary
                       Xml, XmlSummary

Maybe you can increase the threshold for the metric (see https://github.com/danielpalme/ReportGenerator/wiki/Settings)
image

We use it for the coverage report for coverlet CI builds.

https://github.com/coverlet-coverage/coverlet/blob/21d3964f0399a8b353894806f774fdcf973b4324/eng/build.yml#L39C1-L43C158

https://github.com/coverlet-coverage/coverlet/blob/21d3964f0399a8b353894806f774fdcf973b4324/eng/publish-coverage-results.yml#L12C1-L33C52

@Bertk Bertk added question This issue is a question and removed untriaged To be investigated labels Dec 4, 2023
Copy link

This issue is stale because it has been open for 3 months with no activity.

@github-actions github-actions bot added the stale label Mar 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question This issue is a question stale waiting for customer Waiting for customer action
Projects
None yet
Development

No branches or pull requests

3 participants