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.

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