Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 21 matching lines...) Expand all Loading... | |
| 32 GS_RESULTS_URL = 'gs://%s/%s/' % (BUCKET, RESULTS_GS_DIR) | 32 GS_RESULTS_URL = 'gs://%s/%s/' % (BUCKET, RESULTS_GS_DIR) |
| 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 | 36 |
| 37 def __init__(self, *args, **kwargs): | 37 def __init__(self, *args, **kwargs): |
| 38 super(AutoBisectApi, self).__init__(*args, **kwargs) | 38 super(AutoBisectApi, self).__init__(*args, **kwargs) |
| 39 self.override_poll_interval = None | 39 self.override_poll_interval = None |
| 40 self.bot_db = None | 40 self.bot_db = None |
| 41 # Repo for triggering build jobs. | 41 # Repo for triggering build jobs. |
| 42 self.svn_repo_url = 'svn://svn.chromium.org/chrome-try/try-perf' | 42 self.svn_repo_url = 'svn://svn.chromium.org/chrome-try/try-perf' |
| 43 # The variable below are set and used for the internal bisects. | 43 # The variable below are set and used for the internal bisects. |
| 44 self.buildurl_gs_prefix = None | 44 self.buildurl_gs_prefix = None |
| 45 self.internal_bisect = False | 45 self.internal_bisect = False |
| 46 self.builder_bot = None | 46 self.builder_bot = None |
| 47 self.full_deploy_script = None | 47 self.full_deploy_script = None |
| 48 self.device_to_test = None | |
| 49 self.device_tested = [] | |
|
RobertoCN
2016/06/21 22:47:01
Nit: devices_tested
Ziqi Xiong
2016/06/22 17:38:22
Done.
| |
| 48 | 50 |
| 49 def perform_bisect(self, **flags): | 51 def perform_bisect(self, **flags): |
| 50 return local_bisect.perform_bisect(self, **flags) | 52 return local_bisect.perform_bisect(self, **flags) |
| 51 | 53 |
| 52 def create_bisector(self, bisect_config_dict, dummy_mode=False, **flags): | 54 def create_bisector(self, bisect_config_dict, dummy_mode=False, **flags): |
| 53 """Passes the api and the config dictionary to the Bisector constructor. | 55 """Passes the api and the config dictionary to the Bisector constructor. |
| 54 | 56 |
| 55 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: |
| 56 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 |
| 57 | 59 |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 147 'author': commit_info['author']['name'], | 149 'author': commit_info['author']['name'], |
| 148 'email': commit_info['author']['email'], | 150 'email': commit_info['author']['email'], |
| 149 'subject': subject, | 151 'subject': subject, |
| 150 'body': body, | 152 'body': body, |
| 151 'date': commit_info['committer']['time'], | 153 'date': commit_info['committer']['time'], |
| 152 } | 154 } |
| 153 return None | 155 return None |
| 154 except self.m.step.StepFailure: # pragma: no cover | 156 except self.m.step.StepFailure: # pragma: no cover |
| 155 self.surface_result('BAD_REV') | 157 self.surface_result('BAD_REV') |
| 156 raise | 158 raise |
| 157 | 159 |
| 158 | 160 |
| 159 def run_bisect_script(self, **kwargs): | 161 def run_bisect_script(self, **kwargs): |
| 160 """Executes src/tools/run-perf-bisect-regression.py to perform bisection.""" | 162 """Executes src/tools/run-perf-bisect-regression.py to perform bisection.""" |
| 161 self.m.python( | 163 self.m.python( |
| 162 'Preparing for Bisection', | 164 'Preparing for Bisection', |
| 163 script=self.m.path['checkout'].join( | 165 script=self.m.path['checkout'].join( |
| 164 'tools', 'prepare-bisect-perf-regression.py'), | 166 'tools', 'prepare-bisect-perf-regression.py'), |
| 165 args=['-w', self.m.path['slave_build']]) | 167 args=['-w', self.m.path['slave_build']]) |
| 166 args = [] | 168 args = [] |
| 167 | 169 |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 315 else: | 317 else: |
| 316 for apk in deploy_apks: | 318 for apk in deploy_apks: |
| 317 self.m.chromium_android.adb_install_apk(apk) | 319 self.m.chromium_android.adb_install_apk(apk) |
| 318 | 320 |
| 319 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 |
| 320 """Install android-chrome apk on device.""" | 322 """Install android-chrome apk on device.""" |
| 321 full_deploy_flags = [ | 323 full_deploy_flags = [ |
| 322 '-v', | 324 '-v', |
| 323 '--blacklist-file', self.m.chromium_android.blacklist_file, | 325 '--blacklist-file', self.m.chromium_android.blacklist_file, |
| 324 '--perfbot', | 326 '--perfbot', |
| 325 '--release', | 327 '--release', |
| 326 ] | 328 ] |
| 327 if args: | 329 if args: |
| 328 full_deploy_flags += args | 330 full_deploy_flags += args |
| 329 self.m.python( | 331 self.m.python( |
| 330 'Deploy on Device', | 332 'Deploy on Device', |
| 331 deploy_script, | 333 deploy_script, |
| 332 full_deploy_flags, | 334 full_deploy_flags, |
| 333 infra_step=True, | 335 infra_step=True, |
| 334 env=self.m.chromium.get_env()) | 336 env=self.m.chromium.get_env()) |
|
RobertoCN
2016/06/21 22:47:01
Thanks for fixing this.
Ziqi Xiong
2016/06/22 17:38:22
Done.
| |
| 335 | 337 |
| 336 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): |
| 337 """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. |
| 338 | 340 |
| 339 This function is an entry point for: | 341 This function is an entry point for: |
| 340 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 |
| 341 with a bisect config file). | 343 with a bisect config file). |
| 342 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 |
| 343 called bisect_config which contains the config parameters). | 345 called bisect_config which contains the config parameters). |
| 344 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 |
| 345 bisect_config property but it won't contain good/bad revisions). | 347 bisect_config property but it won't contain good/bad revisions). |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 378 local_bisect.perform_bisect(self, **flags) # pragma: no cover | 380 local_bisect.perform_bisect(self, **flags) # pragma: no cover |
| 379 else: | 381 else: |
| 380 self.start_test_run_for_bisect(update_step, self.bot_db, | 382 self.start_test_run_for_bisect(update_step, self.bot_db, |
| 381 api.properties) | 383 api.properties) |
| 382 else: | 384 else: |
| 383 self.m.perf_try.start_perf_try_job( | 385 self.m.perf_try.start_perf_try_job( |
| 384 affected_files, update_step, self.bot_db) | 386 affected_files, update_step, self.bot_db) |
| 385 finally: | 387 finally: |
| 386 if api.chromium.c.TARGET_PLATFORM == 'android': | 388 if api.chromium.c.TARGET_PLATFORM == 'android': |
| 387 api.chromium_android.common_tests_final_steps() | 389 api.chromium_android.common_tests_final_steps() |
| OLD | NEW |