Skip to content

Commit

Permalink
Fix ci: travis - Better test if phpunit completed
Browse files Browse the repository at this point in the history
# Fix ci: travis - Better test if phpunit completed
  • Loading branch information
mdeweerd committed Jan 17, 2025
1 parent c5421e4 commit 09a1075
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -547,12 +547,12 @@ script:
- |
echo "Unit testing"
# Ensure we catch errors with -e. Set this to +e instead of -e if you want to go to the end to see dolibarr.log file.
set -e
phpunit -d memory_limit=-1 -c test/phpunit/phpunittest.xml test/phpunit/AllTests.php
phpunitresult=$?
{ echo TEST ; exit 1 } | tee /dev/tty | grep -qE "done" ; echo "STATUSES: '${PIPESTATUS[0]}' '${PIPESTATUS[1]}' '${PIPESTATUS[2]}'"
# Also check that phpunit output shows a test summary
phpunit -d memory_limit=-1 -c test/phpunit/phpunittest.xml test/phpunit/AllTests.php | tee /dev/tty | grep -qE "(OK .*[0-9]+ tests.*[0-9]+ assertions|Tests: [0-9]+)" ; phpunitresult=${PIPESTATUS[0]} || phpunitresult=$?
echo "Phpunit return code = $phpunitresult"
set +e
# Comment set -e if you want to go to the end to see the dolibarr.log file.
[ $phpunitresult == 0 ] || exit $phpunitresult
echo
after_script:
Expand Down

0 comments on commit 09a1075

Please sign in to comment.