Skip to content

Commit b304740

Browse files
authored
Refactor fuchsia_precache (#145978)
Refactor fuchsia_precache suite in order to reduce testing logic in test.dart and allow for later implementing package:test onto the existing fuchsia_precache tests Part of flutter/flutter#145482
1 parent a9eff9f commit b304740

2 files changed

Lines changed: 33 additions & 26 deletions

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Copyright 2014 The Flutter Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
import '../run_command.dart';
6+
import '../utils.dart';
7+
8+
// Runs flutter_precache.
9+
Future<void> fuchsiaPrecacheRunner(String flutterRoot) async {
10+
printProgress('${green}Running flutter precache tests$reset');
11+
await runCommand(
12+
'flutter',
13+
const <String>[
14+
'config',
15+
'--enable-fuchsia',
16+
],
17+
workingDirectory: flutterRoot,
18+
);
19+
await runCommand(
20+
'flutter',
21+
const <String>[
22+
'precache',
23+
'--flutter_runner',
24+
'--fuchsia',
25+
'--no-android',
26+
'--no-ios',
27+
'--force',
28+
],
29+
workingDirectory: flutterRoot,
30+
);
31+
}

dev/bots/test.dart

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ import 'suite_runners/run_analyze_tests.dart';
6969
import 'suite_runners/run_customer_testing_tests.dart';
7070
import 'suite_runners/run_docs_tests.dart';
7171
import 'suite_runners/run_flutter_packages_tests.dart';
72+
import 'suite_runners/run_fuchsia_precache.dart';
7273
import 'suite_runners/run_realm_checker_tests.dart';
7374
import 'suite_runners/run_skp_generator_tests.dart';
7475
import 'suite_runners/run_web_long_running_tests.dart';
@@ -256,7 +257,7 @@ Future<void> main(List<String> args) async {
256257
'realm_checker': () => realmCheckerTestRunner(flutterRoot),
257258
'customer_testing': () => customerTestingRunner(flutterRoot),
258259
'analyze': () => analyzeRunner(flutterRoot),
259-
'fuchsia_precache': _runFuchsiaPrecache,
260+
'fuchsia_precache': () => fuchsiaPrecacheRunner(flutterRoot),
260261
'docs': () => docsRunner(flutterRoot),
261262
'verify_binaries_codesigned': _runVerifyCodesigned,
262263
kTestHarnessShardName: _runTestHarnessTests, // Used for testing this script; also run as part of SHARD=framework_tests, SUBSHARD=misc.
@@ -1199,31 +1200,6 @@ Future<void> _runWebUnitTests(String webRenderer, bool useWasm) async {
11991200
await selectSubshard(subshards);
12001201
}
12011202

1202-
// Runs flutter_precache.
1203-
Future<void> _runFuchsiaPrecache() async {
1204-
printProgress('${green}Running flutter precache tests$reset');
1205-
await runCommand(
1206-
'flutter',
1207-
<String>[
1208-
'config',
1209-
'--enable-fuchsia',
1210-
],
1211-
workingDirectory: flutterRoot,
1212-
);
1213-
await runCommand(
1214-
'flutter',
1215-
<String>[
1216-
'precache',
1217-
'--flutter_runner',
1218-
'--fuchsia',
1219-
'--no-android',
1220-
'--no-ios',
1221-
'--force',
1222-
],
1223-
workingDirectory: flutterRoot,
1224-
);
1225-
}
1226-
12271203
// Verifies binaries are codesigned.
12281204
Future<void> _runVerifyCodesigned() async {
12291205
printProgress('${green}Running binaries codesign verification$reset');

0 commit comments

Comments
 (0)