Add code coverage reports

This commit is contained in:
Timothy Baldridge 2020-04-07 14:08:12 -06:00
parent 4e0b050260
commit fd350da6ee

View File

@ -37,12 +37,30 @@ steps:
command: 'build'
projects: 'Wabbajack\Wabbajack.csproj'
arguments: '--runtime win10-x64 --configuration Release /p:Platform=x64'
- task: DotNetCoreCLI@2
displayName: "Test Release"
inputs:
command: 'test'
projects: '**/*.Test.csproj'
arguments: '/p:Platform=x64'
arguments: '/p:Platform=x64 /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura'
# Generate the report using ReportGenerator (https://github.com/danielpalme/ReportGenerator)
# First install the tool on the machine, then run it
- script: |
dotnet tool install -g dotnet-reportgenerator-globaltool
reportgenerator -reports:$(Build.SourcesDirectory)/tests/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/CodeCoverage -reporttypes:HtmlInline_AzurePipelines;Cobertura
displayName: Create Code coverage report
# Publish the code coverage result (summary and web site)
# The summary allows to view the coverage percentage in the summary tab
# The web site allows to view which lines are covered directly in Azure Pipeline
- task: PublishCodeCoverageResults@1
displayName: 'Publish code coverage'
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(Build.SourcesDirectory)/CodeCoverage/Cobertura.xml'
reportDirectory: '$(Build.SourcesDirectory)/CodeCoverage'
- task: DotNetCoreCLI@2
inputs: