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 https://github.com/flutter/flutter/issues/145482
This commit is contained in:
Jesse 2024-04-03 14:49:07 -04:00 committed by GitHub
parent a9eff9f4f4
commit b304740076
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 33 additions and 26 deletions

View File

@ -0,0 +1,31 @@
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import '../run_command.dart';
import '../utils.dart';
// Runs flutter_precache.
Future<void> fuchsiaPrecacheRunner(String flutterRoot) async {
printProgress('${green}Running flutter precache tests$reset');
await runCommand(
'flutter',
const <String>[
'config',
'--enable-fuchsia',
],
workingDirectory: flutterRoot,
);
await runCommand(
'flutter',
const <String>[
'precache',
'--flutter_runner',
'--fuchsia',
'--no-android',
'--no-ios',
'--force',
],
workingDirectory: flutterRoot,
);
}

View File

@ -69,6 +69,7 @@ import 'suite_runners/run_analyze_tests.dart';
import 'suite_runners/run_customer_testing_tests.dart';
import 'suite_runners/run_docs_tests.dart';
import 'suite_runners/run_flutter_packages_tests.dart';
import 'suite_runners/run_fuchsia_precache.dart';
import 'suite_runners/run_realm_checker_tests.dart';
import 'suite_runners/run_skp_generator_tests.dart';
import 'suite_runners/run_web_long_running_tests.dart';
@ -256,7 +257,7 @@ Future<void> main(List<String> args) async {
'realm_checker': () => realmCheckerTestRunner(flutterRoot),
'customer_testing': () => customerTestingRunner(flutterRoot),
'analyze': () => analyzeRunner(flutterRoot),
'fuchsia_precache': _runFuchsiaPrecache,
'fuchsia_precache': () => fuchsiaPrecacheRunner(flutterRoot),
'docs': () => docsRunner(flutterRoot),
'verify_binaries_codesigned': _runVerifyCodesigned,
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 {
await selectSubshard(subshards);
}
// Runs flutter_precache.
Future<void> _runFuchsiaPrecache() async {
printProgress('${green}Running flutter precache tests$reset');
await runCommand(
'flutter',
<String>[
'config',
'--enable-fuchsia',
],
workingDirectory: flutterRoot,
);
await runCommand(
'flutter',
<String>[
'precache',
'--flutter_runner',
'--fuchsia',
'--no-android',
'--no-ios',
'--force',
],
workingDirectory: flutterRoot,
);
}
// Verifies binaries are codesigned.
Future<void> _runVerifyCodesigned() async {
printProgress('${green}Running binaries codesign verification$reset');