1// Copyright 2014 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5import 'dart:io' show Platform;
6
7import 'package:path/path.dart' as path;
8
9import '../run_command.dart';
10import '../utils.dart';
11
12Future<void> customerTestingRunner() async {
13 printProgress('${green}Running customer testing$reset');
14 await runCommand('git', const <String>[
15 'fetch',
16 'origin',
17 'master',
18 ], workingDirectory: flutterRoot);
19 await runCommand('git', const <String>[
20 'branch',
21 '-f',
22 'master',
23 'origin/master',
24 ], workingDirectory: flutterRoot);
25 final Map<String, String> env = Platform.environment;
26 final String? revision = env['REVISION'];
27 if (revision != null) {
28 await runCommand('git', <String>['checkout', revision], workingDirectory: flutterRoot);
29 }
30 final String winScript = path.join(flutterRoot, 'dev', 'customer_testing', 'ci.bat');
31 await runCommand(
32 Platform.isWindows ? winScript : './ci.sh',
33 <String>[],
34 workingDirectory: path.join(flutterRoot, 'dev', 'customer_testing'),
35 );
36}
37