From 2b20345bb8dc6d12ad431303c257a1041ba5d472 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Wed, 10 Jul 2019 08:48:01 -0700 Subject: [PATCH] use pub run for create test and remove [INFO] logs (#35839) --- dev/bots/run_command.dart | 10 ++++++++-- dev/bots/test.dart | 8 ++++++-- packages/flutter_tools/dart_test.yaml | 5 +++++ 3 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 packages/flutter_tools/dart_test.yaml diff --git a/dev/bots/run_command.dart b/dev/bots/run_command.dart index c97a08136d..83cf52ae7b 100644 --- a/dev/bots/run_command.dart +++ b/dev/bots/run_command.dart @@ -87,6 +87,7 @@ Future runCommand(String executable, List arguments, { bool skip = false, bool expectFlaky = false, Duration timeout = _kLongTimeout, + bool Function(String) removeLine, }) async { final String commandDescription = '${path.relative(executable, from: workingDirectory)} ${arguments.join(' ')}'; final String relativeWorkingDir = path.relative(workingDirectory); @@ -103,13 +104,18 @@ Future runCommand(String executable, List arguments, { ); Future>> savedStdout, savedStderr; + final Stream> stdoutSource = process.stdout + .transform(const Utf8Decoder()) + .transform(const LineSplitter()) + .where((String line) => removeLine == null || !removeLine(line)) + .transform(const Utf8Encoder()); if (printOutput) { await Future.wait(>[ - stdout.addStream(process.stdout), + stdout.addStream(stdoutSource), stderr.addStream(process.stderr), ]); } else { - savedStdout = process.stdout.toList(); + savedStdout = stdoutSource.toList(); savedStderr = process.stderr.toList(); } diff --git a/dev/bots/test.dart b/dev/bots/test.dart index 19256fcdb4..fc739f1a96 100644 --- a/dev/bots/test.dart +++ b/dev/bots/test.dart @@ -240,7 +240,8 @@ Future _runToolTests() async { File(path.join(flutterRoot, 'bin', 'cache', 'flutter_tools.snapshot')).deleteSync(); File(path.join(flutterRoot, 'bin', 'cache', 'flutter_tools.stamp')).deleteSync(); } - if (noUseBuildRunner) { + // reduce overhead of build_runner in the create case. + if (noUseBuildRunner || Platform.environment['SUBSHARD'] == 'create') { await _pubRunTest( path.join(flutterRoot, 'packages', 'flutter_tools'), tableData: bigqueryApi?.tabledata, @@ -591,6 +592,9 @@ Future _pubRunTest( case 'tool': args.addAll(['--exclude-tags', 'integration']); break; + case 'create': + args.addAll([path.join('test', 'commands', 'create_test.dart')]); + break; } if (useFlutterTestFormatter) { @@ -606,7 +610,7 @@ Future _pubRunTest( await runCommand( pub, args, - workingDirectory:workingDirectory, + workingDirectory: workingDirectory, ); } } diff --git a/packages/flutter_tools/dart_test.yaml b/packages/flutter_tools/dart_test.yaml new file mode 100644 index 0000000000..cd8c697cba --- /dev/null +++ b/packages/flutter_tools/dart_test.yaml @@ -0,0 +1,5 @@ +tags: + "no_coverage": + "create": + "integration": +