Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: update system tests for emulator #97

Merged
merged 4 commits into from
Jun 16, 2020

Conversation

larkee
Copy link
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.

@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())

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

@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'

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 join this conversation on GitHub. Already have an account? Sign in to comment
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