Skip to content

Commit

Permalink
test: simplify emulator wrapping, ensure env var is passed
Browse files Browse the repository at this point in the history
  • Loading branch information
crwilcox committed Mar 18, 2021
1 parent f7fe18a commit ced9620
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions noxfile.py
Expand Up @@ -114,6 +114,7 @@ def unit(session):
@nox.session(python="3.8")
def system_emulated(session):
import subprocess
import signal

try:
subprocess.call(["gcloud", '--version'])
Expand All @@ -126,23 +127,18 @@ def system_emulated(session):
"--host-port", hostport
])

system(session, emulator=hostport)
session.env["BIGTABLE_EMULATOR_HOST"] = hostport
system(session)

# Stop Emulator
p.send_signal(1)
os.killpg(os.getpgid(p.pid), signal.SIGTERM)

@nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS)
def system(session, emulator=False):
def system(session):
"""Run the system test suite."""
system_test_path = os.path.join("tests", "system.py")
system_test_folder_path = os.path.join("tests", "system")

if emulator:
os.environ["BIGTABLE_EMULATOR_HOST"] = emulator
elif os.environ.get("BIGTABLE_EMULATOR_HOST"):
del os.environ["BIGTABLE_EMULATOR_HOST"]


# Check the value of `RUN_SYSTEM_TESTS` env var. It defaults to true.
if os.environ.get("RUN_SYSTEM_TESTS", "true") == "false":
session.skip("RUN_SYSTEM_TESTS is set to false, skipping")
Expand Down

0 comments on commit ced9620

Please sign in to comment.