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

Add support to run emulator for system tests. #287

Closed
crwilcox opened this issue Jan 6, 2021 · 5 comments · Fixed by #460
Closed

Add support to run emulator for system tests. #287

crwilcox opened this issue Jan 6, 2021 · 5 comments · Fixed by #460
Labels
api: firestore Issues related to the googleapis/python-firestore API. type: process A process-related concern. May include testing, release, or the like.

Comments

@crwilcox
Copy link
Contributor

crwilcox commented Jan 6, 2021

Currently the system tests do not run with the emulator.

ERROR    grpc._plugin_wrapping:_plugin_wrapping.py:82 AuthMetadataPluginCallback "<google.auth.transport.grpc.AuthMetadataPlugin object at 0x11169b310>" raised exception!
Traceback (most recent call last):
  File "/Users/crwilcox/workspace/python-firestore/.nox/system-3-7/lib/python3.7/site-packages/grpc/_plugin_wrapping.py", line 78, in __call__
    context, _AuthMetadataPluginCallback(callback_state, callback))
  File "/Users/crwilcox/workspace/python-firestore/.nox/system-3-7/lib/python3.7/site-packages/google/auth/transport/grpc.py", line 86, in __call__
    callback(self._get_authorization_headers(context), None)
  File "/Users/crwilcox/workspace/python-firestore/.nox/system-3-7/lib/python3.7/site-packages/google/auth/transport/grpc.py", line 73, in _get_authorization_headers
    self._request, context.method_name, context.service_url, headers
  File "/Users/crwilcox/workspace/python-firestore/.nox/system-3-7/lib/python3.7/site-packages/google/auth/credentials.py", line 134, in before_request
    self.apply(headers)
  File "/Users/crwilcox/workspace/python-firestore/.nox/system-3-7/lib/python3.7/site-packages/google/auth/credentials.py", line 112, in apply
    if self.quota_project_id:
  File "/Users/crwilcox/workspace/python-firestore/.nox/system-3-7/lib/python3.7/site-packages/google/auth/credentials.py", line 83, in quota_project_id
    return self._quota_project_id
AttributeError: 'EmulatorCreds' object has no attribute '_quota_project_id'
@crwilcox crwilcox added the type: process A process-related concern. May include testing, release, or the like. label Jan 6, 2021
@product-auto-label product-auto-label bot added the api: firestore Issues related to the googleapis/python-firestore API. label Jan 6, 2021
@tseaver
Copy link
Contributor

tseaver commented Sep 23, 2021

@crwilcox Did PR #402 resolve this issue?

@crwilcox
Copy link
Contributor Author

crwilcox commented Sep 27, 2021

❯ gcloud beta emulators firestore start --host-port=127.0.0.1:1234
❯ export FIRESTORE_EMULATOR_HOST=127.0.0.1:1234
❯ nox -s system-3.7

Seems mostly good locally. though some tests don't seem to work with the emulator (Partition Query)

FAILED tests/system/test_system.py::test_partition_query_no_partitions - google.api_core.exceptions.MethodNotImpl...
FAILED tests/system/test_system.py::test_partition_query - google.api_core.exceptions.MethodNotImplemented: 501 M...
FAILED tests/system/test_system.py::test_watch_query_order - assert 5 == 6
FAILED tests/system/test_system_async.py::test_partition_query_no_partitions - google.api_core.exceptions.MethodN...
FAILED tests/system/test_system_async.py::test_partition_query - google.api_core.exceptions.MethodNotImplemented:...

@tseaver
Copy link
Contributor

tseaver commented Sep 27, 2021

@crwilcox

gcloud beta firestore emulator

Hmm, that doesn't work for me -- I need to run gcloud beta emulators firestore start. I'm running with updated components, I think.

And the tests don't pass at that point, either. The fail with 503 failed to connect to all addresses. Nope, I typoed the export statement.

@crwilcox
Copy link
Contributor Author

That was a typo ;)

@tseaver
Copy link
Contributor

tseaver commented Sep 27, 2021

Oddly, the systests still want a GCLOUD_PROJECT to be set in the environment, even under the emulator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: firestore Issues related to the googleapis/python-firestore API. type: process A process-related concern. May include testing, release, or the like.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants