Skip to content

Commit 39f2025

Browse files
authored
Merge pull request #36497 from nextcloud/techdebt/noid/fix-autotest-execution
Fix autotest.sh execution
2 parents d83ea28 + 5096d4f commit 39f2025

1 file changed

Lines changed: 13 additions & 12 deletions

File tree

autotest.sh

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ if [ -z "$PHP_EXE" ]; then
3030
fi
3131
PHP=$(which "$PHP_EXE")
3232
if [ -z "$PHPUNIT_EXE" ]; then
33-
if [ -f "build/integration/vendor/bin/phpunit" ]; then
34-
PHPUNIT_EXE="./build/integration/vendor/bin/phpunit"
35-
else
36-
PHPUNIT_EXE=phpunit
37-
fi
33+
if [ -f build/integration/vendor/bin/phpunit ]; then
34+
PHPUNIT_EXE="./build/integration/vendor/bin/phpunit"
35+
PHPUNIT=$(readlink -f "$PHPUNIT_EXE")
36+
else
37+
PHPUNIT_EXE=phpunit
38+
PHPUNIT=$(which "$PHPUNIT_EXE")
39+
fi
3840
fi
3941

40-
PHPUNIT=$(which "$PHPUNIT_EXE")
41-
4242
set -e
4343

4444
_XDEBUG_CONFIG=$XDEBUG_CONFIG
@@ -61,7 +61,8 @@ else
6161
fi
6262

6363
if ! [ -x "$PHPUNIT" ]; then
64-
echo "phpunit executable not found, please install phpunit version >= 9.0" >&2
64+
echo "phpunit executable not found, please install phpunit version >= 9.0 manually or via:" >&2
65+
echo " cd build/integration && composer install" >&2
6566
exit 3
6667
fi
6768

@@ -76,8 +77,8 @@ PHPUNIT_VERSION=$($PHPUNIT --version | cut -d" " -f2)
7677
PHPUNIT_MAJOR_VERSION=$(echo "$PHPUNIT_VERSION" | cut -d"." -f1)
7778
PHPUNIT_MINOR_VERSION=$(echo "$PHPUNIT_VERSION" | cut -d"." -f2)
7879

79-
if ! [ "$PHPUNIT_MAJOR_VERSION" -gt 6 -o \( "$PHPUNIT_MAJOR_VERSION" -eq 6 -a "$PHPUNIT_MINOR_VERSION" -ge 5 \) ]; then
80-
echo "phpunit version >= 6.5 required. Version found: $PHPUNIT_VERSION" >&2
80+
if ! [ "$PHPUNIT_MAJOR_VERSION" -gt 6 -o \( "$PHPUNIT_MAJOR_VERSION" -eq 9 -a "$PHPUNIT_MINOR_VERSION" -ge 0 \) ]; then
81+
echo "phpunit version >= 9.0 required. Version found: $PHPUNIT_VERSION" >&2
8182
exit 4
8283
fi
8384

@@ -400,8 +401,8 @@ function execute_tests {
400401
echo "No coverage"
401402
fi
402403

403-
echo "$PHP" "${PHPUNIT[@]}" --configuration phpunit-autotest.xml $GROUP $COVER --log-junit "autotest-results-$DB.xml" "$2" "$3"
404-
"$PHP" "${PHPUNIT[@]}" --configuration phpunit-autotest.xml $GROUP $COVER --log-junit "autotest-results-$DB.xml" "$2" "$3"
404+
echo "$PHPUNIT" --configuration phpunit-autotest.xml $GROUP $COVER --log-junit "autotest-results-$DB.xml" "$2" "$3"
405+
"$PHPUNIT" --configuration phpunit-autotest.xml $GROUP $COVER --log-junit "autotest-results-$DB.xml" "$2" "$3"
405406
RESULT=$?
406407

407408
if [ "$PRIMARY_STORAGE_CONFIG" == "swift" ] ; then

0 commit comments

Comments
 (0)