Skip to content

Commit 0b14f1b

Browse files
committed
fix ci
1 parent 41f97df commit 0b14f1b

3 files changed

Lines changed: 25 additions & 9 deletions

File tree

packages/cloud_firestore/cloud_firestore/pipeline_example/integration_test/pipeline/pipeline_execute_options_e2e.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
import 'package:cloud_firestore/cloud_firestore.dart';
66
import 'package:firebase_core/firebase_core.dart';
7-
import 'package:flutter/foundation.dart'
8-
show defaultTargetPlatform, TargetPlatform;
97
import 'package:flutter_test/flutter_test.dart';
108

119
import 'pipeline_test_helpers.dart';

packages/cloud_firestore/cloud_firestore/pipeline_example/lib/main.dart

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import 'dart:typed_data';
2+
13
import 'package:cloud_firestore/cloud_firestore.dart';
24
import 'package:firebase_core/firebase_core.dart';
35
import 'package:flutter/material.dart';
@@ -12,7 +14,6 @@ Future<void> main() async {
1214
WidgetsFlutterBinding.ensureInitialized();
1315
await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
1416
if (shouldUseFirestoreEmulator) {
15-
print('Using Firestore emulator');
1617
FirebaseFirestore.instance.useFirestoreEmulator('localhost', 8080);
1718
}
1819
runApp(const PipelineExampleApp());
@@ -66,7 +67,7 @@ class _PipelineExamplePageState extends State<PipelineExamplePage> {
6667

6768
try {
6869
final col = _firestore.collection(_collectionId);
69-
70+
7071
final batch = _firestore.batch();
7172
_seedDocRefs = [];
7273

@@ -224,6 +225,22 @@ class _PipelineExamplePageState extends State<PipelineExamplePage> {
224225
.execute(),
225226
);
226227

228+
// 1b: execute with ExecuteOptions (indexMode: recommended)
229+
Future<void> _runPipelineExecuteOptions() => _runPipeline(
230+
'Pipeline 1b: same as 1 but execute(options: ExecuteOptions(indexMode: recommended))',
231+
() => _firestore
232+
.pipeline()
233+
.collection(_collectionId)
234+
.where(
235+
Expression.field('score').greaterThan(Expression.constant(10)))
236+
.limit(3)
237+
.execute(
238+
options: const ExecuteOptions(
239+
indexMode: IndexMode.recommended,
240+
),
241+
),
242+
);
243+
227244
// 2: select
228245
Future<void> _runPipeline2() => _runPipeline(
229246
'Pipeline 2: collection → where(year > 2022) → select(title, score, year) → limit(4)',
@@ -464,8 +481,8 @@ class _PipelineExamplePageState extends State<PipelineExamplePage> {
464481
Constant(const GeoPoint(37.7749, -122.4194)).as('c_geo_point'),
465482
// List<int> (raw bytes)
466483
Constant(<int>[72, 101, 108, 108, 111]).as('c_bytes'),
467-
// Blob
468-
Constant(Blob(Uint8List.fromList([1, 2, 3, 4, 5]))).as('c_blob'),
484+
// // Blob
485+
// Constant(Blob(Uint8List.fromList([1, 2, 3, 4, 5]))).as('c_blob'),
469486
// DocumentReference
470487
Constant(docRef).as('c_doc_ref'),
471488
)
@@ -521,7 +538,7 @@ class _PipelineExamplePageState extends State<PipelineExamplePage> {
521538
'Pipeline 21: collection → where(tags arrayContainsAny [x, z]) → select(title, tags) → limit(5)',
522539
() => _firestore
523540
.pipeline()
524-
.collection(_collectionId)
541+
.collection(_collectionId)
525542
.where(
526543
Expression.field('tags').arrayContainsAny(['x', 'z']),
527544
)
@@ -963,6 +980,7 @@ class _PipelineExamplePageState extends State<PipelineExamplePage> {
963980
runSpacing: 8,
964981
children: [
965982
_btn('1: where+limit', _runPipeline1),
983+
_btn('1b: execute(options)', _runPipelineExecuteOptions),
966984
_btn('2: select', _runPipeline2),
967985
_btn('3: aggregate', _runPipeline3),
968986
_btn('4: addFields', _runPipeline4),
@@ -1057,4 +1075,4 @@ class PipelineExamplePage extends StatefulWidget {
10571075

10581076
@override
10591077
State<PipelineExamplePage> createState() => _PipelineExamplePageState();
1060-
}
1078+
}

packages/cloud_firestore/cloud_firestore/pipeline_example/test/widget_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import 'package:pipeline_example/main.dart';
1313
void main() {
1414
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
1515
// Build our app and trigger a frame.
16-
await tester.pumpWidget(const MyApp());
16+
await tester.pumpWidget(const PipelineExampleApp());
1717

1818
// Verify that our counter starts at 0.
1919
expect(find.text('0'), findsOneWidget);

0 commit comments

Comments
 (0)