Search code examples
.netazure-pipelinesbrowserstack

How can I get my Dotnet Test to rerun failed tests


I am using C#. I am using Azure Pipelines and BrowserStack. I know how to get the Pipelines to rerun the task but I want to only run the failed tests for a second time right after the initial failures. Is this possible


Solution

  • You can achieve this with a custom task in pipeline and dotnet test command line. It needs a bit of hack since dontnet test does not provide a command line parameter to run only the failed tests. This can help you build the command to be run from the custom task.

    Also, this demonstrates building custom task in Azure pipeline.