Greg P
Greg P

Reputation: 802

Azure DevOps Deploy Release step on Failure

Our structure for a release in azure devops is to

deploy our app to our DEV environment. Kick off my Selenium (Visual Studio) tests against that environment. If passes, moves to our TEST environment. If fails/hard stop. We want to add new piece/functionality, starts same as above, Except instead of hard stop. 5) if default step fails, continue to next step. 6) New detail testing starts (turns on screen recorder)

The new detailed step has 'Agent Job' settings/parameters, I have the section "Run this job", set to "Only when previous job has failed".

My results have been, that if the previous/default/basic testing passed, the detailed step is skipped. As expected.

But if the previous step fails....the following new detailed step does not kick off.

Is it possible because the step is set up that if it fails hard stop and does not even evaluate the next step?

Or is it because the previous step says 'partially succeeded'. is this basically seen not as a failure?

Upvotes: 1

Views: 292

Answers (2)

Greg P
Greg P

Reputation: 802

As an addition to the solution, a piece I missed was on the 'detailed' job, the 'Trigger even when the selected stages partially succeed', also needed to be checked, as well as the solution for the same step above.

Upvotes: 1

Krzysztof Madej
Krzysztof Madej

Reputation: 40779

Yes, this is correct. Because failed is equivalent of eq(variables['Agent.JobStatus'], 'Failed') status. But partially succeeded is eq(variables['Agent.JobStatus'], 'SucceededWithIssues').

Please check here.

You may try custom conditions like :

in(variables['Agent.JobStatus'], 'Failed', 'SucceededWithIssues')

enter image description here

Upvotes: 1

Related Questions