| 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 import 'dart:async'; | 5 import 'dart:async'; |
| 6 import 'dart:io'; | 6 import 'dart:io'; |
| 7 import 'util.dart'; | 7 import 'util.dart'; |
| 8 | 8 |
| 9 import 'buildbot_structures.dart'; | 9 import 'buildbot_structures.dart'; |
| 10 import 'cache.dart'; | 10 import 'cache.dart'; |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 if (line.startsWith('--- Total time:')) { | 106 if (line.startsWith('--- Total time:')) { |
| 107 parsingTimingBlock = true; | 107 parsingTimingBlock = true; |
| 108 } else if (parsingTimingBlock) { | 108 } else if (parsingTimingBlock) { |
| 109 if (line.startsWith('0:')) { | 109 if (line.startsWith('0:')) { |
| 110 timings.addAll(parseTimings(buildUri, line)); | 110 timings.addAll(parseTimings(buildUri, line)); |
| 111 } else { | 111 } else { |
| 112 parsingTimingBlock = false; | 112 parsingTimingBlock = false; |
| 113 } | 113 } |
| 114 } | 114 } |
| 115 } | 115 } |
| 116 return new BuildResult(buildUri, buildNumber, results, failures, timings); | 116 return new BuildResult(buildUri, buildNumber ?? buildUri.absoluteBuildNumber, |
| 117 results, failures, timings); |
| 117 } | 118 } |
| 118 | 119 |
| 119 /// Create the [Timing]s for the [line] as found in the top-20 timings of a | 120 /// Create the [Timing]s for the [line] as found in the top-20 timings of a |
| 120 /// build step stdio log. | 121 /// build step stdio log. |
| 121 List<Timing> parseTimings(BuildUri uri, String line) { | 122 List<Timing> parseTimings(BuildUri uri, String line) { |
| 122 List<String> parts = split(line, [' - ', ' - ', ' ']); | 123 List<String> parts = split(line, [' - ', ' - ', ' ']); |
| 123 String time = parts[0]; | 124 String time = parts[0]; |
| 124 String stepName = parts[1]; | 125 String stepName = parts[1]; |
| 125 String configName = parts[2]; | 126 String configName = parts[2]; |
| 126 String testNames = parts[3]; | 127 String testNames = parts[3]; |
| 127 List<Timing> timings = <Timing>[]; | 128 List<Timing> timings = <Timing>[]; |
| 128 for (String name in testNames.split(',')) { | 129 for (String name in testNames.split(',')) { |
| 129 name = name.trim(); | 130 name = name.trim(); |
| 130 int slashPos = name.indexOf('/'); | 131 int slashPos = name.indexOf('/'); |
| 131 String archName = name.substring(0, slashPos); | 132 String archName = name.substring(0, slashPos); |
| 132 String testName = name.substring(slashPos + 1); | 133 String testName = name.substring(slashPos + 1); |
| 133 timings.add(new Timing( | 134 timings.add(new Timing( |
| 134 uri, | 135 uri, |
| 135 time, | 136 time, |
| 136 new TestStep( | 137 new TestStep( |
| 137 stepName, new TestConfiguration(configName, archName, testName)))); | 138 stepName, new TestConfiguration(configName, archName, testName)))); |
| 138 } | 139 } |
| 139 return timings; | 140 return timings; |
| 140 } | 141 } |
| OLD | NEW |