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

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/common/net/buildbot_mock.py

Issue 2446463002: Fetch retry summary and use it to determine what tests to rebaseline. (Closed)
Patch Set: Add test for case where no retry summary can be downloaded Created 4 years, 1 month 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) 2011 Google Inc. All rights reserved. 1 # Copyright (C) 2011 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 22 matching lines...) Expand all
33 33
34 # TODO(qyearsley): Instead of canned results from another module, other unit 34 # TODO(qyearsley): Instead of canned results from another module, other unit
35 # tests may be a little easier to understand if this returned None by default 35 # tests may be a little easier to understand if this returned None by default
36 # when there are no canned results to return. 36 # when there are no canned results to return.
37 class MockBuildBot(BuildBot): 37 class MockBuildBot(BuildBot):
38 38
39 def __init__(self): 39 def __init__(self):
40 super(MockBuildBot, self).__init__() 40 super(MockBuildBot, self).__init__()
41 # Dict of Build to canned LayoutTestResults. 41 # Dict of Build to canned LayoutTestResults.
42 self._canned_results = {} 42 self._canned_results = {}
43 self._canned_retry_summary_json = {}
43 44
44 def fetch_layout_test_results(self, _): 45 def fetch_layout_test_results(self, _):
45 return LayoutTestResults.results_from_string(LayoutTestResultsTest.examp le_full_results_json) 46 return LayoutTestResults.results_from_string(LayoutTestResultsTest.examp le_full_results_json)
46 47
47 def set_results(self, build, results): 48 def set_results(self, build, results):
48 self._canned_results[build] = results 49 self._canned_results[build] = results
49 50
50 def fetch_results(self, build): 51 def fetch_results(self, build):
51 return self._canned_results.get( 52 return self._canned_results.get(
52 build, 53 build,
53 LayoutTestResults.results_from_string(LayoutTestResultsTest.example_ full_results_json)) 54 LayoutTestResults.results_from_string(LayoutTestResultsTest.example_ full_results_json))
55
56 def set_retry_sumary_json(self, build, content):
57 self._canned_retry_summary_json[build] = content
58
59 def fetch_retry_summary_json(self, build):
60 return self._canned_retry_summary_json.get(build)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698