Azure – Coverage
- task: DotNetCoreCLI@2
displayName: Install ReportGenerator tool
condition: and(eq(${{ parameters.isTestActive }}, true), ne(${{ parameters.createImage }}, true))
continueOnError: true
inputs:
command: custom
custom: tool
arguments: update --global dotnet-reportgenerator-globaltool
- script: reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.xml -targetdir:$(Agent.TempDirectory)/coverage -reporttypes:"HtmlInline_AzurePipelines;Cobertura" -assemblyfilters:"-*Tests*;-*unittests*;-*Refit*;-*FluentValidation*;-*Serilog*;-*HealthChecks*;-*RecyclableMemoryStream*;-FluentValidation.dll"
displayName: 'Create code coverage report'
condition: and(eq(${{ parameters.isTestActive }}, true), ne(${{ parameters.createImage }}, true))
continueOnError: true
- task: PublishCodeCoverageResults@1
displayName: 'Publish code coverage'
condition: and(eq(${{ parameters.isTestActive }}, true), ne(${{ parameters.createImage }}, true))
continueOnError: true
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: $(Agent.TempDirectory)/coverage/Cobertura.xml
reportDirectory: $(Agent.TempDirectory)/coverage
pathToSources: $(Build.SourcesDirectory)
env:
DISABLE_COVERAGE_AUTOGENERATE: 'true'
Categories: Genel