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.
 
 
 

48 lines
1.1 KiB

  1. #!/bin/bash
  2. # TODO(deklerk) Add integration tests when it's secure to do so. b/64723143
  3. # Fail on any error
  4. set -eo pipefail
  5. # Display commands being run
  6. set -x
  7. # cd to project dir on Kokoro instance
  8. cd github/gax-go
  9. go version
  10. # Set $GOPATH
  11. export GOPATH="$HOME/go"
  12. export GAX_HOME=$GOPATH/src/github.com/googleapis/gax-go
  13. export PATH="$GOPATH/bin:$PATH"
  14. mkdir -p $GAX_HOME
  15. # Move code into $GOPATH and get dependencies
  16. git clone . $GAX_HOME
  17. cd $GAX_HOME
  18. try3() { eval "$*" || eval "$*" || eval "$*"; }
  19. download_deps() {
  20. if [[ `go version` == *"go1.11"* ]] || [[ `go version` == *"go1.12"* ]]; then
  21. export GO111MODULE=on
  22. # All packages, including +build tools, are fetched.
  23. try3 go mod download
  24. else
  25. # Because we don't provide -tags tools, the +build tools
  26. # dependencies aren't fetched.
  27. try3 go get -v -t ./...
  28. fi
  29. }
  30. download_deps
  31. ./internal/kokoro/check_incompat_changes.sh
  32. ./internal/kokoro/vet.sh
  33. go test -race -v . 2>&1 | tee $KOKORO_ARTIFACTS_DIR/$KOKORO_GERRIT_CHANGE_NUMBER.txt
  34. cd v2
  35. download_deps
  36. go test -race -v . 2>&1 | tee $KOKORO_ARTIFACTS_DIR/$KOKORO_GERRIT_CHANGE_NUMBER.txt