github.com/rvaralda/deis@v1.4.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 # setup callbacks on process exit and error 17 trap cleanup EXIT 18 trap dump_logs ERR 19 20 log_phase "Running style tests" 21 22 make test-style 23 24 log_phase "Running documentation tests" 25 26 # test building documentation 27 make -C docs/ test 28 29 log_phase "Running unit tests" 30 31 make test-unit 32 33 log_phase "Building from current source tree" 34 35 # build all docker images and client binaries 36 make build 37 38 # use the built client binaries 39 export PATH=$DEIS_ROOT/deisctl:$DEIS_ROOT/client/dist:$PATH 40 41 log_phase "Running functional tests" 42 43 make test-functional 44 45 log_phase "Provisioning 3-node CoreOS" 46 47 export DEIS_NUM_INSTANCES=3 48 make discovery-url 49 vagrant up --provider virtualbox 50 51 log_phase "Waiting for etcd/fleet" 52 53 # wait for etcd up to 5 minutes 54 WAIT_TIME=1 55 until deisctl --request-timeout=1 list >/dev/null 2>&1; do 56 (( WAIT_TIME += 1 )) 57 if [ $WAIT_TIME -gt 300 ]; then 58 log_phase "Timeout waiting for etcd/fleet" 59 # run deisctl one last time without eating the error, so we can see what's up 60 deisctl --request-timeout=1 list 61 exit 1; 62 fi 63 done 64 65 log_phase "etcd available after $WAIT_TIME seconds" 66 67 log_phase "Publishing release from source tree" 68 69 make dev-release 70 71 log_phase "Provisioning Deis" 72 73 # configure platform settings 74 deisctl config platform set domain=$DEIS_TEST_DOMAIN 75 deisctl config platform set sshPrivateKey=$DEIS_TEST_SSH_KEY 76 77 time deisctl install platform 78 time deisctl start platform 79 80 log_phase "Running integration suite" 81 82 time make test-integration