Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e269f23

Browse files
author
ace-n
committed
Add support for kokoro-lite
1 parent e5048c8 commit e269f23

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

.kokoro/tests/run_tests.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,20 @@ if [[ $* == *--only-diff-head* ]]; then
5151
fi
5252
fi
5353

54+
# Only run Python 2.7 if the PR in question has a `kokoro-lite` label
55+
if [[ ! -z $KOKORO_GITHUB_PULL_REQUEST_NUMBER ]]; then
56+
curl -s "https://api.github.com/repos/GoogleCloudPlatform/python-docs-samples/pulls/$KOKORO_GITHUB_PULL_REQUEST_NUMBER" \
57+
| grep "kokoro:lite" > /dev/null
58+
if [[ $? -eq 0 ]]; then # && [[ "${RUN_TESTS_SESSION}" != "py-2.7" ]]; then
59+
# Skip this build
60+
echo "This build is being skipped!"
61+
echo " GitHub PRs with the 'kokoro:lite'"
62+
echo " label are ONLY tested in Python 2.7"
63+
64+
exit 1
65+
fi
66+
fi
67+
5468
# Because Kokoro runs presubmit builds simalteneously, we often see
5569
# quota related errors. I think we can avoid this by changing the
5670
# order of tests to execute (e.g. reverse order for py-3.8

0 commit comments

Comments
 (0)