Skip to content

Commit

Permalink
chore: preserve gRPC-disabled systests during synth (#141)
Browse files Browse the repository at this point in the history
See #133, #136
  • Loading branch information
tseaver committed Apr 21, 2021
1 parent b841b2a commit 3c8da54
Showing 1 changed file with 43 additions and 7 deletions.
50 changes: 43 additions & 7 deletions synth.py
Expand Up @@ -86,17 +86,53 @@

s.replace("noxfile.py", """["']sphinx['"]""", '''"sphinx<3.0.0"''')

# Add the `sphinx-ext-doctest` extenaion
# Preserve system tests w/ GOOGLE_DISABLE_GRPC set (#133, PR #136)
s.replace(
"docs/conf.py",
"noxfile.py",
"""\
"sphinx.ext.coverage",
"sphinx.ext.napoleon",
@nox.session\(python=SYSTEM_TEST_PYTHON_VERSIONS\)
def system\(session\):
""",
"""\
"sphinx.ext.coverage",
"sphinx.ext.doctest",
"sphinx.ext.napoleon",
@nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS)
@nox.parametrize("disable_grpc", [False, True])
def system(session, disable_grpc):
""",
)

s.replace(
"noxfile.py",
"""\
# Run py.test against the system tests.
""",
"""\
env = {}
if disable_grpc:
env["GOOGLE_CLOUD_DISABLE_GRPC"] = "True"
# Run py.test against the system tests.
""",
)

s.replace(
"noxfile.py",
"""\
session.run\("py.test", "--quiet", system_test_path, \*session.posargs\)
""",
"""\
session.run("py.test", "--quiet", system_test_path, env=env, *session.posargs)
""",
)

s.replace(
"noxfile.py",
"""\
session.run\("py.test", "--quiet", system_test_folder_path, \*session.posargs\)
""",
"""\
session.run(
"py.test", "--quiet", system_test_folder_path, env=env, *session.posargs
)
""",
)

Expand Down

0 comments on commit 3c8da54

Please sign in to comment.