Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Bitbucket Pipelines fail upon successfull execution of unit tests

Angelos Naoum
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 4, 2024

We have configured a pipeline where we ran some unit tests for a PHP Laravel project which includes the below:

- step:
name: Unit tests
services:
- mysql
image: webdevops/php-nginx:8.2
script:
- composer install --no-interaction --optimize-autoloader --ignore-platform-reqs
- pecl install xdebug
- echo "extension=xdebug.so" >> /opt/docker/etc/php/php.ini && echo "zend_extension = xdebug" >> /opt/docker/etc/php/php.ini && echo "xdebug.mode=coverage" >> /opt/docker/etc/php/php.ini
- php artisan test --coverage-clover tests/reports/coverage/coverage.xml --configuration phpunit.xml
artifacts:
- tests/reports/coverage/**
The unit tests are running successfully, so the pipeline should continue to the next step alhtough upon the successfull execution of the tests, the pipeline fails with no any explanation or any insightful log.

The same setup was working until few days ago.
We also tried to manually re-run a previous successful pipeline and the issue occurrs there too.
test.png

2 answers

1 vote
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 5, 2024

Hello @Angelos Naoum ,

thank you for reaching out to the Community!

The way that pipelines identify if a step was successful or not is based on the exit code of the commands being executed. A command that exits with code zero indicates a successful step, while any exit code other than zero will make the step be considered as failed. What may be the case is the command you are executing is returning a non-zero exit code even when the tests are successful, making the pipeline understand it as a failure.

That being said, I see you have also opened a support ticket with us to report this issue, and one of my colleagues is already investigating the affected build. In this case, I would suggest focusing the discussion on the support ticket to avoid any confusion that may arise from discussing the same issue in multiple places.

If you feel comfortable, once the support ticket is resolved, feel free to share the solution here in the Community so other users facing similar issues can try the same solution :)

Thank you, @Angelos Naoum !

Patrik S

0 votes
Jessey van Offeren
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!
June 25, 2024

Running into the same issue here, finally able to run our tests in bitbuckets pipeline with the newly increased size, and now it turns out to always failing the step even when successful.

Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 28, 2024

Hello @Jessey van Offeren ,

I would like to ask if you could please create a new question for your issue, providing details on the errors and your setup.

We generally encourage users to create a new question for their issue instead of posting on someone else’s question, because

1) the root cause and resolution may be different for each case

2) a question can become cluttered and difficult to follow if we try to troubleshoot multiple users’ issues in it.

Please feel free to let me know if you have any questions.

Thank you!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events