github.com/econnell/deis@v1.5.1/tests/bin/test-integration.sh (about) 1 #!/bin/bash 2 # 3 # Preps a test environment and runs `make test-integration` 4 # against artifacts produced from the current source tree 5 # 6 7 # fail on any command exiting non-zero 8 set -eo pipefail 9 10 # absolute path to current directory 11 export THIS_DIR=$(cd $(dirname $0); pwd) 12 13 # setup the test environment 14 source $THIS_DIR/test-setup.sh 15 16 # clean out vagrant environment 17 $THIS_DIR/halt-all-vagrants.sh 18 vagrant destroy --force 19 20 # setup callbacks on process exit and error 21 trap cleanup EXIT 22 trap dump_logs ERR 23 24 log_phase "Running style tests" 25 26 make test-style 27 28 log_phase "Running documentation tests" 29 30 # test building documentation 31 make -C docs/ test 32 33 log_phase "Running unit tests" 34 35 make test-unit 36 37 log_phase "Building from current source tree" 38 39 # build all docker images and client binaries 40 make build 41 42 # use the built client binaries 43 export PATH=$DEIS_ROOT/deisctl:$DEIS_ROOT/client/dist:$PATH 44 45 log_phase "Running functional tests" 46 47 make test-functional 48 49 log_phase "Provisioning 3-node CoreOS" 50 51 export DEIS_NUM_INSTANCES=3 52 make discovery-url 53 vagrant up --provider virtualbox 54 55 log_phase "Waiting for etcd/fleet" 56 57 # wait for etcd up to 5 minutes 58 WAIT_TIME=1 59 until deisctl --request-timeout=1 list >/dev/null 2>&1; do 60 (( WAIT_TIME += 1 )) 61 if [ $WAIT_TIME -gt 300 ]; then 62 log_phase "Timeout waiting for etcd/fleet" 63 # run deisctl one last time without eating the error, so we can see what's up 64 deisctl --request-timeout=1 list 65 exit 1; 66 fi 67 done 68 69 log_phase "etcd available after $WAIT_TIME seconds" 70 71 log_phase "Publishing release from source tree" 72 73 make dev-release 74 75 log_phase "Provisioning Deis" 76 77 # configure platform settings 78 deisctl config platform set domain=$DEIS_TEST_DOMAIN 79 deisctl config platform set sshPrivateKey=$DEIS_TEST_SSH_KEY 80 81 time deisctl install platform 82 time deisctl start platform 83 84 log_phase "Running integration suite" 85 86 time make test-integration