Search code examples
testingazure-pipelinesxunitspecflow

In AzurePipelines.yml file using (task: DotNetCoreCLI@2) is it possible to add an argument to rerun failed tests


This is what I have working in place at the moment on the pipeline.

- task: DotNetCoreCLI@2
    displayName: Run API Scenarios
    inputs:
      command: 'test'
      projects: '**/*Myproject.csproj'
      arguments: '--filter Category=Portfolio'
      testRunTitle: 'API Test Execution'

Solution

  • Although I don't think there's anything specific for tests themselves, there is:

    - task: <name of task>
      retryCountOnTaskFailure: <max number of retries>
    

    Link to similar question and answer

    Although, you may want to add some retry mechanism in your tests if it's a flaky API test.