Unverified Commit e3427550 authored by Ian Hickson's avatar Ian Hickson Committed by GitHub

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.
parent 2bc94f44
[0-9]+:[0-9]+ [+]0: A trivial widget test
[0-9]+:[0-9]+ [+]1: All tests passed! [0-9]+:[0-9]+ [+]1: All tests passed!
...@@ -135,61 +135,52 @@ Future<Null> _analyzeRepo() async { ...@@ -135,61 +135,52 @@ Future<Null> _analyzeRepo() async {
print('${bold}DONE: Analysis successful.$reset'); 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. // Verify that the tests actually return failure on failure and success on success.
final String automatedTests = path.join(flutterRoot, 'dev', 'automated_tests'); final String automatedTests = path.join(flutterRoot, 'dev', 'automated_tests');
await _runFlutterTest(automatedTests, await _runFlutterTest(automatedTests,
script: path.join('test_smoke_test', 'fail_test.dart'), script: path.join('test_smoke_test', 'fail_test.dart'),
options: options,
expectFailure: true, expectFailure: true,
printOutput: false, printOutput: false,
timeout: _kShortTimeout, timeout: _kShortTimeout,
); );
await _runFlutterTest(automatedTests, await _runFlutterTest(automatedTests,
script: path.join('test_smoke_test', 'pass_test.dart'), script: path.join('test_smoke_test', 'pass_test.dart'),
options: options,
printOutput: false, printOutput: false,
timeout: _kShortTimeout, timeout: _kShortTimeout,
); );
await _runFlutterTest(automatedTests, await _runFlutterTest(automatedTests,
script: path.join('test_smoke_test', 'crash1_test.dart'), script: path.join('test_smoke_test', 'crash1_test.dart'),
options: options,
expectFailure: true, expectFailure: true,
printOutput: false, printOutput: false,
timeout: _kShortTimeout, timeout: _kShortTimeout,
); );
await _runFlutterTest(automatedTests, await _runFlutterTest(automatedTests,
script: path.join('test_smoke_test', 'crash2_test.dart'), script: path.join('test_smoke_test', 'crash2_test.dart'),
options: options,
expectFailure: true, expectFailure: true,
printOutput: false, printOutput: false,
timeout: _kShortTimeout, timeout: _kShortTimeout,
); );
await _runFlutterTest(automatedTests, await _runFlutterTest(automatedTests,
script: path.join('test_smoke_test', 'syntax_error_test.broken_dart'), script: path.join('test_smoke_test', 'syntax_error_test.broken_dart'),
options: options,
expectFailure: true, expectFailure: true,
printOutput: false, printOutput: false,
timeout: _kShortTimeout, timeout: _kShortTimeout,
); );
await _runFlutterTest(automatedTests, await _runFlutterTest(automatedTests,
script: path.join('test_smoke_test', 'missing_import_test.broken_dart'), script: path.join('test_smoke_test', 'missing_import_test.broken_dart'),
options: options,
expectFailure: true, expectFailure: true,
printOutput: false, printOutput: false,
timeout: _kShortTimeout, timeout: _kShortTimeout,
); );
await _runFlutterTest(automatedTests, await _runFlutterTest(automatedTests,
script: path.join('test_smoke_test', 'disallow_error_reporter_modification_test.dart'), script: path.join('test_smoke_test', 'disallow_error_reporter_modification_test.dart'),
options: options,
expectFailure: true, expectFailure: true,
printOutput: false, printOutput: false,
timeout: _kShortTimeout, timeout: _kShortTimeout,
); );
await _runCommand(flutter, await _runCommand(flutter,
<String>['drive', '--use-existing-app'] <String>['drive', '--use-existing-app', '-t', path.join('test_driver', 'failure.dart')],
..addAll(options)
..addAll(<String>[ '-t', path.join('test_driver', 'failure.dart')]),
workingDirectory: path.join(flutterRoot, 'packages', 'flutter_driver'), workingDirectory: path.join(flutterRoot, 'packages', 'flutter_driver'),
expectFailure: true, expectFailure: true,
printOutput: false, printOutput: false,
...@@ -200,23 +191,21 @@ Future<Null> _runTests({List<String> options: const <String>[]}) async { ...@@ -200,23 +191,21 @@ Future<Null> _runTests({List<String> options: const <String>[]}) async {
await _verifyVersion(path.join(flutterRoot, 'version')); await _verifyVersion(path.join(flutterRoot, 'version'));
// Run tests. // Run tests.
await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter'), options: options); await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter'));
await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter_localizations'), options: options); await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter_localizations'));
await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter_driver'), options: options); await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter_driver'));
await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter_test'), options: options); await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter_test'));
await _runFlutterTest(path.join(flutterRoot, 'packages', await _runFlutterTest(path.join(flutterRoot, 'packages', 'fuchsia_remote_debug_protocol'));
'fuchsia_remote_debug_protocol'), options: options);
await _pubRunTest(path.join(flutterRoot, 'packages', 'flutter_tools')); await _pubRunTest(path.join(flutterRoot, 'packages', 'flutter_tools'));
await _pubRunTest(path.join(flutterRoot, 'dev', 'bots')); await _pubRunTest(path.join(flutterRoot, 'dev', 'bots'));
await _pubRunTest(path.join(flutterRoot, 'dev', 'devicelab'));
await _runAllDartTests(path.join(flutterRoot, 'dev', 'devicelab'), options: options); await _runFlutterTest(path.join(flutterRoot, 'dev', 'manual_tests'));
await _runFlutterTest(path.join(flutterRoot, 'dev', 'manual_tests'), options: options); await _runFlutterTest(path.join(flutterRoot, 'dev', 'tools', 'vitool'));
await _runFlutterTest(path.join(flutterRoot, 'dev', 'tools', 'vitool'), options: options); await _runFlutterTest(path.join(flutterRoot, 'examples', 'hello_world'));
await _runFlutterTest(path.join(flutterRoot, 'examples', 'hello_world'), options: options); await _runFlutterTest(path.join(flutterRoot, 'examples', 'layers'));
await _runFlutterTest(path.join(flutterRoot, 'examples', 'layers'), options: options); await _runFlutterTest(path.join(flutterRoot, 'examples', 'stocks'));
await _runFlutterTest(path.join(flutterRoot, 'examples', 'stocks'), options: options); await _runFlutterTest(path.join(flutterRoot, 'examples', 'flutter_gallery'));
await _runFlutterTest(path.join(flutterRoot, 'examples', 'flutter_gallery'), options: options); await _runFlutterTest(path.join(flutterRoot, 'examples', 'catalog'));
await _runFlutterTest(path.join(flutterRoot, 'examples', 'catalog'), options: options);
print('${bold}DONE: All tests successful.$reset'); print('${bold}DONE: All tests successful.$reset');
} }
...@@ -256,7 +245,9 @@ Future<Null> _pubRunTest( ...@@ -256,7 +245,9 @@ Future<Null> _pubRunTest(
String workingDirectory, { String workingDirectory, {
String testPath, 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) if (testPath != null)
args.add(testPath); args.add(testPath);
final Map<String, String> pubEnvironment = <String, String>{}; final Map<String, String> pubEnvironment = <String, String>{};
...@@ -393,21 +384,6 @@ Future<Null> _runFlutterTest(String workingDirectory, { ...@@ -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, { Future<Null> _runFlutterAnalyze(String workingDirectory, {
List<String> options: const <String>[] List<String> options: const <String>[]
}) { }) {
......
// 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) { ...@@ -47,7 +47,6 @@ void verifyToStringOutput(String name, String route, String testString) {
} }
Future<Null> smokeDemo(WidgetTester tester, GalleryDemo demo) async { Future<Null> smokeDemo(WidgetTester tester, GalleryDemo demo) async {
print(demo);
// Don't use pumpUntilNoTransientCallbacks in this function, because some of // Don't use pumpUntilNoTransientCallbacks in this function, because some of
// the smoketests have infinitely-running animations (e.g. the progress // the smoketests have infinitely-running animations (e.g. the progress
// indicators demo). // indicators demo).
......
...@@ -128,14 +128,15 @@ class UpdatePackagesCommand extends FlutterCommand { ...@@ -128,14 +128,15 @@ class UpdatePackagesCommand extends FlutterCommand {
if (checksum != pubspec.checksum.value) { if (checksum != pubspec.checksum.value) {
// If the checksum doesn't match, they may have added or removed some dependencies. // 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. // we need to run update-packages to recapture the transitive deps.
printStatus( printError(
'Warning: pubspec in ${directory.path} has invalid dependencies. ' 'Warning: pubspec in ${directory.path} has invalid dependencies. '
'Please run "flutter update-packages" --force-upgrade to update them correctly.' 'Please run "flutter update-packages" --force-upgrade to update them correctly.'
); );
} else { needsUpdate = true;
// everything is correct in the pubspec. } else {
printStatus('pubspec in ${directory.path} is up to date!'); // everything is correct in the pubspec.
} printTrace('pubspec in ${directory.path} is up to date!');
}
} }
if (needsUpdate) { if (needsUpdate) {
throwToolExit( throwToolExit(
...@@ -144,6 +145,7 @@ class UpdatePackagesCommand extends FlutterCommand { ...@@ -144,6 +145,7 @@ class UpdatePackagesCommand extends FlutterCommand {
exitCode: 1, exitCode: 1,
); );
} }
printStatus('All pubspecs were up to date.');
return; return;
} }
......
...@@ -43,16 +43,17 @@ Future<int> runTests( ...@@ -43,16 +43,17 @@ Future<int> runTests(
// Compute the command-line arguments for package:test. // Compute the command-line arguments for package:test.
final List<String> testArgs = <String>[]; final List<String> testArgs = <String>[];
if (!terminal.supportsColor) if (!terminal.supportsColor) {
testArgs.addAll(<String>['--no-color', '-rexpanded']); testArgs.addAll(<String>['--no-color']);
}
if (machine) { if (machine) {
testArgs.addAll(<String>['-r', 'json']); testArgs.addAll(<String>['-r', 'json']);
} else {
testArgs.addAll(<String>['-r', 'compact']);
} }
if (enableObservatory) { if (enableObservatory) { // (In particular, for collecting code coverage.)
// (In particular, for collecting code coverage.)
// Turn on concurrency, but just barely. This is a trade-off between running // 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 // 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 // the tests overall take too much time. The current number is empirically
......
...@@ -132,7 +132,6 @@ void main() { ...@@ -132,7 +132,6 @@ void main() {
final AndroidSdk sdk = AndroidSdk.locateAndroidSdk(); final AndroidSdk sdk = AndroidSdk.locateAndroidSdk();
expect(sdk.directory, realSdkDir); expect(sdk.directory, realSdkDir);
print(AndroidNdk.explainMissingNdk(sdk.directory));
expect(sdk.ndk, isNotNull); expect(sdk.ndk, isNotNull);
expect(sdk.ndk.directory, realNdkDir); expect(sdk.ndk.directory, realNdkDir);
expect(sdk.ndk.compiler, realNdkCompiler); expect(sdk.ndk.compiler, realNdkCompiler);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment