test.sh 582 B

1234567891011121314151617181920
  1. #! /bin/sh
  2. starttest() {
  3. set -e
  4. GO111MODULE=on go test -race ./...
  5. }
  6. if [ -z "${TEAMCITY_VERSION}" ]; then
  7. # running locally, so start test in a container
  8. # TEAMCITY_VERSION=local will avoid recursive calls, when it would be running in container
  9. docker run --rm --name ristretto-test -ti \
  10. -v `pwd`:/go/src/github.com/dgraph-io/ristretto \
  11. --workdir /go/src/github.com/dgraph-io/ristretto \
  12. --env TEAMCITY_VERSION=local \
  13. golang:1.13 \
  14. sh test.sh
  15. else
  16. # running in teamcity, since teamcity itself run this in container, let's simply run this
  17. starttest
  18. fi