Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions tests/app-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,19 @@ export MOODLE_DOCKER_DB=pgsql

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

if [ -d "$basedir/moodle/public" ];
then
MOODLE_PUBLIC_ROOT="$basedir/moodle/public"
else
MOODLE_PUBLIC_ROOT="$basedir/moodle"
fi

if [ "$SUITE" = "app-development" ];
then
export MOODLE_DOCKER_APP_PATH="${basedir}/app"

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

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

git clone --branch "$branch" --depth 1 https://github.com/moodlehq/moodle-local_moodleappbehat $basedir/moodle/local/moodleappbehat
git clone --branch "$branch" --depth 1 https://github.com/moodlehq/moodle-local_moodleappbehat ${MOODLE_PUBLIC_ROOT}/local/moodleappbehat

else
echo "Error, unknown suite '$SUITE'"
exit 1
fi

cp $basedir/assets/appbehattests/app.feature $basedir/moodle/local/moodleappbehat/tests/behat/app.feature
cp $basedir/assets/appbehattests/app.feature ${MOODLE_PUBLIC_ROOT}/local/moodleappbehat/tests/behat/app.feature

echo "Pulling docker images"
$basedir/bin/moodle-docker-compose pull
Expand Down
9 changes: 8 additions & 1 deletion tests/phpunit-teardown.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ basedir="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../" && pwd )"

export MOODLE_DOCKER_WWWROOT="${basedir}/moodle"

rm -f $basedir/moodle/local/moodleappbehat/tests/behat/app.feature
if [ -d "$MOODLE_DOCKER_WWWROOT/public" ];
then
MOODLE_PUBLIC_ROOT="$MOODLE_DOCKER_WWWROOT/public"
else
MOODLE_PUBLIC_ROOT="$MOODLE_DOCKER_WWWROOT"
fi

rm -f ${MOODLE_PUBLIC_ROOT}/local/moodleappbehat/tests/behat/app.feature

if [ "$SUITE" = "phpunit" ];
then
Expand Down
Loading