summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarl Schwan <carl@carlschwan.eu>2022-05-27 15:33:15 +0200
committerCôme Chilliet <come.chilliet@nextcloud.com>2023-01-24 09:34:17 +0100
commit5b0f7f7501f3705f112216771f2e4971a9885096 (patch)
tree3b50b90725e81e7c7b92e27088f4ce7abc16fc83
parenta23cd7b961fc7c0d8d52cf2d914bdee36e2a40bc (diff)
downloadnextcloud-server-5b0f7f7501f3705f112216771f2e4971a9885096.tar.gz
nextcloud-server-5b0f7f7501f3705f112216771f2e4971a9885096.zip
Use phpunit from composer if available
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
-rw-r--r--.drone.yml10
-rwxr-xr-xautotest.sh9
2 files changed, 12 insertions, 7 deletions
diff --git a/.drone.yml b/.drone.yml
index 4c372703337..cb20021cfd7 100644
--- a/.drone.yml
+++ b/.drone.yml
@@ -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"
diff --git a/autotest.sh b/autotest.sh
index f748cbbed12..84ffa0a1c78 100755
--- a/autotest.sh
+++ b/autotest.sh
@@ -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