Skip to content

Commit

Permalink
build(python): enable flakybot on library unit and system tests (#107)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
yoshi-automation authored Feb 22, 2021
1 parent 7fcf1e7 commit 5dbdd58
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 6 deletions.
4 changes: 3 additions & 1 deletion packages/google-cloud-bigquery-datatransfer/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ docs.metadata

# Virtual environment
env/

# Test logs
coverage.xml
sponge_log.xml
*sponge_log.xml

# System test environment variables.
system_tests/local_test_setup
Expand Down
10 changes: 10 additions & 0 deletions packages/google-cloud-bigquery-datatransfer/.kokoro/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ python3 -m pip uninstall --yes --quiet nox-automation
python3 -m pip install --upgrade --quiet nox
python3 -m nox --version

# If this is a continuous build, send the test log to the FlakyBot.
# See https://github.com/googleapis/repo-automation-bots/tree/master/packages/flakybot.
if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"continuous"* ]]; then
cleanup() {
chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot
$KOKORO_GFILE_DIR/linux_amd64/flakybot
}
trap cleanup EXIT HUP
fi

# If NOX_SESSION is set, it only runs the specified session,
# otherwise run all the sessions.
if [[ -n "${NOX_SESSION:-}" ]]; then
Expand Down
17 changes: 15 additions & 2 deletions packages/google-cloud-bigquery-datatransfer/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ def default(session):
session.run(
"py.test",
"--quiet",
f"--junitxml=unit_{session.python}_sponge_log.xml",
"--cov=google/cloud",
"--cov=tests/unit",
"--cov-append",
Expand Down Expand Up @@ -141,9 +142,21 @@ def system(session):

# Run py.test against the system tests.
if system_test_exists:
session.run("py.test", "--quiet", system_test_path, *session.posargs)
session.run(
"py.test",
"--quiet",
f"--junitxml=system_{session.python}_sponge_log.xml",
system_test_path,
*session.posargs,
)
if system_test_folder_exists:
session.run("py.test", "--quiet", system_test_folder_path, *session.posargs)
session.run(
"py.test",
"--quiet",
f"--junitxml=system_{session.python}_sponge_log.xml",
system_test_folder_path,
*session.posargs,
)


@nox.session(python=DEFAULT_PYTHON_VERSION)
Expand Down
6 changes: 3 additions & 3 deletions packages/google-cloud-bigquery-datatransfer/synth.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/python-bigquery-datatransfer.git",
"sha": "5c8d7c1e860d1c50d892bfabc7ec936aaa40e714"
"sha": "794df75c6f92a84e518375ef994e056dae1d9dd9"
}
},
{
Expand All @@ -19,14 +19,14 @@
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "4679e7e415221f03ff2a71e3ffad75b9ec41d87e"
"sha": "d17674372e27fb8f23013935e794aa37502071aa"
}
},
{
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "4679e7e415221f03ff2a71e3ffad75b9ec41d87e"
"sha": "d17674372e27fb8f23013935e794aa37502071aa"
}
}
],
Expand Down

0 comments on commit 5dbdd58

Please sign in to comment.