I'm running newman tests on the release pipeline but when tests have error it just mark the stage as partially succeeded, but I want to make it failed to trigger the Auto-Redeploy Trigger. Is this possible?
Asked
Active
Viewed 5,608 times
1
-
I don't know much about deploying in the classic editor, but, your question is confusing. just to clarify, you want to trigger a deployment, even when the tests have a error? "make it failed to trigger"...it fails but you want to trigger a deployment anyway...just getting lost here, – Jay Sep 28 '20 at 05:33
-
on a side note, consider moving to YAML. classic editor, a little tricky to do advanced things. – Jay Sep 28 '20 at 05:33
-
@Jay The flow is after the artifact has been deployed to Azure App Service I want to test it with newman API tests. Then if API Tests stage failed, I want to redeploy the previous build. – Ronald Abellano Sep 28 '20 at 05:38
-
1in that case, what you are looking for are pipeline triggers. I would recommend you start here - https://learn.microsoft.com/en-us/azure/devops/pipelines/build/triggers?view=azure-devops . but please note, as I said before, you must migrate to using YAML if you are planning to do specific, advanced scenarios like this. – Jay Sep 28 '20 at 05:49
-
Does this answer your question? [How to start previous successful release automatically in Devops/VSTS](https://stackoverflow.com/questions/64043553/how-to-start-previous-successful-release-automatically-in-devops-vsts) – Krzysztof Madej Sep 28 '20 at 08:16
2 Answers
5
If you are using powershell tasks for trigger newman tests, you can set task result state with below commands.
- Write-Host "##vso[task.complete result=Succeeded;]"
- Write-Host "##vso[task.complete result=SucceededWithIssues;]"
- Write-Host "##vso[task.complete result=Failed;]"

nrllhcinar
- 109
- 5
0
I want to make it failed to trigger the Auto-Redeploy Trigger. Is this possible?
To make the stage to fail:
Yes, it's possible. When we enable the Continue on error
option for one test task, the test task and following tasks would continue to run even when there's error in test task. And the stage which contains the test task will be marked with partial succeeded
, so unchecking/disabling the Continue on error
would make the stage to fail instead of partially succeed.
To make auto-redeploy:
More details about auto-redeploy you can check this thread.

LoLance
- 25,666
- 1
- 39
- 73