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

Side by Side Diff: scripts/slave/recipe_modules/auto_bisect/perf_revision_state.py

Issue 1339613005: Refactoring scripts that wait for buildbot jobs to complete. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@hax
Patch Set: . Created 5 years, 3 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 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import json 5 import json
6 import tempfile 6 import tempfile
7 import os 7 import os
8 import uuid 8 import uuid
9 9
10 from . import revision_state 10 from . import revision_state
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 self.test_job_name + '.results') 134 self.test_job_name + '.results')
135 api.m.trigger(perf_test_properties, name=step_name) 135 api.m.trigger(perf_test_properties, name=step_name)
136 136
137 def get_next_url(self): 137 def get_next_url(self):
138 if self.status == PerfRevisionState.BUILDING: 138 if self.status == PerfRevisionState.BUILDING:
139 return self.build_url 139 return self.build_url
140 if self.status == PerfRevisionState.TESTING: 140 if self.status == PerfRevisionState.TESTING:
141 return self.test_results_url 141 return self.test_results_url
142 142
143 def get_buildbot_locator(self): 143 def get_buildbot_locator(self):
144 if self.status not in (PerfRevisionState.BUILDING,
145 PerfRevisionState.TESTING): # pragma: no cover
146 return None
147 # TODO(robertocn): Remove hardcoded master.
148 master = 'tryserver.chromium.perf'
144 if self.status == PerfRevisionState.BUILDING: 149 if self.status == PerfRevisionState.BUILDING:
145 # TODO(robertocn): Remove hardcoded master. 150 builder = self.bisector.get_builder_bot_for_this_platform()
146 master = 'tryserver.chromium.perf'
147 bot_name = self.bisector.get_builder_bot_for_this_platform()
148 job_name = self.build_job_name 151 job_name = self.build_job_name
prasadv 2015/09/17 22:33:34 I think at any given point a revision can either b
RobertoCN 2015/09/19 00:32:54 There's no need to have them separate anymore. I j
149 return 'bb:%s:%s:%s' % (master, bot_name, job_name)
150 if self.status == PerfRevisionState.TESTING: 152 if self.status == PerfRevisionState.TESTING:
151 master = 'tryserver.chromium.perf' 153 builder = self.bisector.get_perf_tester_name()
152 bot_name = self.bisector.get_perf_tester_name()
153 job_name = self.test_job_name 154 job_name = self.test_job_name
154 return 'bb:%s:%s:%s' % (master, bot_name, job_name) 155 return {
156 'master': master,
157 'builder': builder,
158 'job_name': job_name,
159 }
155 160
156 def _get_test_results(self): 161 def _get_test_results(self):
157 """Tries to get the results of a test job from cloud storage.""" 162 """Tries to get the results of a test job from cloud storage."""
158 api = self.bisector.api 163 api = self.bisector.api
159 try: 164 try:
160 stdout = api.m.raw_io.output() 165 stdout = api.m.raw_io.output()
161 name = 'Get test results for build ' + self.commit_hash 166 name = 'Get test results for build ' + self.commit_hash
162 step_result = api.m.gsutil.cat(self.test_results_url, stdout=stdout, 167 step_result = api.m.gsutil.cat(self.test_results_url, stdout=stdout,
163 name=name) 168 name=name)
164 except api.m.step.StepFailure: # pragma: no cover 169 except api.m.step.StepFailure: # pragma: no cover
(...skipping 11 matching lines...) Expand all
176 True if this revision is closer to the initial good revision's value than 181 True if this revision is closer to the initial good revision's value than
177 to the initial bad revision's value. False otherwise. 182 to the initial bad revision's value. False otherwise.
178 """ 183 """
179 # TODO: Reevaluate this approach 184 # TODO: Reevaluate this approach
180 bisector = self.bisector 185 bisector = self.bisector
181 distance_to_good = abs(self.mean_value - bisector.good_rev.mean_value) 186 distance_to_good = abs(self.mean_value - bisector.good_rev.mean_value)
182 distance_to_bad = abs(self.mean_value - bisector.bad_rev.mean_value) 187 distance_to_bad = abs(self.mean_value - bisector.bad_rev.mean_value)
183 if distance_to_good < distance_to_bad: 188 if distance_to_good < distance_to_bad:
184 return True 189 return True
185 return False 190 return False
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698