mercredi 8 mars 2017

Jenkins 1.647 - PhpUnit Test fail but build succesfull

I have a Jenkins that run several task, included my tests with phpunit. Everything is working, the test are running but when a test fail the build is set like Succesfull and I don't get my notifications. I wanna that when a test fail, the build fail to notificate github and the developer too.

The notification system works OK when a build fail because I have migrations too that are working ok.

My phpunit.xml file look like this:

<phpunit
    backupGlobals="true"
    backupStaticAttributes="false"
    bootstrap="bootstrap.php"
    cacheTokens="false"
    colors="true"
    convertErrorsToExceptions="true"
    convertNoticesToExceptions="true"
    convertWarningsToExceptions="true"
    forceCoversAnnotation="false"
    mapTestClassNameToCoveredClassName="false"
    processIsolation="false"
    stopOnError="true"
    stopOnFailure="true"
    stopOnIncomplete="true"
    stopOnSkipped="true"
    stopOnRisky="true"
    strict="false"
    timeoutForSmallTests="1"
    timeoutForMediumTests="10"
    timeoutForLargeTests="60"
    verbose="true"

And this is one of the outputs of Jenkins.

There was 1 error:

Undefined index: payroll

/tmp/app/test/unit/payroll/PayrollTest.php:24

FAILURES!
Tests: 311, Assertions: 392, Errors: 1.

BUILD FINISHED

Total time: 2 minutes  17.89 seconds

[INFO] HipChat notification sent to the following rooms: app
Finished: SUCCESS

Hints ? Best regards.

Aucun commentaire:

Enregistrer un commentaire