Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

Commit

Permalink
build(python): enable flakybot on library unit and system tests (#73)
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 committed Mar 23, 2021
1 parent 6430413 commit d51fa26
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 6 deletions.
4 changes: 3 additions & 1 deletion .gitignore
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 .kokoro/build.sh
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 noxfile.py
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 synth.metadata
Expand Up @@ -4,7 +4,7 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/python-datalabeling.git",
"sha": "0b82ca9eb6cc443ee4e5e6448d366ca1d559441b"
"sha": "670365b7f41698a0b67e5d00512ecd9cfc829a0f"
}
},
{
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 d51fa26

Please sign in to comment.