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

Side by Side Diff: tools/gardening/lib/src/client.dart

Issue 2987253002: Add test to compare-failures (Closed)
Patch Set: Created 3 years, 4 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
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 import 'dart:async'; 5 import 'dart:async';
6 import 'dart:io'; 6 import 'dart:io';
7 7
8 import 'buildbot_data.dart'; 8 import 'buildbot_data.dart';
9 import 'buildbot_loading.dart'; 9 import 'buildbot_loading.dart';
10 import 'buildbot_structures.dart'; 10 import 'buildbot_structures.dart';
(...skipping 10 matching lines...) Expand all
21 /// Closes the client and cleans up its state. 21 /// Closes the client and cleans up its state.
22 void close(); 22 void close();
23 } 23 }
24 24
25 /// Buildbot client that pulls build bot results through http. 25 /// Buildbot client that pulls build bot results through http.
26 class HttpBuildbotClient implements BuildbotClient { 26 class HttpBuildbotClient implements BuildbotClient {
27 final HttpClient _client = new HttpClient(); 27 final HttpClient _client = new HttpClient();
28 28
29 @override 29 @override
30 Future<BuildResult> readResult(BuildUri buildUri) { 30 Future<BuildResult> readResult(BuildUri buildUri) {
31 return readBuildResult(_client, buildUri); 31 return readBuildResultFromHttp(_client, buildUri);
32 } 32 }
33 33
34 int get mostRecentBuildNumber => -2; 34 int get mostRecentBuildNumber => -2;
35 35
36 @override 36 @override
37 void close() { 37 void close() {
38 _client.close(); 38 _client.close();
39 } 39 }
40 } 40 }
41 41
(...skipping 19 matching lines...) Expand all
61 if (buildUri.buildNumber < 0) { 61 if (buildUri.buildNumber < 0) {
62 absoluteBuildNumbers = await _getAbsoluteBuildNumbers(buildUri); 62 absoluteBuildNumbers = await _getAbsoluteBuildNumbers(buildUri);
63 int buildNumberIndex = 63 int buildNumberIndex =
64 getBuildNumberIndex(absoluteBuildNumbers, buildUri.buildNumber); 64 getBuildNumberIndex(absoluteBuildNumbers, buildUri.buildNumber);
65 if (buildNumberIndex == null) return null; 65 if (buildNumberIndex == null) return null;
66 buildUri = 66 buildUri =
67 buildUri.withBuildNumber(absoluteBuildNumbers[buildNumberIndex]); 67 buildUri.withBuildNumber(absoluteBuildNumbers[buildNumberIndex]);
68 } 68 }
69 while (true) { 69 while (true) {
70 try { 70 try {
71 return await readLogDogResult(buildUri); 71 return await readBuildResultFromLogDog(buildUri);
72 } on LogdogException catch (e) { 72 } on LogdogException catch (e) {
73 if (e.exitKind != LogdogExitKind.error) { 73 if (e.exitKind != LogdogExitKind.error) {
74 return null; 74 return null;
75 } 75 }
76 absoluteBuildNumbers ??= await _getAbsoluteBuildNumbers(buildUri); 76 absoluteBuildNumbers ??= await _getAbsoluteBuildNumbers(buildUri);
77 buildNumberIndex = 77 buildNumberIndex =
78 getBuildNumberIndex(absoluteBuildNumbers, buildUri.buildNumber); 78 getBuildNumberIndex(absoluteBuildNumbers, buildUri.buildNumber);
79 if (buildNumberIndex == null) return null; 79 if (buildNumberIndex == null) return null;
80 if (buildNumberIndex >= absoluteBuildNumbers.length) return null; 80 if (buildNumberIndex >= absoluteBuildNumbers.length) return null;
81 int buildNumber = absoluteBuildNumbers[buildNumberIndex + 1]; 81 int buildNumber = absoluteBuildNumbers[buildNumberIndex + 1];
82 log('Skip build number ${buildUri.buildNumber} -> ${buildNumber}'); 82 log('Skip build number ${buildUri.buildNumber} -> ${buildNumber}');
83 buildUri = buildUri.withBuildNumber(buildNumber); 83 buildUri = buildUri.withBuildNumber(buildNumber);
84 } 84 }
85 } 85 }
86 } 86 }
87 87
88 @override 88 @override
89 void close() { 89 void close() {
90 // Nothing to do. 90 // Nothing to do.
91 } 91 }
92 } 92 }
OLDNEW
« no previous file with comments | « tools/gardening/lib/src/buildbot_structures.dart ('k') | tools/gardening/lib/src/compare_failures_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698