Skip to content

Commit 34203c6

Browse files
committed
Fix init scripts on 5.1+
1 parent 6ed5874 commit 34203c6

File tree

6 files changed

+50
-7
lines changed

6 files changed

+50
-7
lines changed

.gitpod/setup-env.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,17 @@ fi
1818
# Clone Moodle repository.
1919
cd "${GITPOD_REPO_ROOT}" && git clone ${FASTCLONE} --branch "${MOODLE_BRANCH}" --single-branch "${MOODLE_REPOSITORY}" moodle
2020

21+
if [ -d "moodle/public" ];
22+
then
23+
MOODLE_PUBLIC_ROOT="moodle/public"
24+
else
25+
MOODLE_PUBLIC_ROOT="moodle"
26+
fi
27+
2128
# Download the data file (if given). It will be used to generate some data.
2229
if [ -n "$DATAFILE" ];
2330
then
24-
wget -O moodle/admin/tool/generator/tests/fixtures/gitpod-basic-scenario.feature "${DATAFILE}"
31+
wget -O ${MOODLE_PUBLIC_ROOT}/admin/tool/generator/tests/fixtures/gitpod-basic-scenario.feature "${DATAFILE}"
2532
fi
2633

2734
# Install adminer.

tests/app-setup.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
#!/usr/bin/env bash
22
set -e
33
basedir="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../" && pwd )"
4-
initcmd="bin/moodle-docker-compose exec -T webserver php admin/tool/behat/cli/init.php"
54

65
export MOODLE_DOCKER_WWWROOT="${basedir}/moodle"
6+
if [ -d "${MOODLE_DOCKER_WWWROOT}/public" ];
7+
then
8+
MOODLE_BEHAT_CLI_ROOT="public/admin/tool/behat/cli"
9+
else
10+
MOODLE_BEHAT_CLI_ROOT="admin/tool/behat/cli"
11+
fi
12+
713
export MOODLE_DOCKER_BROWSER=chrome
814
export MOODLE_DOCKER_DB=pgsql
915

16+
initcmd="bin/moodle-docker-compose exec -T webserver php ${MOODLE_BEHAT_CLI_ROOT}/init.php"
17+
1018
if [ "$SUITE" = "app-development" ];
1119
then
1220
export MOODLE_DOCKER_APP_PATH="${basedir}/app"

tests/app-test.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,16 @@ export MOODLE_DOCKER_WWWROOT="${basedir}/moodle"
77
export MOODLE_DOCKER_BROWSER=chrome
88
export MOODLE_DOCKER_DB=pgsql
99

10+
if [ -d "${MOODLE_DOCKER_WWWROOT}/public" ];
11+
then
12+
MOODLE_BEHAT_CLI_ROOT="public/admin/tool/behat/cli"
13+
else
14+
MOODLE_BEHAT_CLI_ROOT="admin/tool/behat/cli"
15+
fi
16+
1017
if [ "$SUITE" = "app" ] || [ "$SUITE" = "app-development" ];
1118
then
12-
testcmd="bin/moodle-docker-compose exec -T webserver php admin/tool/behat/cli/run.php --tags=@app&&@moodledocker"
19+
testcmd="bin/moodle-docker-compose exec -T webserver php ${MOODLE_BEHAT_CLI_ROOT}/run.php --tags=@app&&@moodledocker"
1320
else
1421
echo "Error, unknown suite '$SUITE'"
1522
exit 1

tests/behat-setup.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,16 @@ basedir="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../" && pwd )"
44

55
export MOODLE_DOCKER_WWWROOT="${basedir}/moodle"
66

7+
if [ -d "${MOODLE_DOCKER_WWWROOT}/public" ];
8+
then
9+
MOODLE_BEHAT_CLI_ROOT="public/admin/tool/behat/cli"
10+
else
11+
MOODLE_BEHAT_CLI_ROOT="admin/tool/behat/cli"
12+
fi
13+
714
if [ "$SUITE" = "behat" ];
815
then
9-
initcmd="bin/moodle-docker-compose exec -T webserver php admin/tool/behat/cli/init.php"
16+
initcmd="bin/moodle-docker-compose exec -T webserver php ${MOODLE_BEHAT_CLI_ROOT}/init.php"
1017
else
1118
echo "Error, unknown suite '$SUITE'"
1219
exit 1

tests/behat-test.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,16 @@ basedir="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../" && pwd )"
55

66
export MOODLE_DOCKER_WWWROOT="${basedir}/moodle"
77

8+
if [ -d "${MOODLE_DOCKER_WWWROOT}/public" ];
9+
then
10+
MOODLE_BEHAT_CLI_ROOT="public/admin/tool/behat/cli"
11+
else
12+
MOODLE_BEHAT_CLI_ROOT="admin/tool/behat/cli"
13+
fi
14+
815
if [ "$SUITE" = "behat" ];
916
then
10-
testcmd="bin/moodle-docker-compose exec -T webserver php admin/tool/behat/cli/run.php --tags=@auth_manual"
17+
testcmd="bin/moodle-docker-compose exec -T webserver php ${MOODLE_BEHAT_CLI_ROOT}/run.php --tags=@auth_manual"
1118
else
1219
echo "Error, unknown suite '$SUITE'"
1320
exit 1

tests/phpunit-setup.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,21 @@ basedir="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../" && pwd )"
44

55
export MOODLE_DOCKER_WWWROOT="${basedir}/moodle"
66

7+
if [ -d "${MOODLE_DOCKER_WWWROOT}/public" ];
8+
then
9+
MOODLE_PHPUNIT_CLI_ROOT="public/admin/tool/phpunit/cli"
10+
else
11+
MOODLE_PHPUNIT_CLI_ROOT="admin/tool/phpunit/cli"
12+
fi
13+
714
if [ "$SUITE" = "phpunit" ];
815
then
9-
initcmd="bin/moodle-docker-compose exec -T webserver php admin/tool/phpunit/cli/init.php"
16+
initcmd="bin/moodle-docker-compose exec -T webserver php ${MOODLE_PHPUNIT_CLI_ROOT}/init.php"
1017
elif [ "$SUITE" = "phpunit-full" ];
1118
then
1219
export MOODLE_DOCKER_PHPUNIT_EXTERNAL_SERVICES=true
1320
export MOODLE_DOCKER_MLBACKEND=true
14-
initcmd="bin/moodle-docker-compose exec -T webserver php admin/tool/phpunit/cli/init.php"
21+
initcmd="bin/moodle-docker-compose exec -T webserver php ${MOODLE_PHPUNIT_CLI_ROOT}/init.php"
1522
else
1623
echo "Error, unknown suite '$SUITE'"
1724
exit 1

0 commit comments

Comments
 (0)