mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
Refactor customer_testing (#145911)
Refactor customer_testing suite in order to reduce testing logic in test.dart and allow for later implementing package:test onto the existing customer_testing tests Part of https://github.com/flutter/flutter/issues/145482 *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
This commit is contained in:
parent
80d774d8dc
commit
113013bb07
51
dev/bots/suite_runners/run_customer_testing_tests.dart
Normal file
51
dev/bots/suite_runners/run_customer_testing_tests.dart
Normal file
@ -0,0 +1,51 @@
|
||||
// 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 'dart:io' show Platform;
|
||||
|
||||
import 'package:path/path.dart' as path;
|
||||
|
||||
import '../run_command.dart';
|
||||
import '../utils.dart';
|
||||
|
||||
Future<void> customerTestingRunner(String flutterRoot) async {
|
||||
printProgress('${green}Running customer testing$reset');
|
||||
await runCommand(
|
||||
'git',
|
||||
const <String>[
|
||||
'fetch',
|
||||
'origin',
|
||||
'master',
|
||||
],
|
||||
workingDirectory: flutterRoot,
|
||||
);
|
||||
await runCommand(
|
||||
'git',
|
||||
const <String>[
|
||||
'branch',
|
||||
'-f',
|
||||
'master',
|
||||
'origin/master',
|
||||
],
|
||||
workingDirectory: flutterRoot,
|
||||
);
|
||||
final Map<String, String> env = Platform.environment;
|
||||
final String? revision = env['REVISION'];
|
||||
if (revision != null) {
|
||||
await runCommand(
|
||||
'git',
|
||||
<String>[
|
||||
'checkout',
|
||||
revision,
|
||||
],
|
||||
workingDirectory: flutterRoot,
|
||||
);
|
||||
}
|
||||
final String winScript = path.join(flutterRoot, 'dev', 'customer_testing', 'ci.bat');
|
||||
await runCommand(
|
||||
Platform.isWindows? winScript: './ci.sh',
|
||||
<String>[],
|
||||
workingDirectory: path.join(flutterRoot, 'dev', 'customer_testing'),
|
||||
);
|
||||
}
|
@ -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_customer_testing_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';
|
||||
@ -253,7 +254,7 @@ Future<void> main(List<String> args) async {
|
||||
'flutter_plugins': () => flutterPackagesRunner(flutterRoot),
|
||||
'skp_generator': skpGeneratorTestsRunner,
|
||||
'realm_checker': () => realmCheckerTestRunner(flutterRoot),
|
||||
'customer_testing': _runCustomerTesting,
|
||||
'customer_testing': () => customerTestingRunner(flutterRoot),
|
||||
'analyze': () => analyzeRunner(flutterRoot),
|
||||
'fuchsia_precache': _runFuchsiaPrecache,
|
||||
'docs': () => docsRunner(flutterRoot),
|
||||
@ -1198,48 +1199,6 @@ Future<void> _runWebUnitTests(String webRenderer, bool useWasm) async {
|
||||
await selectSubshard(subshards);
|
||||
}
|
||||
|
||||
// Runs customer_testing.
|
||||
Future<void> _runCustomerTesting() async {
|
||||
printProgress('${green}Running customer testing$reset');
|
||||
await runCommand(
|
||||
'git',
|
||||
<String>[
|
||||
'fetch',
|
||||
'origin',
|
||||
'master',
|
||||
],
|
||||
workingDirectory: flutterRoot,
|
||||
);
|
||||
await runCommand(
|
||||
'git',
|
||||
<String>[
|
||||
'branch',
|
||||
'-f',
|
||||
'master',
|
||||
'origin/master',
|
||||
],
|
||||
workingDirectory: flutterRoot,
|
||||
);
|
||||
final Map<String, String> env = Platform.environment;
|
||||
final String? revision = env['REVISION'];
|
||||
if (revision != null) {
|
||||
await runCommand(
|
||||
'git',
|
||||
<String>[
|
||||
'checkout',
|
||||
revision,
|
||||
],
|
||||
workingDirectory: flutterRoot,
|
||||
);
|
||||
}
|
||||
final String winScript = path.join(flutterRoot, 'dev', 'customer_testing', 'ci.bat');
|
||||
await runCommand(
|
||||
Platform.isWindows? winScript: './ci.sh',
|
||||
<String>[],
|
||||
workingDirectory: path.join(flutterRoot, 'dev', 'customer_testing'),
|
||||
);
|
||||
}
|
||||
|
||||
// Runs flutter_precache.
|
||||
Future<void> _runFuchsiaPrecache() async {
|
||||
printProgress('${green}Running flutter precache tests$reset');
|
||||
|
Loading…
Reference in New Issue
Block a user