Chromium Code Reviews| Index: tools/gardening/bin/current_summary.dart |
| diff --git a/tools/gardening/bin/current_summary.dart b/tools/gardening/bin/current_summary.dart |
| index 78e813b59677beddb4b3c8645470c806c154ac3f..cb9d79b76058616218dbb1ad8e55913c8f4fec7e 100644 |
| --- a/tools/gardening/bin/current_summary.dart |
| +++ b/tools/gardening/bin/current_summary.dart |
| @@ -8,6 +8,7 @@ |
| /// The results are currently pulled from the second to last build since the |
| /// last build might not have completed yet. |
| +import 'dart:async'; |
| import 'dart:math'; |
| import 'dart:io'; |
| @@ -17,14 +18,24 @@ import 'package:gardening/src/buildbot_loading.dart'; |
| import 'package:gardening/src/buildbot_structures.dart'; |
| import 'package:gardening/src/util.dart'; |
| +void help(ArgParser argParser) { |
| + print('Displays the current status of specific tests on the buildbot'); |
| + print('Only prints output for failing tests.'); |
| + print('The test-names may be fully qualified (such as in '); |
| + print('"pkg/front_end/test/token_test") or just be a substring of the fully'); |
| + print(' qualified name.'); |
| + print('Usage: current_summary [options] <test-name1> [<test-name2> ...]'); |
| + print('where options are:'); |
| + print(argParser.usage); |
| +} |
| + |
| main(List<String> args) async { |
| ArgParser argParser = createArgParser(); |
| ArgResults argResults = argParser.parse(args); |
| processArgResults(argResults); |
| - if (argResults.rest.length == 0) { |
| - print('Usage: current_summary [options] <test-name1> [<test-name2> ...]'); |
| - print('where options are:'); |
| - print(argParser.usage); |
| + if (argResults.rest.length == 0 || argResults['help']) { |
| + help(argParser); |
| + if (argResults['help']) return; |
| exit(1); |
| } |
| int maxStatusWidth = 0; |
| @@ -36,13 +47,26 @@ main(List<String> args) async { |
| for (BuildGroup group in buildGroups) { |
| // TODO(johnniwinther): Support reading a partially completed shard, i.e. |
| // use build number `-1`. |
| - for (BuildUri buildUri in group.createUris(-2)) { |
| - print('Reading $buildUri'); |
| - BuildResult buildResult = await readBuildResult(client, buildUri); |
| + var resultFutures = group.createUris(-2).map((uri) { |
| + if (argResults['verbose']) print('Fetching $uri'); |
| + return readBuildResult(client, uri); |
| + }).toList(); |
| + var results = await Future.wait(resultFutures); |
| + for (BuildResult buildResult in results) { |
| + bool havePrintedUri = false; |
| + var buildUri = buildResult.buildUri; |
| + if (argResults['verbose']) { |
|
Johnni Winther
2017/05/31 07:37:26
Just do `log('Reading $buildUri');` - it's the sam
floitsch
2017/05/31 14:36:18
Changed the one in line 51.
This one, and the one
|
| + havePrintedUri = true; |
| + print('Reading $buildUri'); |
| + } |
| for (TestStatus testStatus in buildResult.results) { |
| String testName = testStatus.config.testName; |
| for (String arg in argResults.rest) { |
| if (testName.contains(arg) || arg.contains(testName)) { |
| + if (!havePrintedUri) { |
|
Johnni Winther
2017/05/31 07:37:26
Ditto
floitsch
2017/05/31 14:36:18
Acknowledged.
|
| + havePrintedUri = true; |
| + print("$buildUri:"); |
| + } |
| resultMap.putIfAbsent(testName, () => {})[buildUri] = testStatus; |
| maxStatusWidth = max(maxStatusWidth, testStatus.status.length); |
| maxConfigWidth = |