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.

60 lines
1.7 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. echo
  18. echo "* [$(date +"%T")] starting rsyslog container"
  19. docker rm -f rsyslog || true
  20. docker run -d -v "$LOGS_DIR:/var/log/" -p 127.0.0.1:5514:514/udp --name rsyslog voxxit/rsyslog
  21. set +u
  22. if [[ "$SKIP_BUILD" == "" ]]; then
  23. echo
  24. echo "* [$(date +"%T")] building docker image"
  25. bash "$DIR/docker/build.sh"
  26. fi
  27. echo
  28. echo "* [$(date +"%T")] running go tests and app tests in docker container"
  29. # sometimes its helpful to mount the local test folder
  30. # -v $DIR:/go/src/github.com/tendermint/tendermint/test
  31. if [[ "$CIRCLECI" == true ]]; then
  32. docker run --name run_test -e CIRCLECI=true -t tester bash test/run_test.sh
  33. else
  34. docker run --name run_test -t tester bash test/run_test.sh
  35. fi
  36. # copy the coverage results out of docker container
  37. docker cp run_test:/go/src/github.com/tendermint/tendermint/coverage.txt .
  38. # test basic network connectivity
  39. # by starting a local testnet and checking peers connect and make blocks
  40. echo
  41. echo "* [$(date +"%T")] running p2p tests on a local docker network"
  42. bash "$DIR/p2p/test.sh" tester
  43. # only run the cloud benchmark for releases
  44. BRANCH=$(git rev-parse --abbrev-ref HEAD)
  45. if [[ $(echo "$BRANCH" | grep "release-") != "" ]]; then
  46. echo
  47. echo "TODO: run network tests"
  48. #echo "* branch $BRANCH; running mintnet/netmon throughput benchmark"
  49. # TODO: replace mintnet
  50. #bash "$DIR/net/test.sh"
  51. fi