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:
parent
2bc94f44c8
commit
e3427550e9
@ -1,2 +1 @@
|
||||
[0-9]+:[0-9]+ [+]0: A trivial widget test
|
||||
[0-9]+:[0-9]+ [+]1: All tests passed!
|
||||
|
@ -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>[]
|
||||
}) {
|
||||
|
@ -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();
|
||||
}
|
@ -47,7 +47,6 @@ void verifyToStringOutput(String name, String route, String testString) {
|
||||
}
|
||||
|
||||
Future<Null> smokeDemo(WidgetTester tester, GalleryDemo demo) async {
|
||||
print(demo);
|
||||
// Don't use pumpUntilNoTransientCallbacks in this function, because some of
|
||||
// the smoketests have infinitely-running animations (e.g. the progress
|
||||
// indicators demo).
|
||||
|
@ -128,13 +128,14 @@ class UpdatePackagesCommand extends FlutterCommand {
|
||||
if (checksum != pubspec.checksum.value) {
|
||||
// If the checksum doesn't match, they may have added or removed some dependencies.
|
||||
// we need to run update-packages to recapture the transitive deps.
|
||||
printStatus(
|
||||
printError(
|
||||
'Warning: pubspec in ${directory.path} has invalid dependencies. '
|
||||
'Please run "flutter update-packages" --force-upgrade to update them correctly.'
|
||||
);
|
||||
needsUpdate = true;
|
||||
} else {
|
||||
// everything is correct in the pubspec.
|
||||
printStatus('pubspec in ${directory.path} is up to date!');
|
||||
printTrace('pubspec in ${directory.path} is up to date!');
|
||||
}
|
||||
}
|
||||
if (needsUpdate) {
|
||||
@ -144,6 +145,7 @@ class UpdatePackagesCommand extends FlutterCommand {
|
||||
exitCode: 1,
|
||||
);
|
||||
}
|
||||
printStatus('All pubspecs were up to date.');
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -43,16 +43,17 @@ Future<int> runTests(
|
||||
|
||||
// Compute the command-line arguments for package:test.
|
||||
final List<String> testArgs = <String>[];
|
||||
if (!terminal.supportsColor)
|
||||
testArgs.addAll(<String>['--no-color', '-rexpanded']);
|
||||
if (!terminal.supportsColor) {
|
||||
testArgs.addAll(<String>['--no-color']);
|
||||
}
|
||||
|
||||
if (machine) {
|
||||
testArgs.addAll(<String>['-r', 'json']);
|
||||
} else {
|
||||
testArgs.addAll(<String>['-r', 'compact']);
|
||||
}
|
||||
|
||||
if (enableObservatory) {
|
||||
// (In particular, for collecting code coverage.)
|
||||
|
||||
if (enableObservatory) { // (In particular, for collecting code coverage.)
|
||||
// Turn on concurrency, but just barely. This is a trade-off between running
|
||||
// too many tests such that they all time out, and too few tests such that
|
||||
// the tests overall take too much time. The current number is empirically
|
||||
|
@ -132,7 +132,6 @@ void main() {
|
||||
|
||||
final AndroidSdk sdk = AndroidSdk.locateAndroidSdk();
|
||||
expect(sdk.directory, realSdkDir);
|
||||
print(AndroidNdk.explainMissingNdk(sdk.directory));
|
||||
expect(sdk.ndk, isNotNull);
|
||||
expect(sdk.ndk.directory, realNdkDir);
|
||||
expect(sdk.ndk.compiler, realNdkCompiler);
|
||||
|
Loading…
x
Reference in New Issue
Block a user