1515
1616set -eo pipefail
1717
18- cd github/google-cloudevents-python
18+ if [[ -z " ${PROJECT_ROOT:- } " ]]; then
19+ PROJECT_ROOT=" github/google-cloudevents-python"
20+ fi
21+
22+ cd " ${PROJECT_ROOT} "
1923
2024# Disable buffering, so that the logs stream through.
2125export PYTHONUNBUFFERED=1
@@ -30,16 +34,26 @@ export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/service-account.json
3034export PROJECT_ID=$( cat " ${KOKORO_GFILE_DIR} /project-id.json" )
3135
3236# Remove old nox
33- python3.6 -m pip uninstall --yes --quiet nox-automation
37+ python3 -m pip uninstall --yes --quiet nox-automation
3438
3539# Install nox
36- python3.6 -m pip install --upgrade --quiet nox
37- python3.6 -m nox --version
40+ python3 -m pip install --upgrade --quiet nox
41+ python3 -m nox --version
42+
43+ # If this is a continuous build, send the test log to the FlakyBot.
44+ # See https://github.com/googleapis/repo-automation-bots/tree/master/packages/flakybot.
45+ if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = * " continuous" * ]]; then
46+ cleanup () {
47+ chmod +x $KOKORO_GFILE_DIR /linux_amd64/flakybot
48+ $KOKORO_GFILE_DIR /linux_amd64/flakybot
49+ }
50+ trap cleanup EXIT HUP
51+ fi
3852
3953# If NOX_SESSION is set, it only runs the specified session,
4054# otherwise run all the sessions.
4155if [[ -n " ${NOX_SESSION:- } " ]]; then
42- python3.6 -m nox -s " ${NOX_SESSION:- } "
56+ python3 -m nox -s ${NOX_SESSION:- }
4357else
44- python3.6 -m nox
58+ python3 -m nox
4559fi
0 commit comments