Skip to content
This repository was archived by the owner on Nov 12, 2025. It is now read-only.

Commit c0e3639

Browse files
build(python): enable flakybot on library unit and system tests (#143)
Source-Author: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com> Source-Date: Wed Feb 17 14:10:46 2021 -0700 Source-Repo: googleapis/synthtool Source-Sha: d17674372e27fb8f23013935e794aa37502071aa Source-Link: googleapis/synthtool@d176743
1 parent 7ac4df6 commit c0e3639

4 files changed

Lines changed: 31 additions & 13 deletions

File tree

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,10 @@ docs.metadata
5050

5151
# Virtual environment
5252
env/
53+
54+
# Test logs
5355
coverage.xml
54-
sponge_log.xml
56+
*sponge_log.xml
5557

5658
# System test environment variables.
5759
system_tests/local_test_setup

.kokoro/build.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,16 @@ python3 -m pip uninstall --yes --quiet nox-automation
4040
python3 -m pip install --upgrade --quiet nox
4141
python3 -m nox --version
4242

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
52+
4353
# If NOX_SESSION is set, it only runs the specified session,
4454
# otherwise run all the sessions.
4555
if [[ -n "${NOX_SESSION:-}" ]]; then

noxfile.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ def default(session):
9393
session.run(
9494
"py.test",
9595
"--quiet",
96+
f"--junitxml=unit_{session.python}_sponge_log.xml",
9697
"--cov=google/cloud",
9798
"--cov=tests/unit",
9899
"--cov-append",
@@ -139,9 +140,21 @@ def system(session):
139140

140141
# Run py.test against the system tests.
141142
if system_test_exists:
142-
session.run("py.test", "--quiet", system_test_path, *session.posargs)
143+
session.run(
144+
"py.test",
145+
"--quiet",
146+
f"--junitxml=system_{session.python}_sponge_log.xml",
147+
system_test_path,
148+
*session.posargs,
149+
)
143150
if system_test_folder_exists:
144-
session.run("py.test", "--quiet", system_test_folder_path, *session.posargs)
151+
session.run(
152+
"py.test",
153+
"--quiet",
154+
f"--junitxml=system_{session.python}_sponge_log.xml",
155+
system_test_folder_path,
156+
*session.posargs,
157+
)
145158

146159

147160
@nox.session(python=DEFAULT_PYTHON_VERSION)

synth.metadata

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"git": {
55
"name": ".",
66
"remote": "https://github.com/googleapis/python-bigquery-storage.git",
7-
"sha": "aae07119fe7f9c86029debda456191a4f23c3850"
7+
"sha": "7ac4df6b4c484768dc66e0afdc2cb658f0bb8a3d"
88
}
99
},
1010
{
@@ -19,21 +19,14 @@
1919
"git": {
2020
"name": "synthtool",
2121
"remote": "https://github.com/googleapis/synthtool.git",
22-
"sha": "4679e7e415221f03ff2a71e3ffad75b9ec41d87e"
22+
"sha": "d17674372e27fb8f23013935e794aa37502071aa"
2323
}
2424
},
2525
{
2626
"git": {
2727
"name": "synthtool",
2828
"remote": "https://github.com/googleapis/synthtool.git",
29-
"sha": "4679e7e415221f03ff2a71e3ffad75b9ec41d87e"
30-
}
31-
},
32-
{
33-
"git": {
34-
"name": "synthtool",
35-
"remote": "https://github.com/googleapis/synthtool.git",
36-
"sha": "d1bb9173100f62c0cfc8f3138b62241e7f47ca6a"
29+
"sha": "d17674372e27fb8f23013935e794aa37502071aa"
3730
}
3831
}
3932
],

0 commit comments

Comments
 (0)