| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 /// Compares the test log of a build step with previous builds. | 5 /// Compares the test log of a build step with previous builds. |
| 6 /// | 6 /// |
| 7 /// Use this to detect flakiness of failures, especially timeouts. | 7 /// Use this to detect flakiness of failures, especially timeouts. |
| 8 | 8 |
| 9 import 'dart:async'; | 9 import 'dart:async'; |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 BuildbotClient client, List<String> args, | 25 BuildbotClient client, List<String> args, |
| 26 {int runCount: 10}) async { | 26 {int runCount: 10}) async { |
| 27 List<BuildUri> buildUriList = <BuildUri>[]; | 27 List<BuildUri> buildUriList = <BuildUri>[]; |
| 28 for (BuildGroup buildGroup in buildGroups) { | 28 for (BuildGroup buildGroup in buildGroups) { |
| 29 if (args.contains(buildGroup.groupName)) { | 29 if (args.contains(buildGroup.groupName)) { |
| 30 buildUriList.addAll(buildGroup.createUris(client.mostRecentBuildNumber)); | 30 buildUriList.addAll(buildGroup.createUris(client.mostRecentBuildNumber)); |
| 31 } | 31 } |
| 32 } | 32 } |
| 33 if (buildUriList.isEmpty) { | 33 if (buildUriList.isEmpty) { |
| 34 for (String url in args) { | 34 for (String url in args) { |
| 35 if (!url.endsWith('/text')) { | 35 buildUriList.add(new BuildUri.fromUrl(url)); |
| 36 // Use the text version of the stdio log. | |
| 37 url += '/text'; | |
| 38 } | |
| 39 Uri uri = Uri.parse(url); | |
| 40 BuildUri buildUri = new BuildUri(uri); | |
| 41 buildUriList.add(buildUri); | |
| 42 } | 36 } |
| 43 } | 37 } |
| 44 Map<BuildUri, List<BuildResult>> buildResults = | 38 Map<BuildUri, List<BuildResult>> buildResults = |
| 45 <BuildUri, List<BuildResult>>{}; | 39 <BuildUri, List<BuildResult>>{}; |
| 46 for (BuildUri buildUri in buildUriList) { | 40 for (BuildUri buildUri in buildUriList) { |
| 47 List<BuildResult> results = | 41 List<BuildResult> results = |
| 48 await readBuildResults(client, buildUri, runCount); | 42 await readBuildResults(client, buildUri, runCount); |
| 49 buildResults[buildUri] = results; | 43 buildResults[buildUri] = results; |
| 50 } | 44 } |
| 51 return buildResults; | 45 return buildResults; |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 sb.write('\n'); | 199 sb.write('\n'); |
| 206 } | 200 } |
| 207 sb.write('\n'); | 201 sb.write('\n'); |
| 208 }); | 202 }); |
| 209 } | 203 } |
| 210 if (timeoutIds.isEmpty && errorIds.isEmpty) { | 204 if (timeoutIds.isEmpty && errorIds.isEmpty) { |
| 211 sb.write('No errors found for ${buildUri}'); | 205 sb.write('No errors found for ${buildUri}'); |
| 212 } | 206 } |
| 213 } | 207 } |
| 214 } | 208 } |
| OLD | NEW |