Skip to content
This repository was archived by the owner on Mar 31, 2026. It is now read-only.

test: update system tests for emulator#97

Merged
larkee merged 4 commits intogoogleapis:masterfrom
larkee:emulator-tests
Jun 16, 2020
Merged

test: update system tests for emulator#97
larkee merged 4 commits intogoogleapis:masterfrom
larkee:emulator-tests

Conversation

@larkee
Copy link
Copy Markdown
Contributor

@larkee larkee commented Jun 15, 2020

This PR allows system tests to be run against the emulator without setting GOOGLE_APPLICATION_CREDENTIALS with no warnings.

It also skips test_transaction_read_w_abort which fails due to running concurrent transactions which the emulator does not support, and removes skips for test_execute_partitioned_dml and test_partition_read_w_index which are now supported.

@larkee larkee requested review from hengfengli and skuruppu June 15, 2020 00:18
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jun 15, 2020
Config.CLIENT = Client()
if USE_EMULATOR:
from google.auth.credentials import AnonymousCredentials
Config.CLIENT = Client(project='emulator-test-project', credentials=AnonymousCredentials())
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder can we read the project from an env var instead of using a hard-coded one?

Copy link
Copy Markdown

@hengfengli hengfengli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Config.CLIENT = Client()
if USE_EMULATOR:
from google.auth.credentials import AnonymousCredentials
emulator_project = os.getenv("GCLOUD_PROJECT") or 'emulator-test-project'
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nits: I think you can do os.getenv("GCLOUD_PROJECT", "emulator-test-project").

@larkee larkee merged commit 33055e5 into googleapis:master Jun 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants