Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix flaky bot #1653

Merged
merged 1 commit into from Aug 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 15 additions & 4 deletions internal/kokoro/test.sh
Expand Up @@ -50,16 +50,27 @@ cd google-api-go-generator
go generate
cd ..

set +e # Run all tests, don't stop after the first failure.
exit_code=0

# Run tests and tee output to log file, to be pushed to GCS as artifact.
if [[ $KOKORO_JOB_NAME == *"continuous"* ]]; then
go test -race -v ./... 2>&1 | tee $KOKORO_ARTIFACTS_DIR/$KOKORO_GERRIT_CHANGE_NUMBER.txt
# Takes the kokoro output log (raw stdout) and creates a machine-parseable
# xUnit XML file.
cat $KOKORO_ARTIFACTS_DIR/$KOKORO_GERRIT_CHANGE_NUMBER.txt |
go-junit-report -set-exit-code >sponge_log.xml
exit_code=$($?)
else
go test -race -v -short ./... 2>&1 | tee $KOKORO_ARTIFACTS_DIR/$KOKORO_GERRIT_CHANGE_NUMBER.txt
exit_code=$($?)
fi

if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"continuous"* ]]; then
chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot
$KOKORO_GFILE_DIR/linux_amd64/flakybot -logs_dir=$GOCLOUD_HOME \
-repo=googleapis/google-api-go-client \
-commit_hash=$KOKORO_GITHUB_COMMIT_URL_google_api_go_client
chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot
$KOKORO_GFILE_DIR/linux_amd64/flakybot -logs_dir=$GOCLOUD_HOME \
-repo=googleapis/google-api-go-client \
-commit_hash=$KOKORO_GITHUB_COMMIT_URL_google_api_go_client
fi

exit $exit_code