From e0f642ecbbd4a70244f71b8d819bd9d418982d6f Mon Sep 17 00:00:00 2001 From: Ian Hickson Date: Tue, 27 Nov 2018 11:29:32 -0800 Subject: [PATCH] Update dartdocs devicelab test to handle current analyzer output (#24582) --- dev/devicelab/bin/tasks/dartdocs.dart | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/dev/devicelab/bin/tasks/dartdocs.dart b/dev/devicelab/bin/tasks/dartdocs.dart index 69dc6a9097..8ce07955bf 100644 --- a/dev/devicelab/bin/tasks/dartdocs.dart +++ b/dev/devicelab/bin/tasks/dartdocs.dart @@ -15,7 +15,7 @@ Future main() async { final Stopwatch clock = Stopwatch()..start(); final Process analysis = await startProcess( path.join(flutterDirectory.path, 'bin', 'flutter'), - ['analyze', '--no-preamble', '--no-congratulate', '--flutter-repo', '--dartdocs'], + ['analyze', '--no-preamble', '--flutter-repo', '--dartdocs'], workingDirectory: flutterDirectory.path, ); int publicMembers = 0; @@ -34,18 +34,24 @@ Future main() async { // ignore this line } else if (entry.isNotEmpty) { otherLines += 1; + print('^ not sure what to do with that line ^'); } } + bool sawFinalLine = false; await for (String entry in analysis.stderr.transform(utf8.decoder).transform(const LineSplitter())) { print('analyzer stderr: $entry'); - if (entry.startsWith('[lint] ')) { - // ignore this line + if (entry.contains('(ran in ') && !sawFinalLine) { + // ignore this line once + sawFinalLine = true; } else { otherLines += 1; + print('^ not sure what to do with that line ^'); } } final int result = await analysis.exitCode; clock.stop(); + if (!sawFinalLine) + throw Exception('flutter analyze did not output final message'); if (publicMembers == 0 && otherErrors == 0 && result != 0) throw Exception('flutter analyze exited with unexpected error code $result'); if (publicMembers != 0 && otherErrors != 0 && result == 0)