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

Unified Diff: scripts/slave/annotated_run.py

Issue 860383008: Made annotated_run look up recipe from builders.pyl masters. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « scripts/common/chromium_utils.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/slave/annotated_run.py
diff --git a/scripts/slave/annotated_run.py b/scripts/slave/annotated_run.py
index 0f1f33d7c959278bf1d26301245e1cdca37067d5..fc6f2aaa5ab3ee70d25a7605de54050f720424bb 100755
--- a/scripts/slave/annotated_run.py
+++ b/scripts/slave/annotated_run.py
@@ -316,6 +316,29 @@ RecipeExecutionResult = collections.namedtuple(
'RecipeExecutionResult', 'status_code steps_ran')
+def find_recipe(build_properties):
iannucci 2015/02/03 22:29:23 trick: def find_recipe(recipe=None, mastername=
+ """Finds the recipe to run from build_properties.
+
+ If it is not in build_properties, tries to find it in builders.pyl of the
+ master. Mutates build_properties to include it in this case.
+ """
+ if 'recipe' in build_properties:
+ return build_properties['recipe']
+
+ master_path = chromium_utils.MasterPath(build_properties['mastername'])
+ builders_file = os.path.join(master_path, 'builders.pyl')
+ if os.path.isfile(builders_file):
+ builders = chromium_utils.ReadBuildersFile(builders_file)
+ builder = builders['builders'][build_properties['buildername']]
iannucci 2015/02/03 22:29:23 this could raise if ['builders'] doesn't have the
+ recipe = builder['recipe']
+ build_properties['recipe'] = recipe
iannucci 2015/02/03 22:29:23 /me flips out nooooo!!!!! caller should modify bu
+ return recipe
iannucci 2015/02/03 22:29:23 TODO: also return builders['builders'][buildername
+
+ raise LookupError('Cannot find recipe for %s on %s' %
+ (build_properties['buildername'],
+ build_properties['mastername']))
+
+
def run_steps(stream, build_properties, factory_properties,
test_data=recipe_test_api.DisabledTestData()):
"""Returns a tuple of (status_code, steps_ran).
@@ -358,8 +381,7 @@ def run_steps(stream, build_properties, factory_properties,
# to start executing code).
api = None
with stream.step('setup_build') as s:
- assert 'recipe' in factory_properties
- recipe = factory_properties['recipe']
+ recipe = find_recipe(build_properties)
properties_to_print = properties.copy()
if 'use_mirror' in properties:
« no previous file with comments | « scripts/common/chromium_utils.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698