Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
acaad19
Remove Flutter Driver tests
nilsreichardt Oct 1, 2022
6e14cb9
Remove `drive` dependency
nilsreichardt Oct 1, 2022
f5ab85d
Add `integration_test` as dependency
nilsreichardt Oct 1, 2022
cace857
Setup integration test and migrate `firebase_core`
nilsreichardt Oct 1, 2022
8cd393a
Migrate `firebase_analytics`
nilsreichardt Oct 1, 2022
f740e69
Migrate `cloud_functions`
nilsreichardt Oct 1, 2022
bc2fe33
Migrate `firebase_app_check`
nilsreichardt Oct 1, 2022
2889d8b
Migrate `firebase_app_installations`
nilsreichardt Oct 1, 2022
eaf42c5
Migrate `firebase_auth`
nilsreichardt Oct 1, 2022
74f47c6
Migrate `firebase_crashlytics`
nilsreichardt Oct 1, 2022
96b1030
Migrate `firebase_database`
nilsreichardt Oct 1, 2022
12acdf0
Add missing `IntegrationTestWidgetsFlutterBinding` to `firebase_datab…
nilsreichardt Oct 1, 2022
a2c55e7
Migrate `firebase_dynamic_links`
nilsreichardt Oct 1, 2022
efb62b2
Migrate `firebase_messaging`
nilsreichardt Oct 1, 2022
a6f9b4f
Migrate `firebase_ml_model_downloader`
nilsreichardt Oct 1, 2022
055bbaf
Migrate `firebase_remote_config`
nilsreichardt Oct 1, 2022
3aa0992
Migrate `firebase_storage`
nilsreichardt Oct 1, 2022
3034fa6
Migrate `cloud_firestore`
nilsreichardt Oct 1, 2022
de19624
Migrate `cloud_firestore_odm_e2e.dart`
nilsreichardt Oct 1, 2022
ddeb590
Fix port and move to group for `cloud_firestore`
nilsreichardt Oct 1, 2022
6c230af
Migrate `firebase_performance`
nilsreichardt Oct 1, 2022
abc6cd8
Fix android build
nilsreichardt Oct 1, 2022
d7255fc
Update test commands
nilsreichardt Oct 1, 2022
c412716
Delete unused `cloud_functions` Flutter driver tests
nilsreichardt Oct 1, 2022
13e8da1
Delete unused `firebase_analytics` Flutter driver tests
nilsreichardt Oct 1, 2022
eb5cda0
Delete unused `firebase_auth` Flutter driver tests
nilsreichardt Oct 1, 2022
7a292d1
Delete unused `firebase_core` Flutter driver tests
nilsreichardt Oct 1, 2022
6bb66ed
Remove unused `dev_dependencies` in `firebase_in_app_messaging_example`
nilsreichardt Oct 1, 2022
375fc02
Remove unused `dev_dependencies` in `firebase_ml_model_downloader`
nilsreichardt Oct 1, 2022
2152519
Remove unused `dev_dependencies` in `firebase_performance`
nilsreichardt Oct 1, 2022
7aac7a2
Migrate `flutterfire_ui`
nilsreichardt Oct 1, 2022
c212aae
Remove unused `dev_dependencies` in `flutterfire_ui_example`
nilsreichardt Oct 1, 2022
d7d755c
Sort dev dependencies in `tests`
nilsreichardt Oct 1, 2022
d626e02
Remove unnecessary `test` dependency in `cloud_firestore`  
nilsreichardt Oct 1, 2022
e7786d7
Remove unnecessary `test` dependency in `cloud_firestore_example`  
nilsreichardt Oct 1, 2022
24aab48
Sort dev dependencies in `cloud_firestore_odm`
nilsreichardt Oct 1, 2022
ae6b089
Remove unnecessary `test` and `flutter_driver` dependency in `cloud_f…
nilsreichardt Oct 1, 2022
a21c701
Remove unnecessary `test` dependency in `cloud_functions_example`  
nilsreichardt Oct 1, 2022
47a1ce6
Remove unnecessary `test` dependency in `firebase_analytics_example`  
nilsreichardt Oct 1, 2022
abcf170
Remove unnecessary `test` dependency in `firebase_app_check`  
nilsreichardt Oct 1, 2022
6f3578d
Remove unnecessary `test` dependency in `firebase_app_installations`  
nilsreichardt Oct 1, 2022
87e8d8b
Remove unnecessary `test` & `flutter_driver` dependency in `firebase_…
nilsreichardt Oct 1, 2022
abffc17
Remove unnecessary `test` dependency in `firebase_auth`
nilsreichardt Oct 1, 2022
649b06d
Remove unnecessary `test` dependency in `firebase_crashlytics`
nilsreichardt Oct 1, 2022
19eaa21
Remove unnecessary `test` dependency in `firebase_database`
nilsreichardt Oct 1, 2022
05c76cd
Remove unnecessary `test` dependency in `firebase_in_app_messaging`
nilsreichardt Oct 1, 2022
3931a05
Remove unnecessary `test` dependency in `firebase_messaging`
nilsreichardt Oct 1, 2022
72b3133
Remove unnecessary `test` dependency in `firebase_remote_config`
nilsreichardt Oct 1, 2022
42701f8
Remove unnecessary `test` dependency in `firebase_storage`
nilsreichardt Oct 1, 2022
e0af8b7
Remove `test:e2e` and `test:e2e:web` melos command
nilsreichardt Oct 1, 2022
ec3fb33
Update `CONTRIBUTING.md` for running integration tests
nilsreichardt Oct 1, 2022
915af70
Remove drive commands from `tasks.json`
nilsreichardt Oct 1, 2022
d20019f
Revert "Remove drive commands from `tasks.json`"
nilsreichardt Oct 1, 2022
67ddfd4
Update `tasks.json`
nilsreichardt Oct 1, 2022
cc9154a
Fix `build_example.sh`
nilsreichardt Oct 1, 2022
b2cd159
Update `drive_example.sh`
nilsreichardt Oct 1, 2022
7a69ac7
Remove unused `test_driver/integration/*` in `build.yaml` of `cloud_f…
nilsreichardt Oct 1, 2022
0b8397e
Revert "Remove `test:e2e` and `test:e2e:web` melos command"
nilsreichardt Oct 1, 2022
532c9a1
Bring back the `melos run test:e2e` and fix macos & web integration t…
nilsreichardt Oct 1, 2022
913f6ec
Add missing `--driver=./test_driver/integration_test.dart` in `tasks.…
nilsreichardt Oct 1, 2022
2072c17
Changed to sync `cloud_firestore_odm_e2e_test.dart`
nilsreichardt Oct 1, 2022
bfc2b59
Check flakiness
nilsreichardt Oct 1, 2022
ea9c124
Skip "subscribeToTopic" and "unsubscribeFromTopic" for Android
nilsreichardt Oct 1, 2022
b06cd3c
comment out `concurrency` for e2e tests
nilsreichardt Oct 1, 2022
a3da82b
Skip "times out when the provided timeout option is exceeded" test
nilsreichardt Oct 1, 2022
a6c7714
Remove testing stuff
nilsreichardt Oct 2, 2022
7034d76
Merge branch 'master' into migrate-to-integration-tests-rework
nilsreichardt Oct 7, 2022
f117e20
Remove `IntegrationTestWidgetsFlutterBinding.ensureInitialized()`
nilsreichardt Oct 9, 2022
36487e1
Revert "Remove `IntegrationTestWidgetsFlutterBinding.ensureInitialize…
nilsreichardt Oct 9, 2022
6fdc1a3
Re-trigger CI
nilsreichardt Oct 9, 2022
56a275a
Re-trigger CI
nilsreichardt Oct 9, 2022
62f2e06
Merge branch 'master' into migrate-to-integration-tests-rework
nilsreichardt Oct 27, 2022
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
25 changes: 18 additions & 7 deletions .github/workflows/e2e_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
- name: "Build Application"
working-directory: tests
run: |
flutter build apk --debug --target=./test_driver/driver_e2e.dart --dart-define=CI=true --no-android-gradle-daemon
flutter build apk --debug --target=./integration_test/e2e_test.dart --dart-define=CI=true --no-android-gradle-daemon
- name: Start Firebase Emulator
run: cd ./.github/workflows/scripts && ./start-firebase-emulator.sh
- name: "E2E Tests"
Expand All @@ -98,7 +98,7 @@ jobs:
script: |
sleep 15
$ANDROID_HOME/platform-tools/adb logcat '*:D' > adb-log.txt &
flutter drive --target=./test_driver/driver_e2e.dart --dart-define=CI=true
flutter test integration_test/e2e_test.dart --dart-define=CI=true

- name: Compress Emulator Log
if: always()
Expand Down Expand Up @@ -159,7 +159,7 @@ jobs:
export CCACHE_DEPEND=true
export CCACHE_INODECACHE=true
ccache -s
flutter build ios --no-codesign --simulator --debug --target=./test_driver/driver_e2e.dart --dart-define=CI=true
flutter build ios --no-codesign --simulator --debug --target=./integration_test/e2e_test.dart --dart-define=CI=true
ccache -s
- name: Start Firebase Emulator
run: cd ./.github/workflows/scripts && ./start-firebase-emulator.sh
Expand All @@ -174,7 +174,7 @@ jobs:
sleep 15
# Uncomment following line to have simulator logs printed out for debugging purposes.
# xcrun simctl spawn booted log stream --predicate 'eventMessage contains "flutter"' &
flutter drive -d "$SIMULATOR" --target=./test_driver/driver_e2e.dart --dart-define=CI=true
flutter test integration_test/e2e_test.dart -d "$SIMULATOR" --dart-define=CI=true
FLUTTER_DRIVE_EXIT_CODE=$?
xcrun simctl shutdown "$SIMULATOR"
exit $FLUTTER_DRIVE_EXIT_CODE
Expand Down Expand Up @@ -225,14 +225,17 @@ jobs:
export CCACHE_DEPEND=true
export CCACHE_INODECACHE=true
ccache -s
flutter build macos --debug --target=./test_driver/driver_e2e.dart --device-id=macos --dart-define=CI=true
flutter build macos --debug --target=./integration_test/e2e_test.dart --device-id=macos --dart-define=CI=true
ccache -s
- name: Start Firebase Emulator
run: cd ./.github/workflows/scripts && ./start-firebase-emulator.sh
- name: "E2E Tests"
working-directory: tests
run: |
flutter drive -d macos --target=./test_driver/driver_e2e.dart --dart-define=CI=true
flutter test \
integration_test/e2e_test.dart \
-d macos \
--dart-define=CI=true

web:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -263,6 +266,14 @@ jobs:
run: cd ./.github/workflows/scripts && ./start-firebase-emulator.sh
- name: "E2E Tests"
working-directory: tests
# Web devices are not supported for the `flutter test` command yet. As a
# workaround we can use the `flutter drive` command. Tracking issue:
# https://github.com/flutter/flutter/issues/66264
run: |
chromedriver --port=4444 &
flutter drive --verbose-system-logs --device-id=web-server --target=./test_driver/driver_e2e.dart --dart-define=CI=true
flutter drive \
--verbose-system-logs \
-d web-server \
--driver=test_driver/integration_test.dart \
--target=integration_test/e2e_test.dart \
--dart-define=CI=true
2 changes: 1 addition & 1 deletion .github/workflows/scripts/build-example.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

DEFAULT_TARGET="./test_driver/MELOS_PARENT_PACKAGE_NAME_e2e.dart"
DEFAULT_TARGET="./integration_test/MELOS_PARENT_PACKAGE_NAME_e2e_test.dart"

ACTION=$1
TARGET_FILE=${2:-$DEFAULT_TARGET}
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/scripts/drive-example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ if [ "$ACTION" == "android" ]
then
# Sleep to allow emulator to settle.
sleep 15
melos exec -c 1 --fail-fast --scope="$FLUTTERFIRE_PLUGIN_SCOPE_EXAMPLE" --dir-exists=test_driver -- \
flutter drive $FLUTTER_COMMAND_FLAGS --no-pub --target=./test_driver/MELOS_PARENT_PACKAGE_NAME_e2e.dart --dart-define=CI=true
melos exec -c 1 --fail-fast --scope="$FLUTTERFIRE_PLUGIN_SCOPE_EXAMPLE" --dir-exists=integration_test -- \
flutter test integration_test/MELOS_PARENT_PACKAGE_NAME_e2e_test.dart $FLUTTER_COMMAND_FLAGS --no-pub --dart-define=CI=true
exit
fi

Expand All @@ -21,8 +21,8 @@ then
sleep 15
# Uncomment following line to have simulator logs printed out for debugging purposes.
# xcrun simctl spawn booted log stream --predicate 'eventMessage contains "flutter"' &
melos exec -c 1 --fail-fast --scope="$FLUTTERFIRE_PLUGIN_SCOPE_EXAMPLE" --dir-exists=test_driver -- \
flutter drive $FLUTTER_COMMAND_FLAGS -d \"$SIMULATOR\" --no-pub --target=./test_driver/MELOS_PARENT_PACKAGE_NAME_e2e.dart --dart-define=CI=true
melos exec -c 1 --fail-fast --scope="$FLUTTERFIRE_PLUGIN_SCOPE_EXAMPLE" --dir-exists=integration_test -- \
flutter test integration_test/MELOS_PARENT_PACKAGE_NAME_e2e_test.dart $FLUTTER_COMMAND_FLAGS -d \"$SIMULATOR\" --no-pub --dart-define=CI=true
MELOS_EXIT_CODE=$?
xcrun simctl shutdown "$SIMULATOR"
exit $MELOS_EXIT_CODE
Expand All @@ -31,7 +31,7 @@ fi
if [ "$ACTION" == "macos" ]
then
melos exec -c 1 --fail-fast --scope="$FLUTTERFIRE_PLUGIN_SCOPE_EXAMPLE" --dir-exists=test_driver -- \
flutter drive $FLUTTER_COMMAND_FLAGS -d macos --no-pub --target=./test_driver/MELOS_PARENT_PACKAGE_NAME_e2e.dart --dart-define=CI=true
flutter test integration_test/MELOS_PARENT_PACKAGE_NAME_e2e_test.dart $FLUTTER_COMMAND_FLAGS -d macos --no-pub --dart-define=CI=true
exit
fi

Expand All @@ -40,6 +40,6 @@ then
melos bootstrap --scope="*firebase_core*" --scope="$FLUTTERFIRE_PLUGIN_SCOPE"
chromedriver --port=4444 &
melos exec -c 1 --scope="$FLUTTERFIRE_PLUGIN_SCOPE_EXAMPLE" --dir-exists=web -- \
flutter drive $FLUTTER_COMMAND_FLAGS --no-pub --verbose-system-logs --device-id=web-server --target=./test_driver/MELOS_PARENT_PACKAGE_NAME_e2e.dart --dart-define=CI=true
flutter drive $FLUTTER_COMMAND_FLAGS --no-pub --verbose-system-logs --device-id=web-server --target=./integration_test/MELOS_PARENT_PACKAGE_NAME_e2e_test.dart --driver=./test_driver/integration_test.dart --dart-define=CI=true
exit
fi
18 changes: 2 additions & 16 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@
{
"label": "firestore -> test:e2e",
"type": "shell",
"command": "melos exec -c 1 --scope=\"*cloud_firestore_example*\" --fail-fast --dir-exists=test_driver -- flutter drive --no-pub --target=./test_driver/MELOS_PARENT_PACKAGE_NAME_e2e.dart",
"command": "melos exec -c 1 --scope=\"*cloud_firestore_example*\" --fail-fast --dir-exists=integration_test -- flutter drive --no-pub --target=./integration_test/MELOS_PARENT_PACKAGE_NAME_e2e_test.dart",
"detail": "Run end-to-end testing for Android & iOS via `flutter drive` on the Firestore example application",
"problemMatcher": []
},
{
"label": "firestore -> test:e2e:web",
"type": "shell",
"command": "melos exec -c 1 --scope=\"*cloud_firestore_example*\" --dir-exists=web --fail-fast --dir-exists=test_driver -- flutter drive --release -d chrome --no-pub --verbose-system-logs --browser-name=chrome --target=./test_driver/MELOS_PARENT_PACKAGE_NAME_e2e.dart",
"command": "melos exec -c 1 --scope=\"*cloud_firestore_example*\" --dir-exists=web --fail-fast --dir-exists=test_driver -- flutter drive --release -d chrome --no-pub --verbose-system-logs --browser-name=chrome --target=./integration_test/MELOS_PARENT_PACKAGE_NAME_e2e_test.dart --driver=./test_driver/integration_test.dart",
"detail": "Run end-to-end testing for Web via `flutter drive` on the Firestore example application",
"problemMatcher": []
},
Expand Down Expand Up @@ -122,20 +122,6 @@
"detail": "Run `flutter test` on all Auth packages (excluding web & example)",
"problemMatcher": []
},
{
"label": "auth -> test:e2e",
"type": "shell",
"command": "melos exec -c 1 --scope=\"*firebase_auth_example*\" --fail-fast --dir-exists=test_driver -- flutter drive --no-pub --target=./test_driver/MELOS_PARENT_PACKAGE_NAME_e2e.dart",
"detail": "Run end-to-end testing for Android & iOS via `flutter drive` on the Auth example application",
"problemMatcher": []
},
{
"label": "auth -> test:e2e:web",
"type": "shell",
"command": "melos exec -c 1 --scope=\"*firebase_auth_example*\" --dir-exists=web --fail-fast --dir-exists=test_driver -- flutter drive --release -d chrome --no-pub --verbose-system-logs --browser-name=chrome --target=./test_driver/MELOS_PARENT_PACKAGE_NAME_e2e.dart",
"detail": "Run end-to-end testing for Web via `flutter drive` on the Auth example application",
"problemMatcher": []
},
{
"label": "auth -> test:web",
"type": "shell",
Expand Down
17 changes: 13 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,21 +111,30 @@ flutter test
### End-to-end (e2e) tests

E2e tests are those which directly communicate with Firebase, whose results cannot be mocked. These tests run directly from
an example application. To run e2e tests, run the `flutter drive` command from the plugins main `example` directory, targeting the
entry e2e test file.
an example application. To run e2e tests, run the `flutter test` (for Android, iOS & macOS) or the `flutter drive` (for web)
command from the plugins main `example` directory, targeting the entry e2e test file.

> Some packages use Firebase Emulator Suite to run tests. To learn more, [visit the official documentation](https://firebase.google.com/docs/emulator-suite).

To start the Firebase Emulator, run these commands:

```bash
cd .github/workflows/scripts
firebase emulators:start --only auth,firestore,functions,storage,database --project flutterfire-e2e-tests
Comment on lines +122 to +123
Copy link
Contributor

Choose a reason for hiding this comment

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

You have the melos run firebase:emulator than can be used

```

To run tests against Android, iOS or macOS environments, run these commands:

```bash
cd packages/firebase_auth/firebase_auth/example
flutter drive --target=./test_driver/firebase_auth_e2e.dart
flutter test integration_test/firebase_auth_e2e_test.dart
```

To run tests against web environments, run the command as a release build:

```bash
cd packages/firebase_auth/firebase_auth/example
flutter drive --target=./test_driver/firebase_auth_e2e.dart --release -d chrome
flutter drive --target=./integration_test/firebase_auth_e2e_test.dart --driver=./test_driver/integration_test.dart --release -d chrome
```

### Using Melos
Expand Down
6 changes: 3 additions & 3 deletions melos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -151,18 +151,18 @@ scripts:
test:e2e:
run: |
melos exec -c 1 --fail-fast -- \
"flutter drive --no-pub --target=./test_driver/driver_e2e.dart"
"flutter test integration_test/e2e_test.dart --no-pub"
description: |
Run all e2e tests.
select-package:
dir-exists:
- test_driver
- integration_test
scope: '*tests*'

test:e2e:web:
run: |
melos exec -c 1 --fail-fast -- \
"flutter drive --no-pub --target=./test_driver/driver_e2e.dart -d chrome"
"flutter drive --no-pub --target=./integration_test/e2e_test.dart --driver=./test_driver/integration_test.dart -d chrome"
description: |
Run all e2e tests on web platform. Please ensure you have "chromedriver" installed and running.
select-package:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
// BSD-style license that can be found in the LICENSE file.

import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:drive/drive.dart' as drive;
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';

import 'collection_reference_e2e.dart';
import 'document_change_e2e.dart';
Expand All @@ -24,29 +24,31 @@ import 'second_app_e2e.dart';

bool kUseFirestoreEmulator = true;

void testsMain() {
setUpAll(() async {
await Firebase.initializeApp(options: TestFirebaseConfig.platformOptions);

if (kUseFirestoreEmulator) {
FirebaseFirestore.instance.useFirestoreEmulator('localhost', 8080);
}
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();

group('cloud_firestore', () {
setUpAll(() async {
await Firebase.initializeApp(options: TestFirebaseConfig.platformOptions);

if (kUseFirestoreEmulator) {
FirebaseFirestore.instance.useFirestoreEmulator('localhost', 8080);
}
});

runInstanceTests();

runCollectionReferenceTests();
runDocumentChangeTests();
runDocumentReferenceTests();
runFieldValueTests();
runGeoPointTests();
runQueryTests();
runSnapshotMetadataTests();
runTimestampTests();
runTransactionTests();
runWriteBatchTests();
runLoadBundleTests();
runSecondAppTests();
});

runInstanceTests();

runCollectionReferenceTests();
runDocumentChangeTests();
runDocumentReferenceTests();
runFieldValueTests();
runGeoPointTests();
runQueryTests();
runSnapshotMetadataTests();
runTimestampTests();
runTransactionTests();
runWriteBatchTests();
runLoadBundleTests();
runSecondAppTests();
}

void main() => drive.main(testsMain);
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,8 @@ dependency_overrides:
path: ../../../firebase_core/firebase_core_web

dev_dependencies:
drive: ^1.0.0-1.0.nullsafety.1
flutter_driver:
integration_test:
sdk: flutter
test: any

flutter:
uses-material-design: true

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import 'package:integration_test/integration_test_driver.dart';

Future<void> main() => integrationDriver();
1 change: 0 additions & 1 deletion packages/cloud_firestore/cloud_firestore/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ dev_dependencies:
flutter_test:
sdk: flutter
mockito: ^5.0.0
test: any

flutter:
plugin:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,12 @@ targets:
include:
- lib/*
- lib/**
- test_driver/integration/*
- test_driver/integration/**/*
json_serializable:
enabled: true
generate_for:
include:
- lib/*
- lib/**
- test_driver/integration/*
- test_driver/integration/**/*
options:
create_field_map: true
source_gen|combining_builder:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Copyright 2021, the Chromium project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';

import 'collection_reference_test.dart' as collection_reference_test;
import 'document_reference_test.dart' as document_reference_test;
import 'path_test.dart' as path_test;
import 'query_reference_test.dart' as query_reference_test;

void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();

Choose a reason for hiding this comment

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

afaik this isn't required, because the flutter tool creates a temporary file where the call to IntegrationTestWidgetsFlutterBinding.ensureInitialized() is automatically inserted. See flutter/flutter#92254 for more details :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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


group('cloud_firestore_odm', () {
setUpAll(() async {
await Firebase.initializeApp(
options: const FirebaseOptions(
apiKey: 'AIzaSyAHAsf51D0A407EklG1bs-5wA7EbyfNFg0',
appId: '1:448618578101:ios:3a3c8ae9cb0b6408ac3efc',
messagingSenderId: '448618578101',
projectId: 'react-native-firebase-testing',
authDomain: 'react-native-firebase-testing.firebaseapp.com',
iosClientId:
'448618578101-m53gtqfnqipj12pts10590l37npccd2r.apps.googleusercontent.com',
),
);
FirebaseFirestore.instance.useFirestoreEmulator('localhost', 8080);
});

collection_reference_test.main();
document_reference_test.main();
// TODO CI tests configuration currently not compatible with widget testing
// firestore_builder_test.main();
query_reference_test.main();
path_test.main();
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ dev_dependencies:
path: ../../cloud_firestore_odm_generator
cloud_firestore_odm_generator_integration_test:
path: ../../cloud_firestore_odm_generator/cloud_firestore_odm_generator_integration_test
drive: ^1.0.0-1.0.nullsafety.1
flutter_test:
sdk: flutter
freezed: ^2.0.0
integration_test:
sdk: flutter
http: ^0.13.5
json_serializable: ^6.3.0
mockito: ^5.0.0
Expand Down
Loading