summaryrefslogtreecommitdiffstats
path: root/autotest-external.sh
diff options
context:
space:
mode:
authorRobin McCorkell <rmccorkell@karoshi.org.uk>2015-01-28 15:06:18 +0000
committerRobin McCorkell <rmccorkell@karoshi.org.uk>2015-01-28 15:06:18 +0000
commit5acbeb9666ca0534cb1a46d9ed1c9d26521500f2 (patch)
treeaa3bf75eff01806a80202e6af5ae59f87925e099 /autotest-external.sh
parent55142186deb9e163ce3519453ebfe93f6a446666 (diff)
downloadnextcloud-server-5acbeb9666ca0534cb1a46d9ed1c9d26521500f2.tar.gz
nextcloud-server-5acbeb9666ca0534cb1a46d9ed1c9d26521500f2.zip
Better cleanup in autotest.sh
Configs correctly cleaned, even if phpunit fails or autotest interrupted
Diffstat (limited to 'autotest-external.sh')
-rwxr-xr-xautotest-external.sh18
1 files changed, 10 insertions, 8 deletions
diff --git a/autotest-external.sh b/autotest-external.sh
index 761477a4c97..74acddfd7a0 100755
--- a/autotest-external.sh
+++ b/autotest-external.sh
@@ -60,20 +60,25 @@ if [ "$1" ]; then
fi
fi
-# Back up existing (dev) config if one exists
-if [ -f config/config.php ]; then
+# Back up existing (dev) config if one exists and backup not already there
+if [ -f config/config.php ] && [ ! -f config/config-autotest-backup.php ]; then
mv config/config.php config/config-autotest-backup.php
fi
-function restore_config {
+function cleanup_config {
+ cd "$BASEDIR"
# Restore existing config
if [ -f config/config-autotest-backup.php ]; then
mv config/config-autotest-backup.php config/config.php
fi
+ # Remove autotest config
+ if [ -f config/autoconfig.php ]; then
+ rm config/autoconfig.php
+ fi
}
-# restore config on exit, even when killed
-trap restore_config SIGINT SIGTERM
+# restore config on exit
+trap cleanup_config EXIT
# use tmpfs for datadir - should speedup unit test execution
if [ -d /dev/shm ]; then
@@ -278,9 +283,6 @@ else
execute_tests "$1" "$2"
fi
-cd "$BASEDIR"
-
-restore_config
#
# NOTES on mysql:
# - CREATE DATABASE oc_autotest;