Skip to content

Commit 4fd3439

Browse files
authored
chore: fix flaky bot (#1653)
1 parent a90d802 commit 4fd3439

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

internal/kokoro/test.sh

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,27 @@ cd google-api-go-generator
5050
go generate
5151
cd ..
5252

53+
set +e # Run all tests, don't stop after the first failure.
54+
exit_code=0
55+
5356
# Run tests and tee output to log file, to be pushed to GCS as artifact.
5457
if [[ $KOKORO_JOB_NAME == *"continuous"* ]]; then
5558
go test -race -v ./... 2>&1 | tee $KOKORO_ARTIFACTS_DIR/$KOKORO_GERRIT_CHANGE_NUMBER.txt
59+
# Takes the kokoro output log (raw stdout) and creates a machine-parseable
60+
# xUnit XML file.
61+
cat $KOKORO_ARTIFACTS_DIR/$KOKORO_GERRIT_CHANGE_NUMBER.txt |
62+
go-junit-report -set-exit-code >sponge_log.xml
63+
exit_code=$($?)
5664
else
5765
go test -race -v -short ./... 2>&1 | tee $KOKORO_ARTIFACTS_DIR/$KOKORO_GERRIT_CHANGE_NUMBER.txt
66+
exit_code=$($?)
5867
fi
5968

6069
if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"continuous"* ]]; then
61-
chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot
62-
$KOKORO_GFILE_DIR/linux_amd64/flakybot -logs_dir=$GOCLOUD_HOME \
63-
-repo=googleapis/google-api-go-client \
64-
-commit_hash=$KOKORO_GITHUB_COMMIT_URL_google_api_go_client
70+
chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot
71+
$KOKORO_GFILE_DIR/linux_amd64/flakybot -logs_dir=$GOCLOUD_HOME \
72+
-repo=googleapis/google-api-go-client \
73+
-commit_hash=$KOKORO_GITHUB_COMMIT_URL_google_api_go_client
6574
fi
75+
76+
exit $exit_code

0 commit comments

Comments
 (0)