[firebase_core] Add integration tests#1060
Conversation
Port 6 integration test cases from upstream firebase_core (github.com/firebase/flutterfire) at tag firebase_core-v2.17.0, located at tests/integration_test/firebase_core/firebase_core_e2e_test.dart. The upstream package on pub.dev does not include integration tests, so the source was fetched directly from the GitHub repository. Adapted for Tizen: replaced 'package:tests/firebase_options.dart' with a manually created firebase_options.dart that maps TargetPlatform.linux (Tizen's reported platform) to public test credentials from main.dart. All other test logic is unchanged from upstream. Ported test cases: - Firebase.apps - Firebase.app() - Firebase.app() Exception - FirebaseApp.delete() - FirebaseApp.setAutomaticDataCollectionEnabled() - FirebaseApp.setAutomaticResourceManagementEnabled() Validated on RPI4 (armv7l) and TV emulator (x86_64): 6/6 passed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add firebase_core_platform_interface as explicit dev dependency (was only a transitive dependency, causing depend_on_referenced_packages) - Use const instead of final for testAppName constant - Remove redundant '[DEFAULT]' argument from Firebase.app() calls (matches the default parameter value) - Fix combinator ordering in firebase_options.dart import - Suppress public_member_api_docs and no_default_cases in firebase_options.dart (generated-style file with no public API contract to document) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request adds integration tests to the firebase_core package example based on upstream firebase_core v2.17.0. It introduces a new integration test suite, a test driver, and DefaultFirebaseOptions configuration targeting the Linux/Tizen platform, while updating the example's dependencies and false_secrets configuration. I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| static const FirebaseOptions linux = FirebaseOptions( | ||
| apiKey: 'AIzaSyAgUhHU8wSJgO5MVNy95tMT07NEjzMOfz0', | ||
| appId: '1:448618578101:ios:0b650370bb29e29cac3efc', | ||
| messagingSenderId: '448618578101', | ||
| projectId: 'react-native-firebase-testing', | ||
| ); | ||
| } |
There was a problem hiding this comment.
It looks to duplicate the values in the example's main. Please double-check if this is actually being used.
| // Integration tests ported from upstream firebase_core | ||
| // (github.com/firebase/flutterfire), originally authored by the | ||
| // Chromium project authors under a BSD-style license. | ||
|
|
There was a problem hiding this comment.
Since the source location of this test is uncommon, adding the source url of the code to the PR message or code is useful for future updates.
https://github.com/firebase/flutterfire/blob/main/tests/integration_test/firebase_core/firebase_core_e2e_test.dart
| sdk: flutter | ||
|
|
||
| dev_dependencies: | ||
| firebase_core_platform_interface: ^4.5.2 |
There was a problem hiding this comment.
This dependency does not seems to be necessary. Even when I tested it, the integration_test tpk was generated successfully after removing this dependency.
Please check whether this dependency is required.
There was a problem hiding this comment.
info • integration_test/firebase_core_test.dart:11:8 • The imported package 'firebase_core_platform_interface' isn't a dependency of the importing package. Try adding a dependency for 'firebase_core_platform_interface' in the 'pubspec.yaml' file. • depend_on_referenced_packages
Removing the dependency still builds because firebase_core_platform_interface remains available transitively through firebase_core. However, the test directly imports it for the noAppExists matcher, so without the declaration flutter analyze reports a depend_on_referenced_packages violation (shown above), which the repo's analyze CI would flag. Upstream's tests/pubspec.yaml also declares it directly for the same reason, so I'd like to keep it.
…urce Per review: the example's main.dart hardcoded the same test credentials that firebase_options.dart defines, so make it use DefaultFirebaseOptions.currentPlatform as the single source of truth, matching the upstream tests app. Also replace the vague upstream reference in the test header with the exact source URL pinned to the ported version (firebase_core-v2.17.0).
Port 6 integration test cases from upstream firebase_core (v2.17.0), since
the pub.dev package doesn't ship integration tests. Added a manually
created
firebase_options.dartmapping Tizen's reported platform(TargetPlatform.linux) to public test credentials.
Ported cases: Firebase.apps, Firebase.app(), Firebase.app() exception,
FirebaseApp.delete(), setAutomaticDataCollectionEnabled(),
setAutomaticResourceManagementEnabled().
Validated on RPI4 (armv7l) and TV emulator (x86_64): 6/6 passed.