Skip to content

Conversation

@andreia-ferreira
Copy link
Collaborator

@andreia-ferreira andreia-ferreira commented Dec 19, 2025

Towards: google/ground-android#3365

To make Android end to end tests reliable and self-contained, we need to pre-populate the Firebase emulator with a dedicated test survey. This PR adds a new folder with this test data test-android and a new command nx start-android-test-data to launch an emulator based on this data.

A separate github action was also added in order to run this from the ground-android repo

@andreia-ferreira andreia-ferreira force-pushed the andreia/3365/add-e2e-test-data-to-firebase-emulator branch from 482c9c4 to eca4296 Compare December 22, 2025 18:01
@andreia-ferreira andreia-ferreira changed the title Update firebase emulator data for Android e2e tests Update firebase emulator data and add github action for Android e2e tests Dec 23, 2025
@andreia-ferreira andreia-ferreira force-pushed the andreia/3365/add-e2e-test-data-to-firebase-emulator branch from a4cff8e to feb6b81 Compare January 2, 2026 11:34
Comment on lines +16 to +18
"auth": {
"port": 9099
},
Copy link
Collaborator Author

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?

Copy link
Collaborator

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.

Copy link
Collaborator Author

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:

    val auth = FirebaseAuth.getInstance()
    if (USE_EMULATORS) {
      // Use the auth emulator so we can sign-in anonymously during dev.
      auth.useEmulator(EMULATOR_HOST, AUTH_EMULATOR_PORT)
    }

Copy link
Collaborator

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants