Created
July 13, 2021 10:18
-
-
Save DanielSSilva/82c9928ef447980e3f10654cecee911a to your computer and use it in GitHub Desktop.
The tasks to install dependencies, run tests and code coverage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- task: DotNetCoreCLI@2 | |
displayName: 'Install .NET tools from local manifest' | |
inputs: | |
command: custom | |
custom: tool | |
arguments: 'restore' | |
- task: DotNetCoreCLI@2 | |
displayName: 'Run unit tests' | |
inputs: | |
command: 'test' | |
arguments: '--no-build --configuration $(buildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:CoverletOutput=$(Build.SourcesDirectory)/TestResults/Coverage/' | |
publishTestResults: true | |
projects: GreeterProject/GreeterTests/GreeterTests.csproj | |
- task: DotNetCoreCLI@2 | |
displayName: 'Create code coverage report' | |
inputs: | |
command: custom | |
custom: tool | |
arguments: 'run reportgenerator -reports:$(Build.SourcesDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/CodeCoverage -reporttypes:HtmlInline_AzurePipelines' | |
- task: PublishCodeCoverageResults@1 | |
displayName: 'Publish code coverage report' | |
inputs: | |
codeCoverageTool: 'cobertura' | |
summaryFileLocation: '$(Build.SourcesDirectory)/**/coverage.cobertura.xml' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment