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/**
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.