Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to execute a sequence pipelines even when the first ones got a error.

Bruno Vinicio Araújo do Carmo
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 25, 2025

I have a Robot Framework project with API and E2E tests. The default pipeline that execute the API tests first, and then the E2E tests stops running if the API tests got a error. I'd like to to execute all pipelines, even if some returns errors. So, each pipeline will be executed and return the respective result of its execution separately. How can I do that?

I've tried the following approaches:

1:

 

RESULT=$?

if [ $RESULT -ne 0 ]; then

echo "One or more API tests failed."

else echo "All API tests passed."

fi

exit $RESULT

 

2 using a subshell block:

if [ $RESULT -ne 0 ]; then

echo "One or more API tests failed."

fi

exit $RESULT )

- echo "API tests completed, proceeding to E2E tests."

 

 

I have a Robot Framework project with API and E2E tests. The default pipeline that executes the API tests first, and then the E2E tests stop running if the API tests got an error. I'd like to execute all pipelines, even if some return errors. So, each pipeline will be executed and return the respective result of its execution separately. How can I do that?

1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 26, 2025

Hi @Bruno Vinicio Araújo do Carmo and welcome to the community!

Each pipeline is executed independently, I assume you are talking about different steps of the same pipeline?

If so, the default behavior is that a step will fail if a command of this step's script returns a non-zero exit code and then the pipeline will also fail and the rest of the steps won't run.

However, it is possible to configure the on-fail strategy for a step as ignore. If you configure this for a step and that step fails, the failure will be ignored by the overall pipeline, and the remaining steps will continue running. Please keep in mind that if the rest of the steps finish successfully the status of the pipelines will be marked as successful.

This feature is documented here:

This is an example from our documentation (I highlighted in bold the necessary options for this config):

pipelines:
default:
- step:
# The outcome of this step will be ignored
name: 'Run linting'
on-fail:
strategy: ignore
script:
- npm install
- npm run lint
- step:
# This step will always be executed regardless the outcome of the previous step.
name: 'Run tests'
script:
- npm install
- npm run test

In this example, if the first step named 'Run linting' fails, then the second step will still run.

Does this work for you?

Kind regards,
Theodora

Bruno Vinicio Araújo do Carmo
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 27, 2025

Hi, Theodora!

It worked for me! Thank you so much!!!

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 28, 2025

That's good to hear and you are very welcome!

Please feel free to reach out if you ever need anything else!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events