Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

.kokoro: publish test log to Build Cop Bot #2775

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

Merged
merged 7 commits into from
Feb 10, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions 25 .kokoro/tests/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,31 @@ for file in **/requirements.txt; do
nox -s "$RUN_TESTS_SESSION"
EXIT=$?

# If this is a continuous build, send the test log to the Build Cop Bot.
# See https://github.com/googleapis/repo-automation-bots/tree/master/packages/buildcop.
if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"continuous"* ]]; then
XML=$(base64 -w 0 sponge_log.xml)

# See https://github.com/apps/build-cop-bot/installations/5943459.
MESSAGE=$(cat <<EOF
{
"Name": "buildcop",
"Type" : "function",
"Location": "us-central1",
"installation": {"id": "5943459"},
"repo": "GoogleCloudPlatform/python-docs-samples",
"buildID": "$KOKORO_GIT_COMMIT",
"buildURL": "https://source.cloud.google.com/results/invocations/$KOKORO_BUILD_ID",
"xunitXML": "$XML"
}
EOF
)

# Use a service account with access to the repo-automation-bots project.
gcloud auth activate-service-account --key-file $GOOGLE_APPLICATION_CREDENTIALS
gcloud pubsub topics publish passthrough --project=repo-automation-bots --message="$MESSAGE"
fi

if [[ $EXIT -ne 0 ]]; then
RTN=1
echo -e "\n Testing failed: Nox returned a non-zero exit code. \n"
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.