| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 # Keep track of working directory (which contains the checkout). | 50 # Keep track of working directory (which contains the checkout). |
| 51 # None means "default value". | 51 # None means "default value". |
| 52 self._working_dir = None | 52 self._working_dir = None |
| 53 | 53 |
| 54 @property |
| 55 def working_dir(self): |
| 56 if not self._working_dir: |
| 57 self._working_dir = self.m.chromium_tests.get_checkout_dir({}) |
| 58 return self._working_dir |
| 59 |
| 54 def perform_bisect(self, **flags): | 60 def perform_bisect(self, **flags): |
| 55 return local_bisect.perform_bisect(self, **flags) | 61 return local_bisect.perform_bisect(self, **flags) |
| 56 | 62 |
| 57 def create_bisector(self, bisect_config_dict, dummy_mode=False, **flags): | 63 def create_bisector(self, bisect_config_dict, dummy_mode=False, **flags): |
| 58 """Passes the api and the config dictionary to the Bisector constructor. | 64 """Passes the api and the config dictionary to the Bisector constructor. |
| 59 | 65 |
| 60 For details about the keys in the bisect config dictionary go to: | 66 For details about the keys in the bisect config dictionary go to: |
| 61 http://chromium.org/developers/speed-infra/perf-try-bots-bisect-bots/config | 67 http://chromium.org/developers/speed-infra/perf-try-bots-bisect-bots/config |
| 62 | 68 |
| 63 Args: | 69 Args: |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 | 210 |
| 205 if skip_download: | 211 if skip_download: |
| 206 update_step = None | 212 update_step = None |
| 207 else: | 213 else: |
| 208 update_step = self._SyncRevisionToTest(test_config_params) | 214 update_step = self._SyncRevisionToTest(test_config_params) |
| 209 self.start_test_run_for_bisect(update_step, self.bot_db, | 215 self.start_test_run_for_bisect(update_step, self.bot_db, |
| 210 test_config_params, run_locally=True, | 216 test_config_params, run_locally=True, |
| 211 skip_download=skip_download) | 217 skip_download=skip_download) |
| 212 | 218 |
| 213 def ensure_checkout(self, *args, **kwargs): | 219 def ensure_checkout(self, *args, **kwargs): |
| 214 self._working_dir = self.m.chromium_tests.get_checkout_dir({}) | 220 if self.working_dir: |
| 215 if self._working_dir: | 221 kwargs.setdefault('cwd', self.working_dir) |
| 216 kwargs.setdefault('cwd', self._working_dir) | |
| 217 | 222 |
| 218 return self.m.bot_update.ensure_checkout(*args, **kwargs) | 223 return self.m.bot_update.ensure_checkout(*args, **kwargs) |
| 219 | 224 |
| 220 def _SyncRevisionToTest(self, test_config_params): # pragma: no cover | 225 def _SyncRevisionToTest(self, test_config_params): # pragma: no cover |
| 221 if not self.internal_bisect: | 226 if not self.internal_bisect: |
| 222 return self.ensure_checkout( | 227 return self.ensure_checkout( |
| 223 root_solution_revision=test_config_params['revision']) | 228 root_solution_revision=test_config_params['revision']) |
| 224 else: | 229 else: |
| 225 return self._SyncRevisionsForAndroidChrome( | 230 return self._SyncRevisionsForAndroidChrome( |
| 226 test_config_params['revision_ladder']) | 231 test_config_params['revision_ladder']) |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 if kwargs.get('do_not_nest_wait_for_revision'): | 371 if kwargs.get('do_not_nest_wait_for_revision'): |
| 367 flags['do_not_nest_wait_for_revision'] = kwargs.pop( | 372 flags['do_not_nest_wait_for_revision'] = kwargs.pop( |
| 368 'do_not_nest_wait_for_revision') | 373 'do_not_nest_wait_for_revision') |
| 369 if bot_db is None: # pragma: no cover | 374 if bot_db is None: # pragma: no cover |
| 370 self.bot_db = api.chromium_tests.create_bot_db_from_master_dict( | 375 self.bot_db = api.chromium_tests.create_bot_db_from_master_dict( |
| 371 '', None, None) | 376 '', None, None) |
| 372 else: | 377 else: |
| 373 self.bot_db = bot_db | 378 self.bot_db = bot_db |
| 374 | 379 |
| 375 context = {} | 380 context = {} |
| 376 if self._working_dir: | 381 if self.working_dir: |
| 377 context['cwd'] = self._working_dir | 382 context['cwd'] = self.working_dir |
| 378 | 383 |
| 379 with api.step.context(context): | 384 with api.step.context(context): |
| 380 affected_files = self.m.tryserver.get_files_affected_by_patch() | 385 affected_files = self.m.tryserver.get_files_affected_by_patch() |
| 381 # Skip device setup for internal bisect as it is taken care in | 386 # Skip device setup for internal bisect as it is taken care in |
| 382 # internal recipes. | 387 # internal recipes. |
| 383 if (api.chromium.c.TARGET_PLATFORM == 'android' and | 388 if (api.chromium.c.TARGET_PLATFORM == 'android' and |
| 384 not self.internal_bisect): | 389 not self.internal_bisect): |
| 385 api.chromium_android.common_tests_setup_steps( | 390 api.chromium_android.common_tests_setup_steps( |
| 386 perf_setup=True, remove_system_webview=True) | 391 perf_setup=True, remove_system_webview=True) |
| 387 api.chromium.runhooks() | 392 api.chromium.runhooks() |
| (...skipping 18 matching lines...) Expand all Loading... |
| 406 affected_files, update_step, self.bot_db) | 411 affected_files, update_step, self.bot_db) |
| 407 finally: | 412 finally: |
| 408 if api.chromium.c.TARGET_PLATFORM == 'android': | 413 if api.chromium.c.TARGET_PLATFORM == 'android': |
| 409 if self.internal_bisect: # pragma: no cover | 414 if self.internal_bisect: # pragma: no cover |
| 410 api.chromium_android.init_and_sync( | 415 api.chromium_android.init_and_sync( |
| 411 gclient_config=api.chromium_android.c.internal_dir_name, | 416 gclient_config=api.chromium_android.c.internal_dir_name, |
| 412 use_bot_update=True) | 417 use_bot_update=True) |
| 413 else: | 418 else: |
| 414 self.ensure_checkout() | 419 self.ensure_checkout() |
| 415 api.chromium_android.common_tests_final_steps() | 420 api.chromium_android.common_tests_final_steps() |
| OLD | NEW |