Ashish Khokhariya
Ashish Khokhariya

Reputation: 247

Is there any options for always passing pipeline even though cypress tests fails on Azure Pipelines?

"instance1": "CYPRESS_API_URL='http://localhost:1234/' cy2 run --record --parallel --config video=false -e TAGS='not @cleanup and @focus' --key sofy-automation --ci-build-id `date +%F+%H+%M`",
"cleanup-instance": "CYPRESS_API_URL='http://localhost:1234/' cy2 run --record --parallel --config video=false -e TAGS='@cleanup' --key sofy-automation --ci-build-id `date +%F+%H+%M`",
"parallel": "npm-run-all --sequential delete:reports --parallel --continue-on-error instance1 instance1 instance1 --sequential cleanup-instance --sequential combine:reports"

Above are my cypress test script running on vsts Microsoft azure pipeline. Whenever any test case gets failed , it fails entire pipeline also. I have configured through Yaml file.

- task: Yarn@2
  displayName: 'run parallel'
  inputs:
  ProjectDirectory: '$(Build.SourcesDirectory)'
  Arguments: 'parallel'
  workingDir: '$(Build.SourcesDirectory)'
  verbose: 'true'

Is there any way to pass build pipeline always true?

Upvotes: 1

Views: 787

Answers (1)

Vince Bowdren
Vince Bowdren

Reputation: 9208

Use the continueOnError property to make the pipeline continue, even if this task has failures:

- task: Yarn@2
  displayName: 'run parallel'
  inputs:
    ProjectDirectory: '$(Build.SourcesDirectory)'
    Arguments: 'parallel'
    workingDir: '$(Build.SourcesDirectory)'
    verbose: 'true'
  continueOnError: true

Upvotes: 3

Related Questions