Skip to content

Commit

Permalink
Refactor fuchsia_precache (#145978)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
sealesj authored Apr 3, 2024
1 parent a9eff9f commit b304740
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 26 deletions.
31 changes: 31 additions & 0 deletions dev/bots/suite_runners/run_fuchsia_precache.dart
Original file line number Diff line number Diff line change
@@ -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,
);
}
28 changes: 2 additions & 26 deletions dev/bots/test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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');
Expand Down

0 comments on commit b304740

Please sign in to comment.