github.com/go-graphite/carbonapi@v0.17.0/e2e_test.sh (about) 1 #!/usr/bin/env bash 2 3 TESTS=$(ls cmd/mockbackend/testcases/) 4 5 OPTIONS="" 6 if [[ "$1" == "-break" ]]; then 7 OPTIONS="${OPTIONS} -break" 8 shift 9 fi 10 11 if [[ ! -z "${1}" ]]; then 12 TESTS="${1}" 13 fi 14 15 FAILED_TESTS="" 16 for t in ${TESTS}; do 17 if [[ "${TRAVIS}" == "true" ]]; then 18 travis_fold start "test_${t}" 19 travis_time_start 20 fi 21 22 echo "RUNNING TEST ${t}" 23 ./mockbackend ${OPTIONS} -test -config cmd/mockbackend/testcases/${t}/${t}.yaml 24 status=$? 25 26 if [[ "${TRAVIS}" == "true" ]]; then 27 travis_time_finish 28 travis_fold end "test_${t}" 29 fi 30 31 sleep 2 32 if [[ ${status} -ne 0 ]]; then 33 FAILED_TESTS="${FAILED_TESTS} ${t}" 34 echo "test_${t}: FAIL" 35 else 36 echo "test_${t}: SUCCESS" 37 fi 38 done 39 40 if [[ ! -z ${FAILED_TESTS} ]]; then 41 echo "Some e2e tests failed: ${FAILED_TESTS}" 42 exit 1 43 fi