From 0ac3d2a036eca24c26eaa684a4cca9c5eded1b35 Mon Sep 17 00:00:00 2001 From: Dave Long <dave@longwaveconsulting.com> Date: Wed, 26 Jun 2024 11:01:40 +0100 Subject: [PATCH] Issue #3409733 by james.williams, fjgarlin, poker10: Test-only job does not detect failures correctly --- .gitlab-ci/scripts/test-only.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci/scripts/test-only.sh b/.gitlab-ci/scripts/test-only.sh index 20f271daa255..088f08c4e3fa 100755 --- a/.gitlab-ci/scripts/test-only.sh +++ b/.gitlab-ci/scripts/test-only.sh @@ -21,8 +21,12 @@ fi echo "2ï¸âƒ£ Running test changes for this branch" +EXIT_CODE=0 if [[ $(git diff ${BASELINE} --name-only|grep -E "Test.php$") ]]; then for test in `git diff ${BASELINE} --name-only|grep -E "Test.php$"`; do - sudo SIMPLETEST_BASE_URL="$SIMPLETEST_BASE_URL" SIMPLETEST_DB="$SIMPLETEST_DB" MINK_DRIVER_ARGS_WEBDRIVER="$MINK_DRIVER_ARGS_WEBDRIVER" -u www-data ./vendor/bin/phpunit -c core $test --log-junit=./sites/default/files/simpletest/phpunit-`echo $test|sed 's/\//_/g' `.xml; + sudo SIMPLETEST_BASE_URL="$SIMPLETEST_BASE_URL" SIMPLETEST_DB="$SIMPLETEST_DB" MINK_DRIVER_ARGS_WEBDRIVER="$MINK_DRIVER_ARGS_WEBDRIVER" -u www-data ./vendor/bin/phpunit -c core $test --log-junit=./sites/default/files/simpletest/phpunit-`echo $test|sed 's/\//_/g' `.xml || EXIT_CODE=$?; done; fi + +echo "Exiting with EXIT_CODE=$EXIT_CODE" +exit $EXIT_CODE -- GitLab