Skip to content

Commit 749ad95

Browse files
committed
fix(tests): Adjust files_external tests to also work locally with WebDAV
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent d7ec515 commit 749ad95

2 files changed

Lines changed: 13 additions & 8 deletions

File tree

apps/files_external/tests/env/start-webdav-apache.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ fi
2323

2424
echo "Docker executable found - setup docker"
2525

26-
echo "Fetch recent morrisjobke/webdav docker image"
27-
docker pull morrisjobke/webdav
26+
echo "Fetch recent webdav docker image"
27+
docker pull ghcr.io/nextcloud/continuous-integration-webdav-apache:latest
2828

2929
# retrieve current folder to place the config in the parent folder
3030
thisFolder=`echo $0 | sed 's#env/start-webdav-apache\.sh##'`
@@ -45,7 +45,7 @@ if [ -n "$RUN_DOCKER_MYSQL" ]; then
4545
parameter="--link $containerName:db"
4646
fi
4747

48-
container=`docker run -P $parameter -d -e USERNAME=test -e PASSWORD=test morrisjobke/webdav`
48+
container=`docker run -P $parameter -d --rm ghcr.io/nextcloud/continuous-integration-webdav-apache:latest`
4949
host=`docker inspect --format="{{.NetworkSettings.IPAddress}}" $container`
5050

5151
echo -n "Waiting for Apache initialization on ${host}:${port}"
@@ -64,7 +64,7 @@ return array(
6464
'run'=>true,
6565
'host'=>'${host}:80/webdav/',
6666
'user'=>'test',
67-
'password'=>'test',
67+
'password'=>'pass',
6868
'root'=>'',
6969
// wait delay in seconds after write operations
7070
// (only in tests)

autotest-external.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,21 @@ function print_syntax {
3131
}
3232

3333
if ! [ -x "$PHPUNIT" ]; then
34-
echo "phpunit executable not found, please install phpunit version >= 4.8" >&2
35-
exit 3
34+
echo "phpunit executable not found, trying local one from build/integration" >&2
35+
if [ -x "$PWD/build/integration/vendor/phpunit/phpunit/phpunit" ]; then
36+
PHPUNIT="$PWD/build/integration/vendor/phpunit/phpunit/phpunit"
37+
else
38+
echo "phpunit executable not found, please install phpunit version >= 9.6" >&2
39+
exit 3
40+
fi
3641
fi
3742

3843
PHPUNIT_VERSION=$("$PHPUNIT" --version | cut -d" " -f2)
3944
PHPUNIT_MAJOR_VERSION=$(echo $PHPUNIT_VERSION | cut -d"." -f1)
4045
PHPUNIT_MINOR_VERSION=$(echo $PHPUNIT_VERSION | cut -d"." -f2)
4146

42-
if ! [ $PHPUNIT_MAJOR_VERSION -gt 9 -o \( $PHPUNIT_MAJOR_VERSION -eq 9 -a $PHPUNIT_MINOR_VERSION -ge 0 \) ]; then
43-
echo "phpunit version >= 9.0 required. Version found: $PHPUNIT_VERSION" >&2
47+
if ! [ $PHPUNIT_MAJOR_VERSION -gt 9 -o \( $PHPUNIT_MAJOR_VERSION -eq 9 -a $PHPUNIT_MINOR_VERSION -ge 6 \) ]; then
48+
echo "phpunit version >= 9.6 required. Version found: $PHPUNIT_VERSION" >&2
4449
exit 4
4550
fi
4651

0 commit comments

Comments
 (0)