Add safety parameter

As the script modifies the Git repository a safety parameter was added
to prevent running it by mistake and messing with the local copy of the
repository.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
pull/4208/head
Daniel Calviño Sánchez 7 years ago
parent 42fbf809fe
commit cccbd028a6

@ -481,14 +481,14 @@ pipeline:
acceptance-access-levels:
image: nextcloudci/php7.0:php7.0-7
commands:
- build/acceptance/run-local.sh features/access-levels.feature
- build/acceptance/run-local.sh allow-git-repository-modifications features/access-levels.feature
when:
matrix:
TESTS-ACCEPTANCE: access-levels
acceptance-login:
image: nextcloudci/php7.0:php7.0-7
commands:
- build/acceptance/run-local.sh features/login.feature
- build/acceptance/run-local.sh allow-git-repository-modifications features/login.feature
when:
matrix:
TESTS-ACCEPTANCE: login

@ -39,7 +39,15 @@ set -o errexit
# Behat through Composer or running Behat) expect that.
cd "$(dirname $0)"
SCENARIO_TO_RUN=$1
# Safety parameter to prevent executing this script by mistake and messing with
# the Git repository.
if [ "$1" != "allow-git-repository-modifications" ]; then
echo "To run the acceptance tests use \"run.sh\" instead"
exit 1
fi
SCENARIO_TO_RUN=$2
composer install

@ -174,4 +174,4 @@ prepareSelenium
prepareDocker
echo "Running tests"
docker exec $NEXTCLOUD_LOCAL_CONTAINER bash -c "cd nextcloud && build/acceptance/run-local.sh $SCENARIO_TO_RUN"
docker exec $NEXTCLOUD_LOCAL_CONTAINER bash -c "cd nextcloud && build/acceptance/run-local.sh allow-git-repository-modifications $SCENARIO_TO_RUN"

Loading…
Cancel
Save