Closed olegsidokhmetov closed 2 weeks ago
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
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)
We use it for the coverage report for coverlet CI builds.
This issue is stale because it has been open for 3 months with no activity.
Risk hotspots can be disabled. The assemblies can be excluded from the report.
Apply the following two settings (last two lines are relevant):
- task: reportgenerator@5
displayName: ReportGenerator
inputs:
assemblyfilters: '-Converge.Libraries.NuGetUtilities;-*WebApi'
customSettings: 'settings:disableRiskHotspots=true'
Hello!
I have a question. Is it possible to hide "Risk Hotspots" in the "Coverage Code" tab (Azure DevOps pipelines)
and also exclude "Converge.Libraries.NuGetUtilities" and "nameWebApi" from the test results in the "Coverage Code" tab?
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.]"