1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/mattermost_ynh.git synced 2024-09-03 19:36:29 +02:00

test: remove snapshotting feature

This commit is contained in:
Pierre de La Morinerie 2017-10-24 07:57:06 +00:00
parent e4710188d6
commit 223e9efad8

29
test.sh
View file

@ -1,8 +1,5 @@
#!/bin/bash #!/bin/bash
# Run tests against Mattermost installation on a Vagrant virtual machine. # Run package_check tests against the app in the working directory on a Vagrant virtual machine.
#
# The VM is provisioned with a fresh Yunohost install, then snapshotted
# for subsequent runs.
# Fail on first error # Fail on first error
set -e set -e
@ -15,24 +12,20 @@ VM_ROOT_PASSWORD="alpine"
YUNOHOST_ADMIN_PASSWORD="alpine" YUNOHOST_ADMIN_PASSWORD="alpine"
function _usage() { function _usage() {
echo "Run tests against ${APP_NAME} installation on a Vagrant virtual machine." echo "Run package_check tests against the app in the working directory on a Vagrant virtual machine."
echo "Usage: test.sh [--skip-snapshot] [--verbose] [--help]" echo "Usage: test.sh [--verbose] [--help]"
} }
# Configuration arguments # Configuration arguments
function _parse_args() { function _parse_args() {
VERBOSE=false VERBOSE=false
VERBOSE_OPT='' VERBOSE_OPT=''
SKIP_SNAPSHOT=false
while [ "$1" != "" ]; do while [ "$1" != "" ]; do
case $1 in case $1 in
"-v" | "--verbose") "-v" | "--verbose")
shift shift
VERBOSE=true VERBOSE=true
VERBOSE_OPT='--verbose';; VERBOSE_OPT='--verbose';;
"-s" | "--skip-snapshot")
shift
SKIP_SNAPSHOT=true;;
"--help") "--help")
_usage _usage
exit;; exit;;
@ -58,22 +51,8 @@ function _vagrant_ssh() {
} }
function setup() { function setup() {
if $SKIP_SNAPSHOT; then echo "--- Setting up Vagrant VM ---"
echo "--- Starting Vagrant box ---"
vagrant up --no-provision
echo "--- (Skipping snapshot restore) ---"
return
fi
if (vagrant snapshot list | grep 'yunohost-jessie-pristine' > /dev/null); then
echo "--- Restoring Vagrant snapshot ---"
vagrant snapshot restore yunohost-jessie-pristine
else
echo "--- Provisioning Vagrant box ---"
vagrant up --provision vagrant up --provision
echo "--- Saving Vagrant snapshot ---"
vagrant snapshot save yunohost-jessie-pristine
fi
} }
function test_package_check() { function test_package_check() {