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

[catalog-server] Run tests against real Firestore #1332

Open
1 of 4 tasks
justinfagnani opened this issue Sep 23, 2022 · 1 comment
Open
1 of 4 tasks

[catalog-server] Run tests against real Firestore #1332

justinfagnani opened this issue Sep 23, 2022 · 1 comment
Assignees
Labels
New Site Issues for the rewrite of the site and catalog.

Comments

@justinfagnani
Copy link
Collaborator

Tests against real (GCP production) Firestore will presumably be more accurate wrt to transactions, indices, and security rules.

To do this properly we will need to:

  • Create a test GCP project to separate prod and test environments.
  • Be able to set the GCP project with a flag or environment variable, and set it from the GitHub actions
  • Namespace all collections so that tests can run in parallel without interfering with each other. The root collection somewhat obviously needs to namespaces, but so do any collections that are used in a .collectionGroup() query, like customElements, so it's probably best to just make factories for all Firestore references and namespace them all.
  • Have a robust data cleanup script that runs after tests. This script will need to use the namespace used in the tests it's cleaning up after.
@justinfagnani justinfagnani added the New Site Issues for the rewrite of the site and catalog. label Sep 23, 2022
@CaptainCodeman
Copy link

CaptainCodeman commented Sep 23, 2022

The emulator is pretty good, especially for testing all different security rule permissions.

https://firebase.google.com/docs/firestore/security/test-rules-emulator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New Site Issues for the rewrite of the site and catalog.
Projects
None yet
Development

No branches or pull requests

2 participants