Skip to content
This repository was archived by the owner on Dec 31, 2023. It is now read-only.

Commit 01746a2

Browse files
committed
build: make sure flakybot runs on failures
1 parent a431aec commit 01746a2

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

.kokoro/build.sh

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,20 @@ python3.6 -m pip uninstall --yes --quiet nox-automation
3636
python3.6 -m pip install --upgrade --quiet nox
3737
python3.6 -m nox --version
3838

39+
# If this is a continuous build, send the test log to the FlakyBot.
40+
# See https://github.com/googleapis/repo-automation-bots/tree/master/packages/flakybot.
41+
if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"continuous"* ]]; then
42+
cleanup() {
43+
chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot
44+
$KOKORO_GFILE_DIR/linux_amd64/flakybot
45+
}
46+
trap cleanup EXIT HUP
47+
fi
48+
3949
# If NOX_SESSION is set, it only runs the specified session,
4050
# otherwise run all the sessions.
4151
if [[ -n "${NOX_SESSION:-}" ]]; then
4252
python3.6 -m nox -s "${NOX_SESSION:-}"
4353
else
4454
python3.6 -m nox
45-
fi
46-
47-
# If this is a continuous build, send the test log to the FlakyBot.
48-
# See https://github.com/googleapis/repo-automation-bots/tree/master/packages/flakybot.
49-
if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"continuous"* ]]; then
50-
chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot
51-
$KOKORO_GFILE_DIR/linux_amd64/flakybot
5255
fi

0 commit comments

Comments
 (0)