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

Side by Side Diff: scripts/slave/annotated_run.py

Issue 187203005: Minor cleanup of some recipe framework code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | scripts/slave/recipe_api.py » ('j') | scripts/slave/recipe_config.py » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Entry point for fully-annotated builds. 6 """Entry point for fully-annotated builds.
7 7
8 This script is part of the effort to move all builds to annotator-based 8 This script is part of the effort to move all builds to annotator-based
9 systems. Any builder configured to use the AnnotatorFactory.BaseFactory() 9 systems. Any builder configured to use the AnnotatorFactory.BaseFactory()
10 found in scripts/master/factory/annotator_factory.py executes a single 10 found in scripts/master/factory/annotator_factory.py executes a single
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 def main(argv=None): 372 def main(argv=None):
373 opts, _ = get_args(argv) 373 opts, _ = get_args(argv)
374 374
375 stream = annotator.StructuredAnnotationStream(seed_steps=['setup_build']) 375 stream = annotator.StructuredAnnotationStream(seed_steps=['setup_build'])
376 376
377 ret = run_steps(stream, opts.build_properties, opts.factory_properties) 377 ret = run_steps(stream, opts.build_properties, opts.factory_properties)
378 return ret.status_code 378 return ret.status_code
379 379
380 380
381 def run_steps(stream, build_properties, factory_properties, 381 def run_steps(stream, build_properties, factory_properties,
382 api=recipe_loader.CreateRecipeApi, 382 api=recipe_loader.create_recipe_api,
383 test=recipe_test_api.DisabledTestData()): 383 test=recipe_test_api.DisabledTestData()):
384 """Returns a tuple of (status_code, steps_ran). 384 """Returns a tuple of (status_code, steps_ran).
385 385
386 Only one of these values will be set at a time. This is mainly to support the 386 Only one of these values will be set at a time. This is mainly to support the
387 testing interface used by unittests/recipes_test.py. 387 testing interface used by unittests/recipes_test.py.
388 """ 388 """
389 stream.honor_zero_return_code() 389 stream.honor_zero_return_code()
390 MakeStepsRetval = collections.namedtuple('MakeStepsRetval', 390 MakeStepsRetval = collections.namedtuple('MakeStepsRetval',
391 'status_code steps_ran') 391 'status_code steps_ran')
392 392
(...skipping 12 matching lines...) Expand all
405 if ('use_mirror' not in properties and ( 405 if ('use_mirror' not in properties and (
406 'TESTING_MASTERNAME' in os.environ or 406 'TESTING_MASTERNAME' in os.environ or
407 'TESTING_SLAVENAME' in os.environ)): 407 'TESTING_SLAVENAME' in os.environ)):
408 properties['use_mirror'] = False 408 properties['use_mirror'] = False
409 409
410 step_history = collections.OrderedDict() 410 step_history = collections.OrderedDict()
411 with stream.step('setup_build') as s: 411 with stream.step('setup_build') as s:
412 assert 'recipe' in factory_properties 412 assert 'recipe' in factory_properties
413 recipe = factory_properties['recipe'] 413 recipe = factory_properties['recipe']
414 try: 414 try:
415 recipe_module = recipe_loader.LoadRecipe(recipe) 415 recipe_module = recipe_loader.load_recipe(recipe)
416 stream.emit('Running recipe with %s' % (properties,)) 416 stream.emit('Running recipe with %s' % (properties,))
417 steps = recipe_module.GenSteps(api(recipe_module.DEPS, 417 steps = recipe_module.GenSteps(api(recipe_module.DEPS,
418 properties=properties, 418 properties=properties,
419 step_history=step_history)) 419 step_history=step_history))
420 assert inspect.isgenerator(steps) 420 assert inspect.isgenerator(steps)
421 s.step_text('<br/>running recipe: "%s"' % recipe) 421 s.step_text('<br/>running recipe: "%s"' % recipe)
422 except recipe_loader.NoSuchRecipe as e: 422 except recipe_loader.NoSuchRecipe as e:
423 s.step_text('<br/>recipe not found: %s' % e) 423 s.step_text('<br/>recipe not found: %s' % e)
424 s.step_failure() 424 s.step_failure()
425 return MakeStepsRetval(2, None) 425 return MakeStepsRetval(2, None)
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 511
512 def shell_main(argv): 512 def shell_main(argv):
513 if UpdateScripts(): 513 if UpdateScripts():
514 return subprocess.call([sys.executable] + argv) 514 return subprocess.call([sys.executable] + argv)
515 else: 515 else:
516 return main(argv) 516 return main(argv)
517 517
518 518
519 if __name__ == '__main__': 519 if __name__ == '__main__':
520 sys.exit(shell_main(sys.argv)) 520 sys.exit(shell_main(sys.argv))
OLDNEW
« no previous file with comments | « no previous file | scripts/slave/recipe_api.py » ('j') | scripts/slave/recipe_config.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698