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>
This commit is contained in:
Daniel Calviño Sánchez 2017-04-19 08:15:51 +02:00
parent 42fbf809fe
commit cccbd028a6
3 changed files with 12 additions and 4 deletions

View file

@ -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

View file

@ -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

View file

@ -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"