OLD | NEW |
1 # Copyright (c) 2009, Google Inc. All rights reserved. | 1 # Copyright (c) 2009, Google Inc. All rights reserved. |
2 # | 2 # |
3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
5 # met: | 5 # met: |
6 # | 6 # |
7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 def __init__(self, name, buildbot): | 47 def __init__(self, name, buildbot): |
48 self._name = name | 48 self._name = name |
49 self._buildbot = buildbot | 49 self._buildbot = buildbot |
50 self._builds_cache = {} | 50 self._builds_cache = {} |
51 self._revision_to_build_number = None | 51 self._revision_to_build_number = None |
52 | 52 |
53 def name(self): | 53 def name(self): |
54 return self._name | 54 return self._name |
55 | 55 |
56 def results_url(self): | 56 def results_url(self): |
57 return "%s/results/%s" % (self._buildbot.buildbot_url, self.url_encoded_
name()) | 57 return config_urls.chromium_results_url_base_for_builder(self._name) |
58 | 58 |
59 # In addition to per-build results, the build.chromium.org builders also | |
60 # keep a directory that accumulates test results over many runs. | |
61 def accumulated_results_url(self): | 59 def accumulated_results_url(self): |
62 return None | 60 return config_urls.chromium_accumulated_results_url_base_for_builder(sel
f._name) |
63 | 61 |
64 def latest_layout_test_results_url(self): | 62 def latest_layout_test_results_url(self): |
65 return self.accumulated_results_url() or self.latest_cached_build().resu
lts_url(); | 63 return self.accumulated_results_url() or self.latest_cached_build().resu
lts_url(); |
66 | 64 |
67 @memoized | 65 @memoized |
68 def latest_layout_test_results(self): | 66 def latest_layout_test_results(self): |
69 return self.fetch_layout_test_results(self.latest_layout_test_results_ur
l()) | 67 return self.fetch_layout_test_results(self.latest_layout_test_results_ur
l()) |
70 | 68 |
71 def _fetch_file_from_results(self, results_url, file_name): | 69 def _fetch_file_from_results(self, results_url, file_name): |
72 # It seems this can return None if the url redirects and then returns 40
4. | 70 # It seems this can return None if the url redirects and then returns 40
4. |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 return self._is_green | 208 return self._is_green |
211 | 209 |
212 def previous_build(self): | 210 def previous_build(self): |
213 # previous_build() allows callers to avoid assuming build numbers are se
quential. | 211 # previous_build() allows callers to avoid assuming build numbers are se
quential. |
214 # They may not be sequential across all master changes, or when non-trun
k builds are made. | 212 # They may not be sequential across all master changes, or when non-trun
k builds are made. |
215 return self._builder.build(self._number - 1) | 213 return self._builder.build(self._number - 1) |
216 | 214 |
217 | 215 |
218 class BuildBot(object): | 216 class BuildBot(object): |
219 _builder_factory = Builder | 217 _builder_factory = Builder |
220 _default_url = config_urls.buildbot_url | 218 _default_url = config_urls.chromium_buildbot_url |
221 | 219 |
222 def __init__(self, url=None): | 220 def __init__(self, url=None): |
223 self.buildbot_url = url if url else self._default_url | 221 self.buildbot_url = url if url else self._default_url |
224 self._builder_by_name = {} | 222 self._builder_by_name = {} |
225 | 223 |
226 def _parse_last_build_cell(self, builder, cell): | 224 def _parse_last_build_cell(self, builder, cell): |
227 status_link = cell.find('a') | 225 status_link = cell.find('a') |
228 if status_link: | 226 if status_link: |
229 # Will be either a revision number or a build number | 227 # Will be either a revision number or a build number |
230 revision_string = status_link.string | 228 revision_string = status_link.string |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 | 395 |
398 builders_succeeded_in_past = set() | 396 builders_succeeded_in_past = set() |
399 for past_revision in revisions_in_order[i:]: | 397 for past_revision in revisions_in_order[i:]: |
400 if not revision_statuses[past_revision]: | 398 if not revision_statuses[past_revision]: |
401 break | 399 break |
402 builders_succeeded_in_past = builders_succeeded_in_past.union(re
vision_statuses[past_revision]) | 400 builders_succeeded_in_past = builders_succeeded_in_past.union(re
vision_statuses[past_revision]) |
403 | 401 |
404 if len(builders_succeeded_in_future) == len(builder_revisions) and l
en(builders_succeeded_in_past) == len(builder_revisions): | 402 if len(builders_succeeded_in_future) == len(builder_revisions) and l
en(builders_succeeded_in_past) == len(builder_revisions): |
405 return revision | 403 return revision |
406 return None | 404 return None |
OLD | NEW |