Use phpunit from composer if available

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
This commit is contained in:
Carl Schwan 2022-05-27 15:33:15 +02:00 committed by Côme Chilliet
parent a23cd7b961
commit 5b0f7f7501
No known key found for this signature in database
GPG Key ID: A3E2F658B28C760A
2 changed files with 12 additions and 7 deletions

View File

@ -1842,7 +1842,7 @@ steps:
XDEBUG_MODE: coverage
commands:
- phpenmod xdebug
- PHPUNIT_EXE=build/integration/vendor/bin/phpunit TEST_SELECTION=NODB ./autotest.sh sqlite
- TEST_SELECTION=NODB ./autotest.sh sqlite
- wget https://codecov.io/bash -O codecov.sh
- bash codecov.sh -Z -C $DRONE_COMMIT -f tests/autotest-clover-sqlite.xml
@ -1874,7 +1874,7 @@ steps:
XDEBUG_MODE: coverage
commands:
- phpenmod xdebug
- PHPUNIT_EXE=build/integration/vendor/bin/phpunit TEST_SELECTION=QUICKDB ./autotest.sh sqlite
- TEST_SELECTION=QUICKDB ./autotest.sh sqlite
- wget https://codecov.io/bash -O codecov.sh
- bash codecov.sh -Z -C $DRONE_COMMIT -f tests/autotest-clover-sqlite.xml
@ -1916,7 +1916,7 @@ steps:
commands:
- phpenmod xdebug
- ./tests/drone-wait-objectstore.sh
- PHPUNIT_EXE=build/integration/vendor/bin/phpunit TEST_SELECTION=PRIMARY-s3 ./autotest.sh sqlite
- TEST_SELECTION=PRIMARY-s3 ./autotest.sh sqlite
- wget https://codecov.io/bash -O codecov.sh
- bash codecov.sh -C $DRONE_COMMIT -f tests/autotest-clover-sqlite.xml
@ -1946,7 +1946,7 @@ steps:
commands:
- phpenmod xdebug
- ./tests/drone-wait-objectstore.sh
- PHPUNIT_EXE=build/integration/vendor/bin/phpunit TEST_SELECTION=PRIMARY-azure ./autotest.sh sqlite
- TEST_SELECTION=PRIMARY-azure ./autotest.sh sqlite
- wget https://codecov.io/bash -O codecov.sh
- bash codecov.sh -C $DRONE_COMMIT -f tests/autotest-clover-sqlite.xml
@ -1978,7 +1978,7 @@ steps:
commands:
- phpenmod xdebug
- service memcached restart
- PHPUNIT_EXE=build/integration/vendor/bin/phpunit ./autotest.sh sqlite tests/lib/Memcache/MemcachedTest.php
- ./autotest.sh sqlite tests/lib/Memcache/MemcachedTest.php
- wget https://codecov.io/bash -O codecov.sh
- sh -c "if [ '$DRONE_BUILD_EVENT' = 'pull_request' ]; then bash codecov.sh -B $DRONE_BRANCH -C $DRONE_COMMIT -P $DRONE_PULL_REQUEST -t 117641e2-a9e8-4b7b-984b-ae872d9b05f5 -f tests/autotest-clover-sqlite.xml; fi"
- sh -c "if [ '$DRONE_BUILD_EVENT' != 'pull_request' ]; then bash codecov.sh -B $DRONE_BRANCH -C $DRONE_COMMIT -t 117641e2-a9e8-4b7b-984b-ae872d9b05f5 -f tests/autotest-clover-sqlite.xml; fi"

View File

@ -30,8 +30,13 @@ if [ -z "$PHP_EXE" ]; then
fi
PHP=$(which "$PHP_EXE")
if [ -z "$PHPUNIT_EXE" ]; then
PHPUNIT_EXE=phpunit
if [ -f "build/integration/vendor/bin/phpunit" ]; then
PHPUNIT_EXE="./build/integration/vendor/bin/phpunit"
else
PHPUNIT_EXE=phpunit
fi
fi
PHPUNIT=$(which "$PHPUNIT_EXE")
set -e
@ -56,7 +61,7 @@ else
fi
if ! [ -x "$PHPUNIT" ]; then
echo "phpunit executable not found, please install phpunit version >= 6.5" >&2
echo "phpunit executable not found, please install phpunit version >= 9.0" >&2
exit 3
fi