-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Firestore: add emulator support #7500
Comments
See #4840. |
Preamble: I haven't looked at much of the source code for the project at all and have just been happily using it straight from pip. But now we're looking to handle a local test stack for our application, and want to use the beta Firestore Emulator from a Python runtime As a hack, could we instantiate a transport object pointing to the local endpoint of the simulator and bind that to a Client object? I'm assuming that if it was this easy the Edit: Forgot that we also need access from a .NET runtime, so I've sort of scrapped this idea as it's probably not worth the time. |
@mnoseworthy I think this works: https://gist.github.com/therefromhere/5acc827ec7a27db9edcb24fe2ece7d37 edit: it works for testing Firestore rules for an un-authenticated user - I haven't figured out how to authenticate as admin or as a uid yet. |
With live Firestore, all the system tests pass. With the emulator, out of the 24 tests in total, 17 pass and 7 fail. The reasons are yet to be determined, for the following error messages: 4 tests showing error "Few assertion failed with emulator, but works with real one." 2 tests failing with "PermissionDenied: 403 Metadata operations require admin authentication. which received in two test": 1 test showing "entity already exists: so DID NOT RAISE <class 'google.api_core.exceptions.InvalidArgument'>": |
Is your feature request related to a problem? Please describe.
The library does not respect the
FIRESTORE_EMULATOR_HOST
environment variable thus it cannot be used with the emulator.Describe the solution you'd like
Respect the
FIRESTORE_EMULATOR_HOST
environment variable and connect to the emulator when set.Describe alternatives you've considered
None. If there are other ways to use the emulator with the library they are not documented.
The text was updated successfully, but these errors were encountered: