Be less verbose in the logs. (#17401)

Now that we have thousands of tests, it doesn't make sense to display a separate line for each test. The result is just megabytes of logs that you have to scrub through to find error messages.
This commit is contained in:
Ian Hickson
2018-06-04 15:22:19 -07:00
committed by GitHub
parent 2bc94f44c8
commit e3427550e9
7 changed files with 31 additions and 68 deletions

View File

@@ -1,2 +1 @@
[0-9]+:[0-9]+ [+]0: A trivial widget test
[0-9]+:[0-9]+ [+]1: All tests passed!

View File

@@ -135,61 +135,52 @@ Future<Null> _analyzeRepo() async {
print('${bold}DONE: Analysis successful.$reset');
}
Future<Null> _runTests({List<String> options: const <String>[]}) async {
Future<Null> _runTests() async {
// Verify that the tests actually return failure on failure and success on success.
final String automatedTests = path.join(flutterRoot, 'dev', 'automated_tests');
await _runFlutterTest(automatedTests,
script: path.join('test_smoke_test', 'fail_test.dart'),
options: options,
expectFailure: true,
printOutput: false,
timeout: _kShortTimeout,
);
await _runFlutterTest(automatedTests,
script: path.join('test_smoke_test', 'pass_test.dart'),
options: options,
printOutput: false,
timeout: _kShortTimeout,
);
await _runFlutterTest(automatedTests,
script: path.join('test_smoke_test', 'crash1_test.dart'),
options: options,
expectFailure: true,
printOutput: false,
timeout: _kShortTimeout,
);
await _runFlutterTest(automatedTests,
script: path.join('test_smoke_test', 'crash2_test.dart'),
options: options,
expectFailure: true,
printOutput: false,
timeout: _kShortTimeout,
);
await _runFlutterTest(automatedTests,
script: path.join('test_smoke_test', 'syntax_error_test.broken_dart'),
options: options,
expectFailure: true,
printOutput: false,
timeout: _kShortTimeout,
);
await _runFlutterTest(automatedTests,
script: path.join('test_smoke_test', 'missing_import_test.broken_dart'),
options: options,
expectFailure: true,
printOutput: false,
timeout: _kShortTimeout,
);
await _runFlutterTest(automatedTests,
script: path.join('test_smoke_test', 'disallow_error_reporter_modification_test.dart'),
options: options,
expectFailure: true,
printOutput: false,
timeout: _kShortTimeout,
);
await _runCommand(flutter,
<String>['drive', '--use-existing-app']
..addAll(options)
..addAll(<String>[ '-t', path.join('test_driver', 'failure.dart')]),
<String>['drive', '--use-existing-app', '-t', path.join('test_driver', 'failure.dart')],
workingDirectory: path.join(flutterRoot, 'packages', 'flutter_driver'),
expectFailure: true,
printOutput: false,
@@ -200,23 +191,21 @@ Future<Null> _runTests({List<String> options: const <String>[]}) async {
await _verifyVersion(path.join(flutterRoot, 'version'));
// Run tests.
await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter'), options: options);
await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter_localizations'), options: options);
await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter_driver'), options: options);
await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter_test'), options: options);
await _runFlutterTest(path.join(flutterRoot, 'packages',
'fuchsia_remote_debug_protocol'), options: options);
await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter'));
await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter_localizations'));
await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter_driver'));
await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter_test'));
await _runFlutterTest(path.join(flutterRoot, 'packages', 'fuchsia_remote_debug_protocol'));
await _pubRunTest(path.join(flutterRoot, 'packages', 'flutter_tools'));
await _pubRunTest(path.join(flutterRoot, 'dev', 'bots'));
await _runAllDartTests(path.join(flutterRoot, 'dev', 'devicelab'), options: options);
await _runFlutterTest(path.join(flutterRoot, 'dev', 'manual_tests'), options: options);
await _runFlutterTest(path.join(flutterRoot, 'dev', 'tools', 'vitool'), options: options);
await _runFlutterTest(path.join(flutterRoot, 'examples', 'hello_world'), options: options);
await _runFlutterTest(path.join(flutterRoot, 'examples', 'layers'), options: options);
await _runFlutterTest(path.join(flutterRoot, 'examples', 'stocks'), options: options);
await _runFlutterTest(path.join(flutterRoot, 'examples', 'flutter_gallery'), options: options);
await _runFlutterTest(path.join(flutterRoot, 'examples', 'catalog'), options: options);
await _pubRunTest(path.join(flutterRoot, 'dev', 'devicelab'));
await _runFlutterTest(path.join(flutterRoot, 'dev', 'manual_tests'));
await _runFlutterTest(path.join(flutterRoot, 'dev', 'tools', 'vitool'));
await _runFlutterTest(path.join(flutterRoot, 'examples', 'hello_world'));
await _runFlutterTest(path.join(flutterRoot, 'examples', 'layers'));
await _runFlutterTest(path.join(flutterRoot, 'examples', 'stocks'));
await _runFlutterTest(path.join(flutterRoot, 'examples', 'flutter_gallery'));
await _runFlutterTest(path.join(flutterRoot, 'examples', 'catalog'));
print('${bold}DONE: All tests successful.$reset');
}
@@ -256,7 +245,9 @@ Future<Null> _pubRunTest(
String workingDirectory, {
String testPath,
}) {
final List<String> args = <String>['run', 'test', '-j1', '-rexpanded'];
final List<String> args = <String>['run', 'test', '-j1', '-rcompact'];
if (!hasColor)
args.add('--no-color');
if (testPath != null)
args.add(testPath);
final Map<String, String> pubEnvironment = <String, String>{};
@@ -393,21 +384,6 @@ Future<Null> _runFlutterTest(String workingDirectory, {
);
}
Future<Null> _runAllDartTests(String workingDirectory, {
Map<String, String> environment,
List<String> options,
}) {
final List<String> args = <String>['--preview-dart-2'];
if (options != null) {
args.addAll(options);
}
args.add(path.join('test', 'all.dart'));
return _runCommand(dart, args,
workingDirectory: workingDirectory,
environment: environment,
);
}
Future<Null> _runFlutterAnalyze(String workingDirectory, {
List<String> options: const <String>[]
}) {

View File

@@ -1,13 +0,0 @@
// Copyright 2016 The Chromium 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 'adb_test.dart' as adb_test;
import 'manifest_test.dart' as manifest_test;
import 'run_test.dart' as run_test;
void main() {
adb_test.main();
manifest_test.main();
run_test.main();
}