Skip to content

Commit 1e34c4c

Browse files
chore: resolve issue with prerelease presubmit [autoapprove] (#339)
* chore(python): fix prerelease session [autoapprove] Source-Link: googleapis/synthtool@1b9ad76 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:9db98b055a7f8bd82351238ccaacfd3cda58cdf73012ab58b8da146368330021 * update replacement in owlbot.py * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <[email protected]>
1 parent 23417bd commit 1e34c4c

File tree

3 files changed

+30
-33
lines changed

3 files changed

+30
-33
lines changed

.github/.OwlBot.lock.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313
# limitations under the License.
1414
docker:
1515
image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest
16-
digest: sha256:c8878270182edaab99f2927969d4f700c3af265accd472c3425deedff2b7fd93
17-
# created: 2022-07-14T01:58:16.015625351Z
16+
digest: sha256:9db98b055a7f8bd82351238ccaacfd3cda58cdf73012ab58b8da146368330021
17+
# created: 2022-07-25T16:02:49.174178716Z

noxfile.py

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,8 @@ def prerelease_deps(session):
363363

364364
# Install all dependencies
365365
session.install("-e", ".[all, tests, tracing]")
366-
session.install(*UNIT_TEST_STANDARD_DEPENDENCIES)
366+
unit_deps_all = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_EXTERNAL_DEPENDENCIES
367+
session.install(*unit_deps_all)
367368
system_deps_all = (
368369
SYSTEM_TEST_STANDARD_DEPENDENCIES
369370
+ SYSTEM_TEST_EXTERNAL_DEPENDENCIES
@@ -392,12 +393,6 @@ def prerelease_deps(session):
392393

393394
session.install(*constraints_deps)
394395

395-
if os.path.exists("samples/snippets/requirements.txt"):
396-
session.install("-r", "samples/snippets/requirements.txt")
397-
398-
if os.path.exists("samples/snippets/requirements-test.txt"):
399-
session.install("-r", "samples/snippets/requirements-test.txt")
400-
401396
prerel_deps = [
402397
"protobuf",
403398
# dependency of grpc
@@ -434,11 +429,21 @@ def prerelease_deps(session):
434429
system_test_folder_path = os.path.join("tests", "system")
435430

436431
# Only run system tests if found.
437-
if os.path.exists(system_test_path) or os.path.exists(system_test_folder_path):
438-
session.run("py.test", "tests/system")
439-
440-
snippets_test_path = os.path.join("samples", "snippets")
441-
442-
# Only run samples tests if found.
443-
if os.path.exists(snippets_test_path):
444-
session.run("py.test", "samples/snippets")
432+
if os.path.exists(system_test_path):
433+
session.run(
434+
"py.test",
435+
"--verbose",
436+
f"--junitxml=system_{session.python}_sponge_log.xml",
437+
system_test_path,
438+
env=env,
439+
*session.posargs,
440+
)
441+
if os.path.exists(system_test_folder_path):
442+
session.run(
443+
"py.test",
444+
"--verbose",
445+
f"--junitxml=system_{session.python}_sponge_log.xml",
446+
system_test_folder_path,
447+
env=env,
448+
*session.posargs,
449+
)

owlbot.py

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -137,26 +137,18 @@ def system(session, disable_grpc):
137137
""",
138138
)
139139

140-
assert 1 == s.replace(
140+
assert 2 == s.replace(
141141
"noxfile.py",
142-
"""\
143-
system_test_path,
144-
""",
145-
"""\
146-
system_test_path,
147-
env=env,
148-
""",
142+
"""system_test_path,\n""",
143+
"""system_test_path,
144+
env=env,\n""",
149145
)
150146

151-
assert 1 == s.replace(
147+
assert 2 == s.replace(
152148
"noxfile.py",
153-
"""\
154-
system_test_folder_path,
155-
""",
156-
"""\
157-
system_test_folder_path,
158-
env=env,
159-
""",
149+
"""system_test_folder_path,\n""",
150+
"""system_test_folder_path,
151+
env=env,\n""",
160152
)
161153

162154
# Add nox session to exercise doctests

0 commit comments

Comments
 (0)