I have enabled code coverage in Cobertura format and I am trying to exclude some files (Especially 3rd party DLLs) from Code Coverage analysis in the Azure DevOps pipeline. Currently, below is the output I get in the pipeline
Here 3rd party DLLs are also included in the coverage report. I want to exclude all 3rd party DLLs like FluentAssertion, Microsoft.Azure etc.
Below are the some line from my YAML file which produces above output
- task: VSTest@2
displayName: 'Run .NET Core Unit Tests $(ucSolution)'
continueOnError: true
inputs:
testSelector: 'testAssemblies'
testAssemblyVer2: |
**\MyApp.*.UnitTests.dll
!**\*TestAdapter.dll
!**\obj\**
!**\ref\**
searchFolder: '$(System.DefaultWorkingDirectory)'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
diagnosticsEnabled: true
rerunFailedTests: true
rerunFailedThreshold: '10'
rerunMaxAttempts: '1'
resultsFolder: '$(build.ArtifactStagingDirectory)\Test\Results\core'
otherConsoleOptions: '/collect:"Code Coverage;Format=Cobertura"'
- task: PublishCodeCoverageResults@1
displayName: 'Publish code coverage results'
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: $(build.ArtifactStagingDirectory)/Test/Results/**/**/*.cobertura.xml
Could anyone suggest how I can exclude 3rd party DLLs from the analysis or code coverage report?
I really appreciate any help you can provide.