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

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

Issue 2013133002: Avoid nesting steps called under waiting for x: (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Hiding changes behind optional parameter Created 4 years, 6 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
« no previous file with comments | « no previous file | scripts/slave/recipe_modules/auto_bisect/bisector.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 28 matching lines...) Expand all
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 48
49 def perform_bisect(self): 49 def perform_bisect(self, **flags):
50 return local_bisect.perform_bisect(self) 50 return local_bisect.perform_bisect(self, **flags)
51 51
52 def create_bisector(self, bisect_config_dict, dummy_mode=False): 52 def create_bisector(self, bisect_config_dict, dummy_mode=False, **flags):
53 """Passes the api and the config dictionary to the Bisector constructor. 53 """Passes the api and the config dictionary to the Bisector constructor.
54 54
55 For details about the keys in the bisect config dictionary go to: 55 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 56 http://chromium.org/developers/speed-infra/perf-try-bots-bisect-bots/config
57 57
58 Args: 58 Args:
59 bisect_config_dict (dict): Contains the configuration for the bisect job. 59 bisect_config_dict (dict): Contains the configuration for the bisect job.
60 dummy_mode (bool): In dummy mode we prevent the bisector for expanding 60 dummy_mode (bool): In dummy mode we prevent the bisector for expanding
61 the revision range at construction, to avoid the need for lots of step 61 the revision range at construction, to avoid the need for lots of step
62 data when performing certain tests (such as results output). 62 data when performing certain tests (such as results output).
63 63
64 Returns: 64 Returns:
65 An instance of bisector.Bisector. 65 An instance of bisector.Bisector.
66 """ 66 """
67 self.override_poll_interval = bisect_config_dict.get('poll_sleep') 67 self.override_poll_interval = bisect_config_dict.get('poll_sleep')
68 return bisector.Bisector(self, bisect_config_dict, 68 return bisector.Bisector(self, bisect_config_dict,
69 revision_state.RevisionState, 69 revision_state.RevisionState,
70 init_revisions=not dummy_mode) 70 init_revisions=not dummy_mode, **flags)
71 71
72 def set_platform_gs_prefix(self, gs_url): 72 def set_platform_gs_prefix(self, gs_url):
73 """Sets GS path for the platform.""" 73 """Sets GS path for the platform."""
74 self.buildurl_gs_prefix = gs_url # pragma: no cover 74 self.buildurl_gs_prefix = gs_url # pragma: no cover
75 75
76 def set_builder_bot(self, builder_bot): 76 def set_builder_bot(self, builder_bot):
77 """Sets builder name for building binaries.""" 77 """Sets builder name for building binaries."""
78 self.builder_bot = builder_bot # pragma: no cover 78 self.builder_bot = builder_bot # pragma: no cover
79 79
80 def set_internal(self): 80 def set_internal(self):
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 3. A single test run for a recipe bisect job (there will be a 344 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). 345 bisect_config property but it won't contain good/bad revisions).
346 4. A perf try job run. 346 4. A perf try job run.
347 347
348 Args: 348 Args:
349 api: The recipe api object. 349 api: The recipe api object.
350 update_step: Extra update_step to, used for some job types. 350 update_step: Extra update_step to, used for some job types.
351 bot_db: A BotConfigAndTestDB object, used for some job types. 351 bot_db: A BotConfigAndTestDB object, used for some job types.
352 kwargs: Args to use only for legacy bisect. 352 kwargs: Args to use only for legacy bisect.
353 """ 353 """
354 flags = {}
355 if kwargs.get('do_not_nest_wait_for_revision'):
356 flags['do_not_nest_wait_for_revision'] = kwargs.pop(
357 'do_not_nest_wait_for_revision')
354 if bot_db is None: # pragma: no cover 358 if bot_db is None: # pragma: no cover
355 self.bot_db = api.chromium_tests.create_bot_db_from_master_dict( 359 self.bot_db = api.chromium_tests.create_bot_db_from_master_dict(
356 '', None, None) 360 '', None, None)
357 else: 361 else:
358 self.bot_db = bot_db 362 self.bot_db = bot_db
359 affected_files = self.m.tryserver.get_files_affected_by_patch() 363 affected_files = self.m.tryserver.get_files_affected_by_patch()
360 # Skip device setup for internal bisect as it is taken care in 364 # Skip device setup for internal bisect as it is taken care in
361 # internal recipes. 365 # internal recipes.
362 if api.chromium.c.TARGET_PLATFORM == 'android' and not self.internal_bisect: 366 if api.chromium.c.TARGET_PLATFORM == 'android' and not self.internal_bisect:
363 api.chromium_android.common_tests_setup_steps( 367 api.chromium_android.common_tests_setup_steps(
364 perf_setup=True, remove_system_webview=True) 368 perf_setup=True, remove_system_webview=True)
365 api.chromium.runhooks() 369 api.chromium.runhooks()
366 try: 370 try:
367 # Run legacy bisect script if the patch contains bisect.cfg. 371 # Run legacy bisect script if the patch contains bisect.cfg.
368 if BISECT_CONFIG_FILE in affected_files: 372 if BISECT_CONFIG_FILE in affected_files:
369 self.run_bisect_script(**kwargs) 373 self.run_bisect_script(**kwargs)
370 elif api.properties.get('bisect_config'): 374 elif api.properties.get('bisect_config'):
371 # We can distinguish between a config for a full bisect vs a single 375 # We can distinguish between a config for a full bisect vs a single
372 # test by checking for the presence of the good_revision key. 376 # test by checking for the presence of the good_revision key.
373 if api.properties.get('bisect_config').get('good_revision'): 377 if api.properties.get('bisect_config').get('good_revision'):
374 local_bisect.perform_bisect(self) # pragma: no cover 378 local_bisect.perform_bisect(self, **flags) # pragma: no cover
375 else: 379 else:
376 self.start_test_run_for_bisect(update_step, self.bot_db, 380 self.start_test_run_for_bisect(update_step, self.bot_db,
377 api.properties) 381 api.properties)
378 else: 382 else:
379 self.m.perf_try.start_perf_try_job( 383 self.m.perf_try.start_perf_try_job(
380 affected_files, update_step, self.bot_db) 384 affected_files, update_step, self.bot_db)
381 finally: 385 finally:
382 if api.chromium.c.TARGET_PLATFORM == 'android': 386 if api.chromium.c.TARGET_PLATFORM == 'android':
383 api.chromium_android.common_tests_final_steps() 387 api.chromium_android.common_tests_final_steps()
OLDNEW
« no previous file with comments | « no previous file | scripts/slave/recipe_modules/auto_bisect/bisector.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698