You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.8 KiB

8 years ago
8 years ago
8 years ago
  1. #! /bin/bash
  2. set -eu
  3. # Get the directory of where this script is.
  4. SOURCE="${BASH_SOURCE[0]}"
  5. while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done
  6. DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
  7. LOGS_DIR="$DIR/logs"
  8. echo
  9. echo "* [$(date +"%T")] cleaning up $LOGS_DIR"
  10. rm -rf "$LOGS_DIR"
  11. mkdir -p "$LOGS_DIR"
  12. set +e
  13. echo
  14. echo "* [$(date +"%T")] removing run_test container"
  15. docker rm -vf run_test
  16. set -e
  17. set +u
  18. if [[ "$CIRCLECI" == true ]]; then
  19. echo
  20. echo "* [$(date +"%T")] starting rsyslog container"
  21. docker rm -f rsyslog || true
  22. docker run -d -v "$LOGS_DIR:/var/log/" -p 127.0.0.1:5514:514/udp --name rsyslog voxxit/rsyslog
  23. fi
  24. if [[ "$SKIP_BUILD" == "" ]]; then
  25. echo
  26. echo "* [$(date +"%T")] building docker image"
  27. bash "$DIR/docker/build.sh"
  28. fi
  29. echo
  30. echo "* [$(date +"%T")] running go tests and app tests in docker container"
  31. # sometimes its helpful to mount the local test folder
  32. # -v $DIR:/go/src/github.com/tendermint/tendermint/test
  33. if [[ "$CIRCLECI" == true ]]; then
  34. docker run --name run_test -e CIRCLECI=true -t tester bash test/run_test.sh
  35. else
  36. docker run --name run_test -t tester bash test/run_test.sh
  37. fi
  38. # copy the coverage results out of docker container
  39. docker cp run_test:/go/src/github.com/tendermint/tendermint/coverage.txt .
  40. # test basic network connectivity
  41. # by starting a local testnet and checking peers connect and make blocks
  42. echo
  43. echo "* [$(date +"%T")] running p2p tests on a local docker network"
  44. bash "$DIR/p2p/test.sh" tester
  45. # only run the cloud benchmark for releases
  46. BRANCH=$(git rev-parse --abbrev-ref HEAD)
  47. if [[ $(echo "$BRANCH" | grep "release-") != "" ]]; then
  48. echo
  49. echo "TODO: run network tests"
  50. #echo "* branch $BRANCH; running mintnet/netmon throughput benchmark"
  51. # TODO: replace mintnet
  52. #bash "$DIR/net/test.sh"
  53. fi