From 4b6bd8b0c56c4db24582fa965acec054fa38e3bf Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Thu, 1 Feb 2024 13:01:11 +0100 Subject: [PATCH] fix(tests): Adjust `files_external` tests to also work locally with WebDAV Signed-off-by: Ferdinand Thiessen --- .../files_external/tests/env/start-webdav-apache.sh | 8 ++++---- autotest-external.sh | 13 +++++++++---- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/apps/files_external/tests/env/start-webdav-apache.sh b/apps/files_external/tests/env/start-webdav-apache.sh index a5464c9cfab..c58225d89b0 100755 --- a/apps/files_external/tests/env/start-webdav-apache.sh +++ b/apps/files_external/tests/env/start-webdav-apache.sh @@ -23,8 +23,8 @@ fi echo "Docker executable found - setup docker" -echo "Fetch recent morrisjobke/webdav docker image" -docker pull morrisjobke/webdav +echo "Fetch recent webdav docker image" +docker pull ghcr.io/nextcloud/continuous-integration-webdav-apache:latest # retrieve current folder to place the config in the parent folder thisFolder=`echo $0 | sed 's#env/start-webdav-apache\.sh##'` @@ -45,7 +45,7 @@ if [ -n "$RUN_DOCKER_MYSQL" ]; then parameter="--link $containerName:db" fi -container=`docker run -P $parameter -d -e USERNAME=test -e PASSWORD=test morrisjobke/webdav` +container=`docker run -P $parameter -d --rm ghcr.io/nextcloud/continuous-integration-webdav-apache:latest` host=`docker inspect --format="{{.NetworkSettings.IPAddress}}" $container` echo -n "Waiting for Apache initialization on ${host}:${port}" @@ -64,7 +64,7 @@ return array( 'run'=>true, 'host'=>'${host}:80/webdav/', 'user'=>'test', - 'password'=>'test', + 'password'=>'pass', 'root'=>'', // wait delay in seconds after write operations // (only in tests) diff --git a/autotest-external.sh b/autotest-external.sh index bc40e2474cd..ca5e2c2fa0b 100755 --- a/autotest-external.sh +++ b/autotest-external.sh @@ -31,16 +31,21 @@ function print_syntax { } if ! [ -x "$PHPUNIT" ]; then - echo "phpunit executable not found, please install phpunit version >= 4.8" >&2 - exit 3 + echo "phpunit executable not found, trying local one from build/integration" >&2 + if [ -x "$PWD/build/integration/vendor/phpunit/phpunit/phpunit" ]; then + PHPUNIT="$PWD/build/integration/vendor/phpunit/phpunit/phpunit" + else + echo "phpunit executable not found, please install phpunit version >= 9.6" >&2 + exit 3 + fi fi PHPUNIT_VERSION=$("$PHPUNIT" --version | cut -d" " -f2) PHPUNIT_MAJOR_VERSION=$(echo $PHPUNIT_VERSION | cut -d"." -f1) PHPUNIT_MINOR_VERSION=$(echo $PHPUNIT_VERSION | cut -d"." -f2) -if ! [ $PHPUNIT_MAJOR_VERSION -gt 9 -o \( $PHPUNIT_MAJOR_VERSION -eq 9 -a $PHPUNIT_MINOR_VERSION -ge 0 \) ]; then - echo "phpunit version >= 9.0 required. Version found: $PHPUNIT_VERSION" >&2 +if ! [ $PHPUNIT_MAJOR_VERSION -gt 9 -o \( $PHPUNIT_MAJOR_VERSION -eq 9 -a $PHPUNIT_MINOR_VERSION -ge 6 \) ]; then + echo "phpunit version >= 9.6 required. Version found: $PHPUNIT_VERSION" >&2 exit 4 fi