Refactor docs (#145998)

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

Part of https://github.com/flutter/flutter/issues/145482
This commit is contained in:
Jesse 2024-04-02 19:26:51 -04:00 committed by GitHub
parent 5705881f63
commit 8b83371e20
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 22 additions and 17 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 '../run_command.dart';
import '../utils.dart';
Future<void> docsRunner(String flutterRoot) async {
printProgress('${green}Running flutter doc tests$reset');
await runCommand(
'./dev/bots/docs.sh',
const <String>[
'--output',
'dev/docs/api_docs.zip',
'--keep-staging',
'--staging-dir',
'dev/docs',
],
workingDirectory: flutterRoot,
);}

View File

@ -66,6 +66,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_docs_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';
@ -255,7 +256,7 @@ Future<void> main(List<String> args) async {
'customer_testing': _runCustomerTesting,
'analyze': () => analyzeRunner(flutterRoot),
'fuchsia_precache': _runFuchsiaPrecache,
'docs': _runDocs,
'docs': () => docsRunner(flutterRoot),
'verify_binaries_codesigned': _runVerifyCodesigned,
kTestHarnessShardName: _runTestHarnessTests, // Used for testing this script; also run as part of SHARD=framework_tests, SUBSHARD=misc.
});
@ -1264,22 +1265,6 @@ Future<void> _runFuchsiaPrecache() async {
);
}
// Runs docs.
Future<void> _runDocs() async {
printProgress('${green}Running flutter doc tests$reset');
await runCommand(
'./dev/bots/docs.sh',
<String>[
'--output',
'dev/docs/api_docs.zip',
'--keep-staging',
'--staging-dir',
'dev/docs',
],
workingDirectory: flutterRoot,
);
}
// Verifies binaries are codesigned.
Future<void> _runVerifyCodesigned() async {
printProgress('${green}Running binaries codesign verification$reset');