From b87964f71678f61cfc6be2f27ada080444357a6e Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sat, 9 Nov 2019 11:25:33 +0100 Subject: [PATCH] Updated API tests script so that it throws the same exit code returned by phpunit --- .travis.yml | 6 +++++- bin/test/run-api-tests.sh | 7 +++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5e0b9c65..6b2a861a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,10 @@ services: - postgresql - docker +cache: + directories: + - $HOME/.composer/cache/files + before_install: - echo 'extension = apcu.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini - yes | pecl install swoole @@ -25,7 +29,7 @@ before_install: install: - composer self-update - - composer install --no-interaction + - composer install --no-interaction --prefer-dist before_script: - mysql -e 'CREATE DATABASE shlink_test;' diff --git a/bin/test/run-api-tests.sh b/bin/test/run-api-tests.sh index 5a497716..5d256c33 100755 --- a/bin/test/run-api-tests.sh +++ b/bin/test/run-api-tests.sh @@ -10,4 +10,11 @@ vendor/bin/zend-expressive-swoole start -d sleep 2 vendor/bin/phpunit --order-by=random -c phpunit-api.xml --testdox --colors=always + +# Capture tests exit code +testsExitCode=$? + vendor/bin/zend-expressive-swoole stop + +# Exit this script with the same code as the tests. If tests failed, this script has to fail +exit testsExitCode