diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-02-25 02:31:14 -0800 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-02-25 02:31:14 -0800 |
commit | 7f7cdecb1a070e1c691a343abe2be2cad0937a1e (patch) | |
tree | 43de6992597bc0306ba6af917b7d6ddd3e5ed515 | |
parent | 799e144b04a4b053d821410b06fb5c71dda4ed46 (diff) | |
parent | 5acbeb9666ca0534cb1a46d9ed1c9d26521500f2 (diff) | |
download | nextcloud-server-7f7cdecb1a070e1c691a343abe2be2cad0937a1e.tar.gz nextcloud-server-7f7cdecb1a070e1c691a343abe2be2cad0937a1e.zip |
Merge pull request #13741 from owncloud/autotest_improvements
Better config cleanup in autotest.sh
-rw-r--r-- | .gitignore | 2 | ||||
-rwxr-xr-x | autotest-external.sh | 18 | ||||
-rwxr-xr-x | autotest-hhvm.sh | 18 | ||||
-rwxr-xr-x | autotest.sh | 18 |
4 files changed, 32 insertions, 24 deletions
diff --git a/.gitignore b/.gitignore index 72e631fa7af..de467ec2cf9 100644 --- a/.gitignore +++ b/.gitignore @@ -109,3 +109,5 @@ Vagrantfile /tests/autotest* /tests/data/lorem-copy.txt /tests/data/testimage-copy.png +/config/config-autotest-backup.php +/config/autoconfig.php 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; diff --git a/autotest-hhvm.sh b/autotest-hhvm.sh index 4d8efa5a4b8..bf96a5133a6 100755 --- a/autotest-hhvm.sh +++ b/autotest-hhvm.sh @@ -66,20 +66,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 @@ -236,9 +241,6 @@ else execute_tests "$1" "$2" "$3" fi -cd "$BASEDIR" - -restore_config # # NOTES on mysql: # - CREATE DATABASE oc_autotest; diff --git a/autotest.sh b/autotest.sh index 7bb4c80cb9b..647012ea618 100755 --- a/autotest.sh +++ b/autotest.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 @@ -234,9 +239,6 @@ else execute_tests "$1" "$FILENAME" "$3" fi -cd "$BASEDIR" - -restore_config # # NOTES on mysql: # - CREATE DATABASE oc_autotest; |