-
Notifications
You must be signed in to change notification settings - Fork 100
Update firebase emulator data and add github action for Android e2e tests #2327
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
Draft
andreia-ferreira
wants to merge
14
commits into
master
Choose a base branch
from
andreia/3365/add-e2e-test-data-to-firebase-emulator
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
6fe62d1
Update firebase emulator data for Android e2e tests
andreia-ferreira e578fb2
Update local data with latest test version
andreia-ferreira 8b683b3
Add dedicated action for android tests
andreia-ferreira b6c52e8
Revert local data changes
andreia-ferreira f5ec2ef
Replace npm script for android tests with equivalent nx target
andreia-ferreira feb6b81
Add auth port for firebase emulator
andreia-ferreira f64d157
Update start-emulator action with nx targets
andreia-ferreira 81eeff3
Merge branch 'master' into andreia/3365/add-e2e-test-data-to-firebase…
rfontanarosa 2be602c
Remove unused job from android test data
andreia-ferreira 4c71455
Merge remote-tracking branch 'origin/andreia/3365/add-e2e-test-data-t…
andreia-ferreira c435acd
Add debug data to action
andreia-ferreira a2a0e80
Fix debug data
andreia-ferreira 7acda51
Fix debug data
andreia-ferreira 8291449
Remove debug code
andreia-ferreira File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| # Copyright 2026 The Ground Authors. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # https://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| name: Start Firebase emulator for Android tests | ||
|
|
||
| inputs: | ||
| platform-repository: | ||
| description: "ground-platform repository under test" | ||
| default: google/ground-platform | ||
|
|
||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: ${{ inputs.platform-repository }} | ||
|
|
||
| - name: Load cached Firebase emulator | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ~/.cache/firebase/emulators | ||
| key: ${{ runner.os }}-firebase-emulators-${{ github.sha }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-firebase-emulators- | ||
|
|
||
| - name: Set up Node.js | ||
| uses: actions/setup-node@v2 | ||
| with: | ||
| node-version: "20" | ||
|
|
||
| - name: Load cached Node modules | ||
| id: cache-npm | ||
| uses: actions/cache@v3 | ||
| env: | ||
| cache-name: cache-node-modules | ||
| with: | ||
| # npm cache files are stored in `~/.npm` on Linux/macOS | ||
| path: ~/.npm | ||
| key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-build-${{ env.cache-name }}- | ||
| ${{ runner.os }}-build- | ||
| ${{ runner.os }}- | ||
|
|
||
| - if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} | ||
| name: List the state of Node modules | ||
| continue-on-error: true | ||
| shell: bash | ||
| run: npm list | ||
|
|
||
| - name: Install nx-linux-x64-gnu | ||
| shell: bash | ||
| run: npm install @nx/nx-linux-x64-gnu | ||
|
|
||
| - name: Install dependencies | ||
| shell: bash | ||
| run: npm install | ||
|
|
||
| - name: Build project and local deps | ||
| shell: bash | ||
| run: npx nx build | ||
|
|
||
| - name: Start Firebase emulator with Android test data | ||
| shell: bash | ||
| run: npx nx start-android-test-data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| {"kind":"identitytoolkit#DownloadAccountResponse","users":[{"localId":"OSpCUZYAGPvDJn8n7rgYz9YfIrD9","createdAt":"1719838206834","lastLoginAt":"1719838206834","validSince":"1724424200","emailVerified":false,"disabled":false},{"localId":"dZWReItHKWIaMi4GJPxszWb0VCnN","createdAt":"1719841155698","lastLoginAt":"1719841155698","validSince":"1724424200","emailVerified":false,"disabled":false},{"localId":"xyNMqyb9LPp0xXtdEa6DQk3ymHLa","createdAt":"1719841321507","lastLoginAt":"1719841321507","validSince":"1724424200","emailVerified":false,"disabled":false}]} | ||
| {"kind":"identitytoolkit#DownloadAccountResponse","users":[{"localId":"OSpCUZYAGPvDJn8n7rgYz9YfIrD9","createdAt":"1719838206834","lastLoginAt":"1719838206834","validSince":"1767633238","emailVerified":false,"disabled":false},{"localId":"dZWReItHKWIaMi4GJPxszWb0VCnN","createdAt":"1719841155698","lastLoginAt":"1719841155698","validSince":"1767633238","emailVerified":false,"disabled":false},{"localId":"xyNMqyb9LPp0xXtdEa6DQk3ymHLa","createdAt":"1719841321507","lastLoginAt":"1719841321507","validSince":"1767633238","emailVerified":false,"disabled":false}]} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,12 @@ | ||
| { | ||
| "version": "13.6.0", | ||
| "version": "14.27.0", | ||
| "firestore": { | ||
| "version": "1.19.4", | ||
| "version": "1.19.8", | ||
| "path": "firestore_export", | ||
| "metadata_file": "firestore_export/firestore_export.overall_export_metadata" | ||
| }, | ||
| "auth": { | ||
| "version": "13.6.0", | ||
| "version": "14.27.0", | ||
| "path": "auth_export" | ||
| } | ||
| } |
Binary file modified
BIN
+0 Bytes
(100%)
.../local/firestore_export/all_namespaces/all_kinds/all_namespaces_all_kinds.export_metadata
Binary file not shown.
Binary file modified
BIN
+8.04 KB
(160%)
data/local/firestore_export/all_namespaces/all_kinds/output-0
Binary file not shown.
Binary file modified
BIN
+1 Byte
(100%)
data/local/firestore_export/firestore_export.overall_export_metadata
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| {"kind":"identitytoolkit#DownloadAccountResponse","users":[{"localId":"OSpCUZYAGPvDJn8n7rgYz9YfIrD9","createdAt":"1719838206834","lastLoginAt":"1719838206834","validSince":"1724424200","emailVerified":false,"disabled":false},{"localId":"dZWReItHKWIaMi4GJPxszWb0VCnN","createdAt":"1719841155698","lastLoginAt":"1719841155698","validSince":"1724424200","emailVerified":false,"disabled":false},{"localId":"xyNMqyb9LPp0xXtdEa6DQk3ymHLa","createdAt":"1719841321507","lastLoginAt":"1719841321507","validSince":"1724424200","emailVerified":false,"disabled":false}]} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| {"signIn":{"allowDuplicateEmails":false},"emailPrivacyConfig":{"enableImprovedEmailPrivacy":false}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| { | ||
| "version": "13.35.1", | ||
| "firestore": { | ||
| "version": "1.19.8", | ||
| "path": "firestore_export", | ||
| "metadata_file": "firestore_export/firestore_export.overall_export_metadata" | ||
| }, | ||
| "auth": { | ||
| "version": "13.35.1", | ||
| "path": "auth_export" | ||
| } | ||
| } |
Binary file added
BIN
+52 Bytes
...ndroid/firestore_export/all_namespaces/all_kinds/all_namespaces_all_kinds.export_metadata
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+96 Bytes
data/test-android/firestore_export/firestore_export.overall_export_metadata
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,6 +13,9 @@ | |
| ] | ||
| }, | ||
| "emulators": { | ||
| "auth": { | ||
| "port": 9099 | ||
| }, | ||
| "functions": { | ||
| "port": 5001 | ||
| }, | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that this has been removed in #2338 but it's needed for running the android project with the local firebase emulator so I'm re-adding it here. @gino-m could you please confirm if this is ok?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure it's needed? Isn't auth disabled in the local version? I can't see how it would work today, since we never set up a test account in the auth emulator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
without this the Android app crashes with :
com.google.firebase.FirebaseException: An internal error has occurred. [ Failed to connect to /10.0.2.2:9099 ]The Android app needs FirebaseAuth to initialize successfully when running against the local emulator. For local builds we rely on anonymous sign-in, which still requires the auth emulator to be configured, which currently is done like this:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting.. I'm surprised it's needed for anonymous sign in. Sure, please re-enable it!