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

Commit 2b3daa3

Browse filesBrowse files
authored
.kokoro: publish test log to Build Cop Bot (GoogleCloudPlatform#2775)
1 parent 272b61f commit 2b3daa3
Copy full SHA for 2b3daa3

File tree

Expand file treeCollapse file tree

1 file changed

+25
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+25
-0
lines changed

‎.kokoro/tests/run_tests.sh

Copy file name to clipboardExpand all lines: .kokoro/tests/run_tests.sh
+25Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,31 @@ for file in **/requirements.txt; do
100100
nox -s "$RUN_TESTS_SESSION"
101101
EXIT=$?
102102

103+
# If this is a continuous build, send the test log to the Build Cop Bot.
104+
# See https://github.com/googleapis/repo-automation-bots/tree/master/packages/buildcop.
105+
if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"continuous"* ]]; then
106+
XML=$(base64 -w 0 sponge_log.xml)
107+
108+
# See https://github.com/apps/build-cop-bot/installations/5943459.
109+
MESSAGE=$(cat <<EOF
110+
{
111+
"Name": "buildcop",
112+
"Type" : "function",
113+
"Location": "us-central1",
114+
"installation": {"id": "5943459"},
115+
"repo": "GoogleCloudPlatform/python-docs-samples",
116+
"buildID": "$KOKORO_GIT_COMMIT",
117+
"buildURL": "https://source.cloud.google.com/results/invocations/$KOKORO_BUILD_ID",
118+
"xunitXML": "$XML"
119+
}
120+
EOF
121+
)
122+
123+
# Use a service account with access to the repo-automation-bots project.
124+
gcloud auth activate-service-account --key-file $GOOGLE_APPLICATION_CREDENTIALS
125+
gcloud pubsub topics publish passthrough --project=repo-automation-bots --message="$MESSAGE"
126+
fi
127+
103128
if [[ $EXIT -ne 0 ]]; then
104129
RTN=1
105130
echo -e "\n Testing failed: Nox returned a non-zero exit code. \n"

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.