[Firestore] Updated code to run sys tests on emulator.#54
[Firestore] Updated code to run sys tests on emulator.#54
Conversation
firestore/noxfile.py
Outdated
| if not os.environ.get("FIRESTORE_APPLICATION_CREDENTIALS", ""): | ||
| session.skip("Credentials must be set via environment variable") | ||
| if not os.getenv("FIRESTORE_EMULATOR_HOST"): | ||
| if not os.environ.get("FIRESTORE_APPLICATION_CREDENTIALS", ""): |
There was a problem hiding this comment.
Pay attention! Nox files are generated automatically. Your changes are incorrect and must be rethought.
https://github.com/q-logic/google-cloud-python/blob/f81bf63abf64ab297bff6057b91d1e7cf6576dd6/firestore/noxfile.py#L16-L18
There was a problem hiding this comment.
Yup, will revert it. Thanks!
There was a problem hiding this comment.
Reverted the nox file for now, but i need those changes in nox file.
Should I exclude the noxfile.py from synth tool?
| credentials = EmulatorCreds() | ||
| project = "emulatorproject" | ||
| else: | ||
| credentials = service_account.Credentials.from_service_account_file(FIRESTORE_CREDS) |
There was a problem hiding this comment.
Lint session fails! Use black to reformat the file.
Firestore 'Client' class already has the required support for emulator. |
emar-kar
left a comment
There was a problem hiding this comment.
Chris answered your questions in the meeting document. Have a look, please! He also created PR to skip those tests.
| assert sorted(child.id for child in children) == sorted(child_ids) | ||
|
|
||
|
|
||
| @pytest.mark.skipif(IN_EMULATOR, reason="Not supported in emulator.") |
There was a problem hiding this comment.
Since this repeats multiple times, I'd suggest defining a constant, something like
REASON_NOT_SUPPORTED="Not supported in emulator."
and using it throughout the file.
There was a problem hiding this comment.
I have put the internal issue tracking number as a reason for all skipped tests as suggested by Chris.
Towards [8722].
5 tests are failing on emulator, all of them are running fine on live firestore service.
Not sure whether we have all firestore functionality available on emulator or not.