Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1276)

Side by Side Diff: tools/gardening/bin/compare_failures.dart

Issue 2944653002: Add summary command to bot. (Closed)
Patch Set: Close bot. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/gardening/bin/bot.dart ('k') | tools/gardening/bin/summary.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 import 'dart:io'; 10 import 'dart:io';
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 } 50 }
51 Uri uri = Uri.parse(url); 51 Uri uri = Uri.parse(url);
52 BuildUri buildUri = new BuildUri(uri); 52 BuildUri buildUri = new BuildUri(uri);
53 List<BuildResult> results = 53 List<BuildResult> results =
54 await readBuildResults(client, buildUri, runCount); 54 await readBuildResults(client, buildUri, runCount);
55 print(generateBuildResultsSummary(buildUri, results)); 55 print(generateBuildResultsSummary(buildUri, results));
56 client.close(); 56 client.close();
57 } 57 }
58 58
59 /// Creates a [BuildResult] for [buildUri] and, if it contains failures, the 59 /// Creates a [BuildResult] for [buildUri] and, if it contains failures, the
60 /// [BuildResult]s for the previous 5 builds. 60 /// [BuildResult]s for the previous [runCount] builds.
61 Future<List<BuildResult>> readBuildResults( 61 Future<List<BuildResult>> readBuildResults(
62 BuildbotClient client, BuildUri buildUri, int runCount) async { 62 BuildbotClient client, BuildUri buildUri, int runCount) async {
63 List<BuildResult> summaries = <BuildResult>[]; 63 List<BuildResult> summaries = <BuildResult>[];
64 BuildResult summary = await client.readResult(buildUri); 64 BuildResult summary = await client.readResult(buildUri);
65 summaries.add(summary); 65 summaries.add(summary);
66 if (summary.hasFailures) { 66 if (summary.hasFailures) {
67 for (int i = 0; i < runCount; i++) { 67 for (int i = 0; i < runCount; i++) {
68 buildUri = summary.buildUri.prev(); 68 buildUri = summary.buildUri.prev();
69 summary = await client.readResult(buildUri); 69 summary = await client.readResult(buildUri);
70 summaries.add(summary); 70 summaries.add(summary);
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 sb.write(' / '); 149 sb.write(' / ');
150 sb.write(padRight('-- OK --', 10)); 150 sb.write(padRight('-- OK --', 10));
151 } 151 }
152 sb.write('\n'); 152 sb.write('\n');
153 } 153 }
154 sb.write('\n'); 154 sb.write('\n');
155 }); 155 });
156 } 156 }
157 return sb.toString(); 157 return sb.toString();
158 } 158 }
OLDNEW
« no previous file with comments | « tools/gardening/bin/bot.dart ('k') | tools/gardening/bin/summary.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698