Skip to content

Commit

Permalink
internal/kokoro: don't use GOPATH, send logs to Build Cop Bot
Browse files Browse the repository at this point in the history
  • Loading branch information
tbpg committed Mar 24, 2020
1 parent b443e5a commit 5a082ae
Showing 1 changed file with 25 additions and 8 deletions.
33 changes: 25 additions & 8 deletions internal/kokoro/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,39 @@ go version

# Set $GOPATH
export GOPATH="$HOME/go"
export GAX_HOME=$GOPATH/src/github.com/googleapis/gax-go
export PATH="$GOPATH/bin:$PATH"
export GO111MODULE=on
mkdir -p $GAX_HOME

# Move code into $GOPATH and get dependencies
git clone . $GAX_HOME
cd $GAX_HOME

try3() { eval "$*" || eval "$*" || eval "$*"; }

# All packages, including +build tools, are fetched.
try3 go mod download
./internal/kokoro/vet.sh
go test -race -v . 2>&1 | tee $KOKORO_ARTIFACTS_DIR/$KOKORO_GERRIT_CHANGE_NUMBER.txt

go get github.com/jstemmer/go-junit-report

set +e

go test -race -v . 2>&1 | tee sponge_log.log
cat sponge_log.log | go-junit-report -set-exit-code > sponge_log.xml
exit_code=$?

cd v2
set -e
try3 go mod download
go test -race -v . 2>&1 | tee $KOKORO_ARTIFACTS_DIR/$KOKORO_GERRIT_CHANGE_NUMBER.txt
set +e

go test -race -v . 2>&1 | tee sponge_log.log
cat sponge_log.log | go-junit-report -set-exit-code > sponge_log.xml
exit_code=$(($exit_code+$?))

# Send logs to the Build Cop Bot for continuous builds.
# TODO: uncomment when this works for the PR.
# if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"continuous"* ]]; then
cd ..
chmod +x $KOKORO_GFILE_DIR/linux_amd64/buildcop
$KOKORO_GFILE_DIR/linux_amd64/buildcop \
-repo=googleapis/gax-go # TODO delete after PR.
# fi

exit $exit_code

0 comments on commit 5a082ae

Please sign in to comment.