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

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

Issue 2045043002: Allow multiple devices on bisects hosts (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Update unexpected files Created 4 years, 5 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 """API for the bisect recipe module. 5 """API for the bisect recipe module.
6 6
7 This API is meant to enable the bisect recipe to bisect any chromium-supported 7 This API is meant to enable the bisect recipe to bisect any chromium-supported
8 platform for any test that can be run via buildbot, perf or otherwise. 8 platform for any test that can be run via buildbot, perf or otherwise.
9 """ 9 """
10 10
(...skipping 22 matching lines...) Expand all
33 # Email to send on try jobs (for build requests) since git try will not 33 # Email to send on try jobs (for build requests) since git try will not
34 # necessarily rely on a local checkout for that information. 34 # necessarily rely on a local checkout for that information.
35 BOT_EMAIL = 'chrome_bot@chromium.org' 35 BOT_EMAIL = 'chrome_bot@chromium.org'
36 SERVICE_ACCOUNT = 'chromium_bisect' 36 SERVICE_ACCOUNT = 'chromium_bisect'
37 37
38 def __init__(self, *args, **kwargs): 38 def __init__(self, *args, **kwargs):
39 super(AutoBisectApi, self).__init__(*args, **kwargs) 39 super(AutoBisectApi, self).__init__(*args, **kwargs)
40 self.override_poll_interval = None 40 self.override_poll_interval = None
41 self.bot_db = None 41 self.bot_db = None
42 # Repo for triggering build jobs. 42 # Repo for triggering build jobs.
43 self.svn_repo_url = 'svn://svn.chromium.org/chrome-try/try-perf' 43 self.svn_repo_url = 'svn://svn.chromium.org/chrome-try/try-perf'
44 # The variable below are set and used for the internal bisects. 44 # The variable below are set and used for the internal bisects.
45 self.buildurl_gs_prefix = None 45 self.buildurl_gs_prefix = None
46 self.internal_bisect = False 46 self.internal_bisect = False
47 self.builder_bot = None 47 self.builder_bot = None
48 self.full_deploy_script = None 48 self.full_deploy_script = None
49 49
50
50 def perform_bisect(self, **flags): 51 def perform_bisect(self, **flags):
51 return local_bisect.perform_bisect(self, **flags) 52 return local_bisect.perform_bisect(self, **flags)
52 53
53 def create_bisector(self, bisect_config_dict, dummy_mode=False, **flags): 54 def create_bisector(self, bisect_config_dict, dummy_mode=False, **flags):
54 """Passes the api and the config dictionary to the Bisector constructor. 55 """Passes the api and the config dictionary to the Bisector constructor.
55 56
56 For details about the keys in the bisect config dictionary go to: 57 For details about the keys in the bisect config dictionary go to:
57 http://chromium.org/developers/speed-infra/perf-try-bots-bisect-bots/config 58 http://chromium.org/developers/speed-infra/perf-try-bots-bisect-bots/config
58 59
59 Args: 60 Args:
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 'author': commit_info['author']['name'], 149 'author': commit_info['author']['name'],
149 'email': commit_info['author']['email'], 150 'email': commit_info['author']['email'],
150 'subject': subject, 151 'subject': subject,
151 'body': body, 152 'body': body,
152 'date': commit_info['committer']['time'], 153 'date': commit_info['committer']['time'],
153 } 154 }
154 return None 155 return None
155 except self.m.step.StepFailure: # pragma: no cover 156 except self.m.step.StepFailure: # pragma: no cover
156 self.surface_result('BAD_REV') 157 self.surface_result('BAD_REV')
157 raise 158 raise
158 159
159 160
160 def run_bisect_script(self, **kwargs): 161 def run_bisect_script(self, **kwargs):
161 """Executes src/tools/run-perf-bisect-regression.py to perform bisection.""" 162 """Executes src/tools/run-perf-bisect-regression.py to perform bisection."""
162 self.m.python( 163 self.m.python(
163 'Preparing for Bisection', 164 'Preparing for Bisection',
164 script=self.m.path['checkout'].join( 165 script=self.m.path['checkout'].join(
165 'tools', 'prepare-bisect-perf-regression.py'), 166 'tools', 'prepare-bisect-perf-regression.py'),
166 args=['-w', self.m.path['slave_build']]) 167 args=['-w', self.m.path['slave_build']])
167 args = [] 168 args = []
168 169
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 else: 317 else:
317 for apk in deploy_apks: 318 for apk in deploy_apks:
318 self.m.chromium_android.adb_install_apk(apk) 319 self.m.chromium_android.adb_install_apk(apk)
319 320
320 def full_deploy_on_device(self, deploy_script, args=None): # pragma: no cover 321 def full_deploy_on_device(self, deploy_script, args=None): # pragma: no cover
321 """Install android-chrome apk on device.""" 322 """Install android-chrome apk on device."""
322 full_deploy_flags = [ 323 full_deploy_flags = [
323 '-v', 324 '-v',
324 '--blacklist-file', self.m.chromium_android.blacklist_file, 325 '--blacklist-file', self.m.chromium_android.blacklist_file,
325 '--perfbot', 326 '--perfbot',
326 '--release', 327 '--release',
327 ] 328 ]
328 if args: 329 if args:
329 full_deploy_flags += args 330 full_deploy_flags += args
330 self.m.python( 331 self.m.python(
331 'Deploy on Device', 332 'Deploy on Device',
332 deploy_script, 333 deploy_script,
333 full_deploy_flags, 334 full_deploy_flags,
334 infra_step=True, 335 infra_step=True,
335 env=self.m.chromium.get_env()) 336 env=self.m.chromium.get_env())
336 337
337 def start_try_job(self, api, update_step=None, bot_db=None, **kwargs): 338 def start_try_job(self, api, update_step=None, bot_db=None, **kwargs):
338 """Starts a recipe bisect job, perf test run, or legacy bisect run. 339 """Starts a recipe bisect job, perf test run, or legacy bisect run.
339 340
340 This function is an entry point for: 341 This function is an entry point for:
341 1. A legacy bisect job run (in this case, there will be a patch 342 1. A legacy bisect job run (in this case, there will be a patch
342 with a bisect config file). 343 with a bisect config file).
343 2. A recipe bisect job run (in this case, there will be a property 344 2. A recipe bisect job run (in this case, there will be a property
344 called bisect_config which contains the config parameters). 345 called bisect_config which contains the config parameters).
345 3. A single test run for a recipe bisect job (there will be a 346 3. A single test run for a recipe bisect job (there will be a
346 bisect_config property but it won't contain good/bad revisions). 347 bisect_config property but it won't contain good/bad revisions).
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 affected_files, update_step, self.bot_db) 386 affected_files, update_step, self.bot_db)
386 finally: 387 finally:
387 if api.chromium.c.TARGET_PLATFORM == 'android': 388 if api.chromium.c.TARGET_PLATFORM == 'android':
388 if self.internal_bisect: # pragma: no cover 389 if self.internal_bisect: # pragma: no cover
389 api.chromium_android.init_and_sync( 390 api.chromium_android.init_and_sync(
390 gclient_config=api.chromium_android.c.internal_dir_name, 391 gclient_config=api.chromium_android.c.internal_dir_name,
391 use_bot_update=True) 392 use_bot_update=True)
392 else: 393 else:
393 api.bot_update.ensure_checkout() 394 api.bot_update.ensure_checkout()
394 api.chromium_android.common_tests_final_steps() 395 api.chromium_android.common_tests_final_steps()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698