From 275e499e3c72fe133dd5ad0942966d6016be120a Mon Sep 17 00:00:00 2001 From: Jacob ZAK Date: Mon, 28 Sep 2015 20:54:39 +0000 Subject: [PATCH] chore(jenkins): add a script to run jenkins tests --- utils/jenkins-tests.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 utils/jenkins-tests.sh diff --git a/utils/jenkins-tests.sh b/utils/jenkins-tests.sh new file mode 100755 index 0000000..61ee7d0 --- /dev/null +++ b/utils/jenkins-tests.sh @@ -0,0 +1,34 @@ +#!/bin/bash +set -o errexit +set -o pipefail + +# This script is used by jenkins. + +function help() { + echo "You need to define BEURK_VM_NAME and BEURK_VM_PORT environnements variables +before running this script." + exit 1 +} + +[ -z "$BEURK_VM_NAME" ] && help +[ -z "$BEURK_VM_PORT" ] && help + +# Go to the root of the project +cd /home/vagrant/project/beurk + +# Disinfect the VM +sudo kill `ps -ef | grep "python -m SimpleHTTPServer 3005" | grep -v "grep" | awk -F ' +' '{print $2}'`; +sudo make disinfect && sudo make distclean + +# Run the integration tests +./utils/run-tests.sh tests/quick + +# Infect the VM +make re && sudo make infect +nohup -- python -m SimpleHTTPServer 3005 & + +# Run the functional tests +./utils/run-tests.sh tests/functional + +# Yeah!!!! +exit 0