I am currently look to move a step in a pipeline from using VSTest@2 to use dotnet test instead. I have read that you can configure dotnet test by using a .runsettings file. However there seems to be settings available in VSTest@2 that I cannot find corresponding setting for dotnet test.
One of these is minimumExpectedTests which will fail the step if it drops below a given number of tests. Can this be done with dotnet test?
# Existing step
- task: VSTest@2
inputs:
testSelector: 'testAssemblies'
testAssemblyVer2: bin\Release\**\Foo.*.Tests.dll
searchFolder: '$(System.DefaultWorkingDirectory)'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
# Should fail if 500 tests are not run
failOnMinTestsNotRun: true
minimumExpectedTests: '500'
# New step
- task: DotNetCoreCLI@2
inputs:
command: 'test'
projects: **\bin\Release\**\Foo.*.Tests.dll
publishTestResults: false
arguments: '--v normal -s test.runsettings'
testRunTitle: 'Run Tests'
