1
0
Fork 0
mirror of https://github.com/Luzifer/nginx-sso.git synced 2024-10-18 15:44:21 +00:00
nginx-sso/vendor/google.golang.org/genproto/internal/kokoro/test.sh
Knut Ahlers 9b3c895c04
Update dependencies
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2019-04-22 06:44:07 +02:00

43 lines
1.1 KiB
Bash
Executable file

#!/bin/bash
# Fail on any error
set -eo pipefail
# Display commands being run
set -x
# cd to project dir on Kokoro instance
cd github/go-genproto
go version
# Set $GOPATH
export GOPATH="$HOME/go"
export GENPROTO_HOME=$GOPATH/src/google.golang.org/genproto
export PATH="$GOPATH/bin:$PATH"
mkdir -p $GENPROTO_HOME
# Move code into $GOPATH and get dependencies
git clone . $GENPROTO_HOME
cd $GENPROTO_HOME
try3() { eval "$*" || eval "$*" || eval "$*"; }
download_deps() {
if [[ `go version` == *"go1.11"* ]] || [[ `go version` == *"go1.12"* ]]; then
export GO111MODULE=on
# All packages, including +build tools, are fetched.
try3 go mod download
else
# Because we don't provide -tags tools, the +build tools
# dependencies aren't fetched.
try3 go get -v -t ./...
fi
}
download_deps
./internal/kokoro/vet.sh
./internal/kokoro/check_incompat_changes.sh
# Run tests and tee output to log file, to be pushed to GCS as artifact.
go test -race -v ./... 2>&1 | tee $KOKORO_ARTIFACTS_DIR/$KOKORO_GERRIT_CHANGE_NUMBER.txt