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.

47 lines
1.5 KiB

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