Skip to content

Commit eade049

Browse files
committed
Fix more scripts due to public folder change on 5.1+
1 parent 83d6cc6 commit eade049

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

tests/app-setup.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,19 @@ export MOODLE_DOCKER_DB=pgsql
1515

1616
initcmd="bin/moodle-docker-compose exec -T webserver php ${MOODLE_BEHAT_CLI_ROOT}/init.php"
1717

18+
if [ -d "$basedir/moodle/public" ];
19+
then
20+
MOODLE_PUBLIC_ROOT="$basedir/moodle/public"
21+
else
22+
MOODLE_PUBLIC_ROOT="$basedir/moodle"
23+
fi
24+
1825
if [ "$SUITE" = "app-development" ];
1926
then
2027
export MOODLE_DOCKER_APP_PATH="${basedir}/app"
2128

2229
git clone --branch "$MOODLE_DOCKER_APP_VERSION" --depth 1 https://github.com/moodlehq/moodleapp $basedir/app
23-
git clone --branch "$MOODLE_DOCKER_APP_VERSION" --depth 1 https://github.com/moodlehq/moodle-local_moodleappbehat $basedir/moodle/local/moodleappbehat
30+
git clone --branch "$MOODLE_DOCKER_APP_VERSION" --depth 1 https://github.com/moodlehq/moodle-local_moodleappbehat ${MOODLE_PUBLIC_ROOT}/local/moodleappbehat
2431

2532
if [[ ! -f $basedir/app/.npmrc || -z "$(cat $basedir/app/.npmrc | grep unsafe-perm)" ]];
2633
then
@@ -43,13 +50,14 @@ then
4350
branch="v$branch"
4451
fi
4552

46-
git clone --branch "$branch" --depth 1 https://github.com/moodlehq/moodle-local_moodleappbehat $basedir/moodle/local/moodleappbehat
53+
git clone --branch "$branch" --depth 1 https://github.com/moodlehq/moodle-local_moodleappbehat ${MOODLE_PUBLIC_ROOT}/local/moodleappbehat
54+
4755
else
4856
echo "Error, unknown suite '$SUITE'"
4957
exit 1
5058
fi
5159

52-
cp $basedir/assets/appbehattests/app.feature $basedir/moodle/local/moodleappbehat/tests/behat/app.feature
60+
cp $basedir/assets/appbehattests/app.feature ${MOODLE_PUBLIC_ROOT}/local/moodleappbehat/tests/behat/app.feature
5361

5462
echo "Pulling docker images"
5563
$basedir/bin/moodle-docker-compose pull

tests/phpunit-teardown.sh

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

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

7-
rm -f $basedir/moodle/local/moodleappbehat/tests/behat/app.feature
7+
if [ -d "$MOODLE_DOCKER_WWWROOT/public" ];
8+
then
9+
MOODLE_PUBLIC_ROOT="$MOODLE_DOCKER_WWWROOT/public"
10+
else
11+
MOODLE_PUBLIC_ROOT="$MOODLE_DOCKER_WWWROOT"
12+
fi
13+
14+
rm -f ${MOODLE_PUBLIC_ROOT}/local/moodleappbehat/tests/behat/app.feature
815

916
if [ "$SUITE" = "phpunit" ];
1017
then

0 commit comments

Comments
 (0)