Skip to content

test(cloud_firestore, android): skip end 2 end test that is timing out on CI #9361

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 18, 2022
Merged
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter_test/flutter_test.dart';

import 'firebase_options_secondary.dart';
Expand All @@ -24,26 +25,31 @@ void runSecondAppTests() {
);
});

group('Secondary app Firestore instance', () {
test(
'Second Firestore instance should fail due to firestore.rules forbidding data writes',
() async {
// successful write on default app instance
await firestore
.collection('flutter-tests/banned/doc')
.add({'foo': 'bar'});

// permission denied on second app with Firebase that denies database writes
await expectLater(
secondFirestoreProject
group(
'Secondary app Firestore instance',
() {
test(
'Second Firestore instance should fail due to firestore.rules forbidding data writes',
() async {
// successful write on default app instance
await firestore
.collection('flutter-tests/banned/doc')
.add({'foo': 'bar'}),
throwsA(
isA<FirebaseException>()
.having((e) => e.code, 'code', 'permission-denied'),
),
);
});
});
.add({'foo': 'bar'});

// permission denied on second app with Firebase that denies database writes
await expectLater(
secondFirestoreProject
.collection('flutter-tests/banned/doc')
.add({'foo': 'bar'}),
throwsA(
isA<FirebaseException>()
.having((e) => e.code, 'code', 'permission-denied'),
),
);
});
},
// Skip on android because the test continually times out on the CI. The test passes when running locally.
skip: defaultTargetPlatform == TargetPlatform.android,
);
});
}