Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 23 additions & 14 deletions bigtable/tests/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,21 +329,30 @@ def process_scan(table, range, ids):
)

(endpoint, port) = server.stdout.readline().decode("utf-8").rstrip("\n").split(":")

old_emulator_host = os.environ.get("BIGTABLE_EMULATOR_HOST", None)
os.environ["BIGTABLE_EMULATOR_HOST"] = endpoint + ":" + port
client = Client(project="client", admin=True)
instance = Instance("instance", client)
table = instance.table("table")

# Run test, line by line
with open(TEST_SCRIPT, 'r') as script:
for line in script.readlines():
if line.startswith("CLIENT:"):
chunks = line.split(" ")
op = chunks[1]
process_scan(table, chunks[2], chunks[3])

# Check that the test passed
server.kill()
try:
client = Client(project="client", admin=True)
instance = Instance("instance", client)
table = instance.table("table")

# Run test, line by line
with open(TEST_SCRIPT, 'r') as script:
for line in script.readlines():
if line.startswith("CLIENT:"):
chunks = line.split(" ")
op = chunks[1]
process_scan(table, chunks[2], chunks[3])

# Check that the test passed
server.kill()
finally:
if old_emulator_host:
os.environ["BIGTABLE_EMULATOR_HOST"] = old_emulator_host
else:
del os.environ["BIGTABLE_EMULATOR_HOST"]

server_stdout_lines = []
while True:
line = server.stdout.readline().decode("utf-8")
Expand Down