Skip to content

Commit bc65b15

Browse files
russellwheatleySalakar
authored andcommitted
ci: Firestore e2e tests are failing. Suspected clash via different platforms using live database (#11511)
1 parent 4b9e366 commit bc65b15

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

packages/cloud_firestore/cloud_firestore/example/integration_test/second_database.dart

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright 2020, the Chromium project authors. Please see the AUTHORS file
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
4-
4+
import 'dart:io';
55
import 'dart:async';
66
import 'dart:math';
77

@@ -10,6 +10,22 @@ import 'package:firebase_core/firebase_core.dart';
1010
import 'package:flutter/foundation.dart';
1111
import 'package:flutter_test/flutter_test.dart';
1212

13+
String getCurrentPlatform() {
14+
if (kIsWeb) {
15+
return 'web';
16+
} else if (Platform.isAndroid) {
17+
return 'android';
18+
} else if (Platform.isIOS) {
19+
return 'ios';
20+
} else if (Platform.isMacOS) {
21+
return 'macos';
22+
} else if (Platform.isWindows) {
23+
return 'windows';
24+
} else {
25+
return 'unknown';
26+
}
27+
}
28+
1329
void runSecondDatabaseTests() {
1430
group('Second Database', () {
1531
late FirebaseFirestore firestore;
@@ -26,8 +42,11 @@ void runSecondDatabaseTests() {
2642
) async {
2743
// Pushed rules which only allow database "flutterfire-2" to have "flutterfire-2" collection writes
2844
String collectionForSecondDatabase = 'flutterfire-2';
45+
2946
CollectionReference<Map<String, dynamic>> collection =
30-
firestore.collection('$collectionForSecondDatabase/$id/query-tests');
47+
firestore.collection(
48+
'$collectionForSecondDatabase/$id/${getCurrentPlatform()}',
49+
);
3150
QuerySnapshot<Map<String, dynamic>> snapshot = await collection.get();
3251

3352
await Future.forEach(snapshot.docs,

0 commit comments

Comments
 (0)