Skip to content

Publish code coverage task overrides ReportGenerator filters #10354

Description

@i-holo

Required Information

Type: bug
Enter Task Name: PublishCodeCoverageResults@1

Environment

  • Server - Azure Pipelines
  • Agent - Private
  • dotnet-reportgenerator-cli Version="4.1.5"

Issue description

I am configuring azure CI pipeline. And I've added following steps:

  • test
  • report generator
  • publish code coverage

ReportGenerator is the well know tool https://github.com/danielpalme/ReportGenerator
that exists in the Azure Devops marketplace
image

in the ReportGenerator I apply filters to exclude test projects from the total test coverage report and exclude extra xUnit assemblies from analysis.

image

In the console log I see that following filters were applied:

-assemblyfilters:-[.tests] -[.Tests] -[xunit.]* -[.Test] -[Xunit.]*
-classfilters:-[.tests] -[.Tests] -[xunit.]* -[.Test] -[Xunit.]*
-filefilters:-[.tests] -[.Tests] -[xunit.]* -[.Test] -[Xunit.]*

as you also can see, on the next step Publishing code coverage task starts and it re-generates summary report one more time without applying the assembly filtering.
it became like this after integration with reportGenerator tool
https://docs.microsoft.com/en-us/azure/devops/release-notes/2019/sprint-150-update#cobertura-code-coverage-report-updates

how to apply filtering and exclude necessary files from the report on CI, while publishing code coverage step override the filter attributes. Can you also apply settings for filtering classes and assemblies

finale report has data that I don't really need
image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions