Refactor analyze (#146138)

Refactor the analyze testing suite in order to reduce testing logic in test.dart and allow for later implementing package:test onto the existing analyze tests

Part of https://github.com/flutter/flutter/issues/145482
This commit is contained in:
Jesse 2024-04-02 17:13:14 -04:00 committed by GitHub
parent 2a37c6f307
commit d35c2553ae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 22 additions and 14 deletions

View File

@ -0,0 +1,20 @@
// 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 'package:path/path.dart' as path;
import '../run_command.dart';
import '../utils.dart';
Future<void> analyzeRunner(String flutterRoot) async {
printProgress('${green}Running analysis testing$reset');
await runCommand(
'dart',
<String>[
'--enable-asserts',
path.join(flutterRoot, 'dev', 'bots', 'analyze.dart'),
],
workingDirectory: flutterRoot,
);
}

View File

@ -65,6 +65,7 @@ import 'package:process/process.dart';
import 'run_command.dart';
import 'suite_runners/run_add_to_app_life_cycle_tests.dart';
import 'suite_runners/run_analyze_tests.dart';
import 'suite_runners/run_flutter_packages_tests.dart';
import 'suite_runners/run_realm_checker_tests.dart';
import 'suite_runners/run_skp_generator_tests.dart';
@ -252,7 +253,7 @@ Future<void> main(List<String> args) async {
'skp_generator': skpGeneratorTestsRunner,
'realm_checker': () => realmCheckerTestRunner(flutterRoot),
'customer_testing': _runCustomerTesting,
'analyze': _runAnalyze,
'analyze': () => analyzeRunner(flutterRoot),
'fuchsia_precache': _runFuchsiaPrecache,
'docs': _runDocs,
'verify_binaries_codesigned': _runVerifyCodesigned,
@ -1238,19 +1239,6 @@ Future<void> _runCustomerTesting() async {
);
}
// Runs analysis tests.
Future<void> _runAnalyze() async {
printProgress('${green}Running analysis testing$reset');
await runCommand(
'dart',
<String>[
'--enable-asserts',
path.join(flutterRoot, 'dev', 'bots', 'analyze.dart'),
],
workingDirectory: flutterRoot,
);
}
// Runs flutter_precache.
Future<void> _runFuchsiaPrecache() async {
printProgress('${green}Running flutter precache tests$reset');