From aad647376df2f2c2b7cd8b452d534d200a46d9f4 Mon Sep 17 00:00:00 2001 From: varac Date: Thu, 22 Oct 2015 19:28:47 +0000 Subject: minor fixes --- leap-platform-test | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/leap-platform-test b/leap-platform-test index da086ed..eb5a79d 100755 --- a/leap-platform-test +++ b/leap-platform-test @@ -183,6 +183,7 @@ deploy() { if [ -s "$ERRLOG1" ] then touch $FAILURE_LOCKFILE + global_deploy_failure=true returncode=1 versions=$( versions ) subj="WARNING - \"leap deploy\" of platform $PLATFORM_BRANCH branch on \"$vm\" had errors !" @@ -268,7 +269,6 @@ init_deploy() { #. run bootstrap_nodes (this will: start vm, run init, run a limited tag # deploy, then reset the node) #. deploy the nodes - #. run tests #. send email @@ -301,14 +301,13 @@ init_deploy() { echo "Waiting until last deploy process has finished..." wait - # send mail if deployment fails - deploy_failure_email - - # run tests - run_tests + if $global_deploy_failure + then + deploy_failure_email + returncode=1 + fi + return $returncode - # send mail if tests fail - test_failure_email } reset_deploy() { @@ -353,7 +352,7 @@ reset_deploy() { echo "Waiting until last deploy process has finished..." wait - if [ -e "$FAILURE_LOCKFILE" ] + if $global_deploy_failure then deploy_failure_email returncode=1 @@ -401,7 +400,7 @@ destroy_deploy() { echo "Waiting until last deploy process has finished..." wait - if [ -e "$FAILURE_LOCKFILE" ] + if $global_deploy_failure then deploy_failure_email returncode=1 @@ -421,8 +420,17 @@ run_tests () { echo -e "\nRunning leap test on $date" | tee -a "$TEST_LOG1" "$TEST_LOG2" - $LEAP_CMD $OPTS test --continue 2>&1 | ts | egrep -v "$TEST_FILTER" | tee -a "$TEST_LOG1" "$TEST_LOG2" - test_failure=${PIPESTATUS[0]} + + if $verbose + then + #$LEAP_CMD $OPTS -v 2 deploy "$vm" 2>&1 | tee -a "$LOG1" "$LOG2" + $LEAP_CMD $OPTS test --continue 2>&1 | tee -a "$TEST_LOG1" "$TEST_LOG2" + test_failure=${PIPESTATUS[0]} + egrep -v "$TEST_FILTER" $TEST_LOG2 | tee -a "$TEST_LOG1" "$TEST_LOG2" + else + $LEAP_CMD $OPTS test --continue 2>&1 | egrep -v "$TEST_FILTER" | tee -a "$TEST_LOG1" "$TEST_LOG2" + test_failure=${PIPESTATUS[0]} + fi if [ "$test_failure" -ne 0 ] then @@ -498,14 +506,14 @@ wait_for_node() { # http://docs.vagrantup.com/v2/providers/default.html export VAGRANT_DEFAULT_PROVIDER="libvirt" - - config="" all=false verbose=false print_versions=false # default in lib/leap_cli/leapfile.rb IP_PREFIX='10.5.5' +global_deploy_failure=false + if ! options=$(getopt -o avVlc:h -l all,lock,verbose,versions,config:,help -- "$@") then -- cgit v1.2.3