From b9bf64f41940f688c8957bd7b3292c592bac2e84 Mon Sep 17 00:00:00 2001 From: Salakar Date: Tue, 8 Sep 2020 16:35:49 +0100 Subject: [PATCH 1/6] tests(firestore): use none googleapis android emulator & enable firestore emulator for web --- .github/workflows/firebase_firestore.yaml | 9 ++++++--- .../example/test_driver/cloud_firestore_e2e.dart | 14 ++++++-------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/firebase_firestore.yaml b/.github/workflows/firebase_firestore.yaml index cf784573c2e5..53ffd00792dc 100644 --- a/.github/workflows/firebase_firestore.yaml +++ b/.github/workflows/firebase_firestore.yaml @@ -39,7 +39,9 @@ jobs: with: api-level: 28 arch: x86_64 - target: google_apis + # Firebase Firestore works without Google Play Services, so we don't use the `googleapis` + # emulator target as it's considerably slower on CI. + target: default profile: Nexus 5X script: ./.github/workflows/scripts/drive-example.sh android @@ -71,8 +73,9 @@ jobs: run: ./.github/workflows/scripts/drive-example.sh macos web: - if: github.event_name == 'pull_request' - runs-on: ubuntu-latest + # Using macos instead of ubuntu as Web app can't connect to Firebase Firestore emulator + # when running on ubuntu. + runs-on: macos-latest timeout-minutes: 15 steps: - uses: actions/checkout@v1 diff --git a/packages/cloud_firestore/cloud_firestore/example/test_driver/cloud_firestore_e2e.dart b/packages/cloud_firestore/cloud_firestore/example/test_driver/cloud_firestore_e2e.dart index 3bbe47784732..68f8186b569a 100644 --- a/packages/cloud_firestore/cloud_firestore/example/test_driver/cloud_firestore_e2e.dart +++ b/packages/cloud_firestore/cloud_firestore/example/test_driver/cloud_firestore_e2e.dart @@ -2,27 +2,25 @@ // 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:flutter/foundation.dart'; +import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:drive/drive.dart' as drive; import 'package:firebase_core/firebase_core.dart'; -import 'package:cloud_firestore/cloud_firestore.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter_test/flutter_test.dart'; import 'collection_reference_e2e.dart'; -import 'instance_e2e.dart'; -import 'query_e2e.dart'; -import 'document_reference_e2e.dart'; import 'document_change_e2e.dart'; +import 'document_reference_e2e.dart'; import 'field_value_e2e.dart'; import 'geo_point_e2e.dart'; +import 'instance_e2e.dart'; +import 'query_e2e.dart'; import 'snapshot_metadata_e2e.dart'; import 'timestamp_e2e.dart'; import 'transaction_e2e.dart'; import 'write_batch_e2e.dart'; -// TODO(Salakar): Web can't connect to Firestore emulator in CI, unable to reproduce -// connection issue locally (working fine locally and also for Android/iOS on CI). -bool kUseFirestoreEmulator = !kIsWeb; +bool kUseFirestoreEmulator = true; void testsMain() { setUpAll(() async { From 128e68b074ce3c072441c982194af4cf225344af Mon Sep 17 00:00:00 2001 From: Salakar Date: Tue, 8 Sep 2020 16:51:53 +0100 Subject: [PATCH 2/6] tests(core): use none googleapis android emulator --- .github/workflows/firebase_core.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/firebase_core.yaml b/.github/workflows/firebase_core.yaml index a64555e180c5..eb8b4c779508 100644 --- a/.github/workflows/firebase_core.yaml +++ b/.github/workflows/firebase_core.yaml @@ -34,7 +34,9 @@ jobs: with: api-level: 28 arch: x86_64 - target: google_apis + # Firebase Core works without Google Play Services, so we don't use the `googleapis` + # emulator target as it's considerably slower on CI. + target: default profile: Nexus 5X script: ./.github/workflows/scripts/drive-example.sh android From f27769ae8c412421a98ba68258c5022793eec8db Mon Sep 17 00:00:00 2001 From: Salakar Date: Tue, 8 Sep 2020 16:52:14 +0100 Subject: [PATCH 3/6] tests(analytics): use none googleapis android emulator --- .github/workflows/firebase_analytics.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/firebase_analytics.yaml b/.github/workflows/firebase_analytics.yaml index d208d1d20ce2..761ad91ab9a3 100644 --- a/.github/workflows/firebase_analytics.yaml +++ b/.github/workflows/firebase_analytics.yaml @@ -34,7 +34,9 @@ jobs: with: api-level: 28 arch: x86_64 - target: google_apis + # Firebase Analytics works without Google Play Services, so we don't use the `googleapis` + # emulator target as it's considerably slower on CI. + target: default profile: Nexus 5X script: ./.github/workflows/scripts/drive-example.sh android From 3d199dce12b429f4e45d692436f5a4fbf7f2a910 Mon Sep 17 00:00:00 2001 From: Salakar Date: Tue, 8 Sep 2020 16:52:30 +0100 Subject: [PATCH 4/6] tests(crashlytics): use none googleapis android emulator --- .github/workflows/firebase_crashlytics.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/firebase_crashlytics.yaml b/.github/workflows/firebase_crashlytics.yaml index edd82527fcd1..6e26a8855fd5 100644 --- a/.github/workflows/firebase_crashlytics.yaml +++ b/.github/workflows/firebase_crashlytics.yaml @@ -35,7 +35,9 @@ jobs: with: api-level: 28 arch: x86_64 - target: google_apis + # Firebase Crashlytics works without Google Play Services, so we don't use the `googleapis` + # emulator target as it's considerably slower on CI. + target: default profile: Nexus 5X script: ./.github/workflows/scripts/drive-example.sh android From c8b2d5722eaded1c6f3d8b6a381e18969927aa0e Mon Sep 17 00:00:00 2001 From: Salakar Date: Tue, 8 Sep 2020 16:52:52 +0100 Subject: [PATCH 5/6] tests(database): use none googleapis android emulator --- .github/workflows/firebase_database.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/firebase_database.yaml b/.github/workflows/firebase_database.yaml index ddc393b7af69..e0d5a68344fe 100644 --- a/.github/workflows/firebase_database.yaml +++ b/.github/workflows/firebase_database.yaml @@ -35,7 +35,9 @@ jobs: with: api-level: 28 arch: x86_64 - target: google_apis + # Firebase Database works without Google Play Services, so we don't use the `googleapis` + # emulator target as it's considerably slower on CI. + target: default profile: Nexus 5X script: ./.github/workflows/scripts/drive-example.sh android From 566a374857d61187c824ef6fbdc8c4b6054fcb27 Mon Sep 17 00:00:00 2001 From: Salakar Date: Tue, 8 Sep 2020 19:16:07 +0100 Subject: [PATCH 6/6] tests(storage): use none googleapis android emulator --- .github/workflows/firebase_storage.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/firebase_storage.yaml b/.github/workflows/firebase_storage.yaml index 48d50af5ccf0..74dbc4249df1 100644 --- a/.github/workflows/firebase_storage.yaml +++ b/.github/workflows/firebase_storage.yaml @@ -35,7 +35,9 @@ jobs: with: api-level: 28 arch: x86_64 - target: google_apis + # Firebase Storage works without Google Play Services, so we don't use the `googleapis` + # emulator target as it's considerably slower on CI. + target: default profile: Nexus 5X script: ./.github/workflows/scripts/drive-example.sh android