Azure DevOps pipelines: skip on error

Updated: 2023-07-12

In our case we want to continue with the CI / CD pipeline if a specific step or job fails, e.g. the karma tests for the frontend.

- task: Npm@1 
  displayName: Test frontend 
  continueOnError: true 
  ... 
- task: Npm@1 
  displayName: Build frontend Prod 
  condition: succeededOrFailed() # continue even if previous tests failed 

The 2 instructions that we use are:

  • continueOnError: true for the task that can fail.
  • condition: succeededOrFailed() for the task that follow the one that could fail.

continueOnError The step or job is annotated with a yellow warning sign because there are issues in this step but the pipeline continue to the next step.

succeededOrFailed it starts even if the previous job failed


You could be interested in

Configure Cypress to wait the Java backend in a Docker based CI

How to configure Cypress with Docker to test an Angular/Spring Boot application
2023-06-27
WebApp built by Marco using SpringBoot 3.2.4 and Java 21, in a Server in Switzerland