Skip to content

Instantly share code, notes, and snippets.

@Sweekriti91
Created October 2, 2023 21:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sweekriti91/f18d49faddf5a66ba0afa1357ddce719 to your computer and use it in GitHub Desktop.
Save Sweekriti91/f18d49faddf5a66ba0afa1357ddce719 to your computer and use it in GitHub Desktop.
AzDO dotnetTest rerun VSTest@3 Task
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: VSTest@3
inputs:
testSelector: 'testAssemblies'
testAssemblyVer2: |
**\bin\Debug\net7.0\**\*test*.dll
**\bin\Debug\net7.0\**\*Test*.dll
!**\obj\**
!**\ref\**
!**\xunit.runner.visualstudio.testadapter.dll
!**\xunit.runner.visualstudio.dotnetcore.testadapter.dll
!**\xunit.runner.reporters.netcoreapp10.dll*
!**\xunit.runner.utility.netcoreapp10.dll*
!**\xunit.runner.visualstudio.dotnetcore.testadapter.dll*
searchFolder: '$(System.DefaultWorkingDirectory)'
codeCoverageEnabled: true
rerunFailedTests: true
rerunType: 'basedOnTestFailureCount'
rerunFailedTestCasesMaxLimit: '10'
rerunMaxAttempts: '2'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment