Forum Discussion
thanujapathiraja
Aug 12, 2024Copper Contributor
##[error]PowerShell exited with code '1'
When I run Newman in the pipeline if there is failure, it stop the rest of the pipeline.
##[error]PowerShell exited with code '1'.
Finishing: Run newman
I need to continue the pipeline.
- task: PowerShell@2
displayName: Run newman
inputs:
targetType: 'inline'
script: 'newman run $(System.DefaultWorkingDirectory)/test/postman_collection.json -r htmlextra --reporters cli,htmlextra,junit --reporter-junit-export $(System.DefaultWorkingDirectory)/test/Results/junitReport.xml --reporter-htmlextra-export $(System.DefaultWorkingDirectory)/test/report/TestReport.html'
errorActionPreference: 'continue'
condition: succeededOrFailed()
Can anyone help me on this?
This runs perfectly when there is no assertion failure.
How about this:
- task: PowerShell@2
displayName: Run newman
inputs:
targetType: 'inline'
script: 'newman run $(System.DefaultWorkingDirectory)/test/postman_collection.json -r htmlextra --reporters cli,htmlextra,junit --reporter-junit-export $(System.DefaultWorkingDirectory)/test/Results/junitReport.xml --reporter-htmlextra-export $(System.DefaultWorkingDirectory)/test/report/TestReport.html'
errorActionPreference: 'continue'
continueOnError: true
condition: succeededOrFailed()
2 Replies
Sort By
How about this:
- task: PowerShell@2
displayName: Run newman
inputs:
targetType: 'inline'
script: 'newman run $(System.DefaultWorkingDirectory)/test/postman_collection.json -r htmlextra --reporters cli,htmlextra,junit --reporter-junit-export $(System.DefaultWorkingDirectory)/test/Results/junitReport.xml --reporter-htmlextra-export $(System.DefaultWorkingDirectory)/test/report/TestReport.html'
errorActionPreference: 'continue'
continueOnError: true
condition: succeededOrFailed()- thanujapathirajaCopper Contributortask: PowerShell@2
displayName: Run newman
inputs:
targetType: 'inline'
script: 'newman run $(System.DefaultWorkingDirectory)/test/postman_collection.json -r htmlextra --reporters cli,htmlextra,junit --reporter-junit-export $(System.DefaultWorkingDirectory)/test/Results/junitReport.xml --reporter-htmlextra-export $(System.DefaultWorkingDirectory)/test/report/TestReport.html --bail false'
ignoreLastExitCode: true
condition: always()
finally solved. Thanks for the help kidd_lp 🙂