3

Gitlab-runner is terminating a job successfully even though PHPunit test is throwing a error code 0, although it should fail, it continues leading me into error. I also know the error is comming because of bad merge, which are going into production.

my gitlab-ci.yml is

stages:
  - test
  - deploy 
  - .post


     
stages:

test_job:
  stage: test
  script:
    - phpunit

I also try stopOnFailure to true with no luck.

<phpunit backupGlobals="false"
         backupStaticAttributes="false"
         colors="never"
         convertErrorsToExceptions="true"
         convertNoticesToExceptions="true"
         convertWarningsToExceptions="true"
         processIsolation="false"
         stopOnFailure="false"
         syntaxCheck="false"
         coverageText="false"
         beStrictAboutTestsThatDoNotTestAnything="false"
         bootstrap="Bootstrap_tests.php"
    >

Please let me know if you need more information and thanks for input!

staminna
  • 468
  • 1
  • 5
  • 26
  • If PHPUnit is exiting with code '0' when there are test failures, it sounds like a bug to me. I'd recommend creating an Issue in the PHPUnit project in [GitHub](https://github.com/sebastianbergmann/phpunit/issues/new/choose) and let them investigate. According to existing issues I found, PHPUnit should always return a non-0 code if there are failures, but this doesn't seem to be happening. Also, check that you're using the most recent versions of composer, phpunit, etc. and see if that helps at all. – Adam Marshall Sep 03 '21 at 15:38

0 Answers0