Skip to content

Update documentation to reflect emulator is default for integration tests. #562

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

Merged
merged 3 commits into from
Jun 24, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion firebase-firestore/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,34 @@ the source root.
Make sure you have created a Firestore instance for your project, before
you proceed.

### Run on Local Emulator
By default, integration tests run against the Firestore emulator.

### Setting up the Firestore Emulator

The integration tests require that the Firestore emulator is running on port
8080, which is default when running it via CLI.

* Ensure that `gogole-services.json` is properly configured.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this mean? Also typo.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wish to communicate that the Android SDK is hard-coded to look for the port on 8080, and that port 8080 is the default port that the android emulator will start on when running it via CLI.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should have been more specific with my feedback: what does it mean to "ensure that google-services.json is properly configured"? Do I need to do something special? If this is the standard setup maybe just link to https://github.com/firebase/firebase-android-sdk#project-setup ?

Also, if we're running against the emulator, why do we need the google-services.json at all?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha. I did not realize that the google-services.json isn't needed when running against the emulator.

* [Install the Firebase CLI](https://firebase.google.com/docs/cli/).
```
npm install -g firebase-tools
```
* [Install the Firestore
emulator](https://firebase.google.com/docs/firestore/security/test-rules-emulator#install_the_emulator).
```
firebase setup:emulators:firestore
```
* Run the emulator
```
firebase serve --only firestore
```
* Select the `Firestore Integration Tests (Firestore Emulator)` run
configuration to run all integration tests.

To run the integration tests against prod, select `FirestoreProdIntegrationTest`
run configuration.

### Run on Local Android Emulator

Then simply run:
```bash
Expand Down