aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2017-04-19 08:15:51 +0200
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2017-04-21 14:26:31 +0200
commitcccbd028a6974ed8d26f23d266a5ee5f545bf0e6 (patch)
tree40fca643eeced30b83a392ca72628fce4f02b3c4
parent42fbf809fe25d8812a39d41f8d1352c34344c76e (diff)
downloadnextcloud-server-cccbd028a6974ed8d26f23d266a5ee5f545bf0e6.tar.gz
nextcloud-server-cccbd028a6974ed8d26f23d266a5ee5f545bf0e6.zip
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>
-rw-r--r--.drone.yml4
-rwxr-xr-xbuild/acceptance/run-local.sh10
-rwxr-xr-xbuild/acceptance/run.sh2
3 files changed, 12 insertions, 4 deletions
diff --git a/.drone.yml b/.drone.yml
index b768fd3f1ea..60194f482c4 100644
--- a/.drone.yml
+++ b/.drone.yml
@@ -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
diff --git a/build/acceptance/run-local.sh b/build/acceptance/run-local.sh
index a235871624e..bd5d6b09be1 100755
--- a/build/acceptance/run-local.sh
+++ b/build/acceptance/run-local.sh
@@ -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
diff --git a/build/acceptance/run.sh b/build/acceptance/run.sh
index 7a394883d81..2a6efde74f3 100755
--- a/build/acceptance/run.sh
+++ b/build/acceptance/run.sh
@@ -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"