Skip to content

Commit

Permalink
Produce Sponge-compatible test result output.
Browse files Browse the repository at this point in the history
Change-Id: I60883797af75c8e680324c386ded31c47e2e9cc3
Reviewed-on: https://code-review.googlesource.com/c/37991
Reviewed-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jean de Klerk <deklerk@google.com>
  • Loading branch information
aalexand committed Feb 6, 2019
1 parent c9474f2 commit a44d1ad
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 2 deletions.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ require (
github.com/google/martian v2.1.0+incompatible
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57
github.com/googleapis/gax-go/v2 v2.0.3
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024
go.opencensus.io v0.18.0
golang.org/x/build v0.0.0-20190111050920-041ab4dc3f9d
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORR
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw=
github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024 h1:rBMNdlhTLzJjJSDIjNEXX1Pz3Hmwmz91v+zycvx9PJc=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
Expand Down
10 changes: 9 additions & 1 deletion internal/kokoro/continuous.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,13 @@ fi

./internal/kokoro/vet.sh

# TODO(deklerk): Remove once tools are installed via tools.go.
go get github.com/jstemmer/go-junit-report

# Run tests and tee output to log file, to be pushed to GCS as artifact.
go test -race -v -timeout 30m ./... 2>&1 | tee $KOKORO_ARTIFACTS_DIR/$KOKORO_GERRIT_CHANGE_NUMBER.txt
# Also generate test summary in xUnit format to summarize the test execution.
mkdir $KOKORO_ARTIFACTS_DIR/tests
go test -race -v -timeout 30m ./... 2>&1 \
| tee $KOKORO_ARTIFACTS_DIR/$KOKORO_GERRIT_CHANGE_NUMBER.txt \
| go-junit-report >$KOKORO_ARTIFACTS_DIR/tests/sponge_log.xml

10 changes: 9 additions & 1 deletion internal/kokoro/presubmit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,13 @@ fi

./internal/kokoro/vet.sh

# TODO(deklerk): Remove once tools are installed via tools.go.
go get github.com/jstemmer/go-junit-report

# Run tests and tee output to log file, to be pushed to GCS as artifact.
go test -race -v -timeout 15m -short ./... 2>&1 | tee $KOKORO_ARTIFACTS_DIR/$KOKORO_GERRIT_CHANGE_NUMBER.txt
# Also generate test summary in xUnit format to summarize the test execution.
mkdir $KOKORO_ARTIFACTS_DIR/tests
go test -race -v -timeout 15m -short ./... 2>&1 \
| tee $KOKORO_ARTIFACTS_DIR/$KOKORO_GERRIT_CHANGE_NUMBER.txt \
| go-junit-report >$KOKORO_ARTIFACTS_DIR/tests/sponge_log.xml

1 change: 1 addition & 0 deletions tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ package cloud

import (
_ "github.com/golang/protobuf/protoc-gen-go"
_ "github.com/jstemmer/go-junit-report"
_ "golang.org/x/lint/golint"
_ "golang.org/x/tools/cmd/goimports"
_ "honnef.co/go/tools/cmd/staticcheck"
Expand Down

0 comments on commit a44d1ad

Please sign in to comment.