Content-Length: 362111 | pFad | https://github.com/googleapis/synthtool/commit/d17674372e27fb8f23013935e794aa37502071aa

BD build(python): enable flakybot on library unit and system tests (#950) · googleapis/synthtool@d176743 · GitHub
Skip to content

Commit d176743

Browse files
authored
build(python): enable flakybot on library unit and system tests (#950)
1 parent 0973d57 commit d176743

File tree

3 files changed

+28
-3
lines changed

3 files changed

+28
-3
lines changed

synthtool/gcp/templates/python_library/.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

synthtool/gcp/templates/python_library/.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

synthtool/gcp/templates/python_library/noxfile.py.j2

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ def default(session):
108108
session.run(
109109
"py.test",
110110
"--quiet",
111+
f"--junitxml=unit_{session.python}_sponge_log.xml",
111112
"--cov=google/cloud",
112113
"--cov=tests/unit",
113114
"--cov-append",
@@ -169,9 +170,21 @@ def system(session):
169170

170171
# Run py.test against the system tests.
171172
if system_test_exists:
172-
session.run("py.test", "--quiet", system_test_path, *session.posargs)
173+
session.run(
174+
"py.test",
175+
"--quiet",
176+
f"--junitxml=system_{session.python}_sponge_log.xml",
177+
system_test_path,
178+
*session.posargs
179+
)
173180
if system_test_folder_exists:
174-
session.run("py.test", "--quiet", system_test_folder_path, *session.posargs)
181+
session.run(
182+
"py.test",
183+
"--quiet",
184+
f"--junitxml=system_{session.python}_sponge_log.xml",
185+
system_test_folder_path,
186+
*session.posargs
187+
)
175188

176189
{% if samples_test %}
177190
@nox.session(python=["2.7", "3.7"])

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/googleapis/synthtool/commit/d17674372e27fb8f23013935e794aa37502071aa

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy