Chromium Code Reviews| Index: third_party/WebKit/Tools/Scripts/webkitpy/common/net/buildbot.py |
| diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/common/net/buildbot.py b/third_party/WebKit/Tools/Scripts/webkitpy/common/net/buildbot.py |
| index 956dd55f611214267180f52e711104dbf18f1424..ca78671b82233fd8fefb769b99005c8a4b47fbfb 100644 |
| --- a/third_party/WebKit/Tools/Scripts/webkitpy/common/net/buildbot.py |
| +++ b/third_party/WebKit/Tools/Scripts/webkitpy/common/net/buildbot.py |
| @@ -55,7 +55,6 @@ class BuildBot(object): |
| for more information about the layout test result format, see: |
| https://www.chromium.org/developers/the-json-test-results-format |
| """ |
| - |
| def results_url(self, builder_name, build_number=None): |
| """Returns a URL for one set of archived layout test results. |
| @@ -77,6 +76,18 @@ class BuildBot(object): |
| """ |
| return '%s/%s' % (RESULTS_URL_BASE, re.sub('[ .()]', '_', builder_name)) |
| + @memoized |
| + def fetch_retry_summary_json(self, build): |
| + """Fetches and returns the text of the archived retry_summary file. |
| + |
| + This file is expected to contain the results of retrying layout tests |
| + with and without a patch without a patch in a try job, with information |
|
wkorman
2016/10/24 21:47:38
dupe 'without a patch' text
qyearsley
2016/10/25 21:53:52
Fixed
|
| + about which tests failed only with the patch, and which tests failed |
| + both with and without the patch. |
| + """ |
| + url_base = "%s/%s" % (self.builder_results_url_base(build.builder_name), build.build_number) |
| + return self._fetch_file(url_base, 'retry_summary.json') |
| + |
| def accumulated_results_url_base(self, builder_name): |
| return self.builder_results_url_base(builder_name) + "/results/layout-test-results" |
| @@ -92,17 +103,17 @@ class BuildBot(object): |
| def fetch_layout_test_results(self, results_url): |
| """Returns a LayoutTestResults object for results fetched from a given URL.""" |
| results_file = NetworkTransaction(convert_404_to_None=True).run( |
| - lambda: self._fetch_file_from_results(results_url, "failing_results.json")) |
| + lambda: self._fetch_file(results_url, "failing_results.json")) |
| revision = NetworkTransaction(convert_404_to_None=True).run( |
| - lambda: self._fetch_file_from_results(results_url, "LAST_CHANGE")) |
| + lambda: self._fetch_file(results_url, "LAST_CHANGE")) |
| if not revision: |
| results_file = None |
| return LayoutTestResults.results_from_string(results_file, revision) |
| - def _fetch_file_from_results(self, results_url, file_name): |
| + def _fetch_file(self, url_base, file_name): |
| # It seems this can return None if the url redirects and then returns 404. |
| # FIXME: This could use Web instead of using urllib2 directly. |
| - result = urllib2.urlopen("%s/%s" % (results_url, file_name)) |
| + result = urllib2.urlopen("%s/%s" % (url_base, file_name)) |
| if not result: |
| return None |
| # urlopen returns a file-like object which sometimes works fine with str() |