| 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 19 matching lines...) Expand all Loading... |
| 30 } | 30 } |
| 31 } | 31 } |
| 32 if (buildUriList.isEmpty) { | 32 if (buildUriList.isEmpty) { |
| 33 for (String url in args) { | 33 for (String url in args) { |
| 34 buildUriList.add(new BuildUri.fromUrl(url)); | 34 buildUriList.add(new BuildUri.fromUrl(url)); |
| 35 } | 35 } |
| 36 } | 36 } |
| 37 Map<BuildUri, List<BuildResult>> pastResultsMap = | 37 Map<BuildUri, List<BuildResult>> pastResultsMap = |
| 38 <BuildUri, List<BuildResult>>{}; | 38 <BuildUri, List<BuildResult>>{}; |
| 39 List<BuildResult> buildResults = await bot.readResults(buildUriList); | 39 List<BuildResult> buildResults = await bot.readResults(buildUriList); |
| 40 for (int index = 0; index < buildUriList.length; index++) { | 40 if (buildResults.length != buildUriList.length) { |
| 41 print('Result mismatch: Pulled ${buildUriList.length} uris, ' |
| 42 'received ${buildResults.length} results.'); |
| 43 } |
| 44 for (int index = 0; index < buildResults.length; index++) { |
| 41 BuildUri buildUri = buildUriList[index]; | 45 BuildUri buildUri = buildUriList[index]; |
| 42 BuildResult buildResult = buildResults[index]; | 46 BuildResult buildResult = buildResults[index]; |
| 43 List<BuildResult> results = | 47 List<BuildResult> results = |
| 44 await readPastResults(bot, buildUri, buildResult, runCount); | 48 await readPastResults(bot, buildUri, buildResult, runCount); |
| 45 pastResultsMap[buildUri] = results; | 49 pastResultsMap[buildUri] = results; |
| 46 } | 50 } |
| 47 return pastResultsMap; | 51 return pastResultsMap; |
| 48 } | 52 } |
| 49 | 53 |
| 50 /// Prints summaries for the [buildResults]. | 54 /// Prints summaries for the [buildResults]. |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 sb.write('No errors found for ${name}'); | 211 sb.write('No errors found for ${name}'); |
| 208 } | 212 } |
| 209 } | 213 } |
| 210 | 214 |
| 211 String get name => results.isNotEmpty | 215 String get name => results.isNotEmpty |
| 212 // Use the first result as name since it most likely has an absolute build | 216 // Use the first result as name since it most likely has an absolute build |
| 213 // number. | 217 // number. |
| 214 ? results.first.buildUri.toString() | 218 ? results.first.buildUri.toString() |
| 215 : buildUri.toString(); | 219 : buildUri.toString(); |
| 216 } | 220 } |
| OLD | NEW |