Last active
October 5, 2023 20:10
-
-
Save Sweekriti91/b36153e9fca43f10572f2bdbdeb74297 to your computer and use it in GitHub Desktop.
AzDO dotnetTest rerun yaml
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
trigger: | |
- main | |
pool: | |
vmImage: 'windows-2022' | |
demands: | |
- MSBuild | |
steps: | |
- task: DotNetCoreCLI@2 | |
displayName: Restore NuGet Packages | |
inputs: | |
command: 'restore' | |
projects: 'SweekyApp.sln' | |
- task: DotNetCoreCLI@2 | |
displayName: Build Test Project | |
inputs: | |
command: 'build' | |
projects: 'SweekyxTest\SweekyxTest.csproj' | |
arguments: '--configuration Debug' | |
- task: PowerShell@2 | |
displayName: 'Run Unit Test Script' | |
inputs: | |
filePath: '.\test-rerun.ps1' | |
arguments: 'SweekyxTest/SweekyxTest.csproj -configuration "Debug" -codecoverage "XPlat Code Coverage"' | |
- task: PublishTestResults@2 | |
condition: succeededOrFailed() | |
inputs: | |
testResultsFormat: 'VSTest' | |
testResultsFiles: | | |
**/testResults.trx | |
**/*.trx | |
# Publish code coverage report to the pipeline | |
- task: PublishCodeCoverageResults@1 | |
condition: succeededOrFailed() | |
displayName: 'Publish code coverage' | |
inputs: | |
codeCoverageTool: Cobertura | |
summaryFileLocation: $(System.DefaultWorkingDirectory)/*/*.cobertura.xml # using ** instead of * finds duplicate coverage files |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment