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

Unified Diff: recipe_engine/run.py

Issue 1861203002: Make recipes.py run give better messages. (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/recipes-py@master
Patch Set: Remove ast. Created 4 years, 8 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 | « recipe_engine/package.py ('k') | recipes.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: recipe_engine/run.py
diff --git a/recipe_engine/run.py b/recipe_engine/run.py
index 2d1b3f3ebfb297c19f9b96b530c5a41123a1df9c..9c94f4d835ee4ac14691607141c8faab5a3997bb 100644
--- a/recipe_engine/run.py
+++ b/recipe_engine/run.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2013-2015 The Chromium Authors. All rights reserved.
+# Copyright (c) 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@@ -64,6 +64,7 @@ iterable_of_things.
"""
import collections
+import json
import os
import sys
import traceback
@@ -179,7 +180,7 @@ ENV_WHITELIST_POSIX = BUILDBOT_MAGIC_ENV | set([
RecipeResult = collections.namedtuple('RecipeResult', 'result')
-def run_steps(properties, stream_engine, step_runner, universe):
+def run_steps(properties, stream_engine, step_runner, universe_view):
"""Runs a recipe (given by the 'recipe' property).
Args:
@@ -187,7 +188,7 @@ def run_steps(properties, stream_engine, step_runner, universe):
'recipe' property defines which recipe to actually run.
stream_engine: the StreamEngine to use to create individual step streams.
step_runner: The StepRunner to use to 'actually run' the steps.
- universe: The RecipeUniverse to use to load the recipes & modules.
+ universe_view: The RecipeUniverse to use to load the recipes & modules.
Returns: RecipeResult
"""
@@ -205,7 +206,7 @@ def run_steps(properties, stream_engine, step_runner, universe):
'TESTING_SLAVENAME' in os.environ)):
properties['use_mirror'] = False
- engine = RecipeEngine(step_runner, properties, universe)
+ engine = RecipeEngine(step_runner, properties, universe_view)
# Create all API modules and top level RunSteps function. It doesn't launch
# any recipe code yet; RunSteps needs to be called.
@@ -218,11 +219,14 @@ def run_steps(properties, stream_engine, step_runner, universe):
if 'use_mirror' in properties:
del properties_to_print['use_mirror']
+ root_package = universe_view.universe.package_deps.root_package
run_recipe_help_lines = [
- 'To repro this locally, run the following line from a build checkout:',
+ 'To repro this locally, run the following line from a %s checkout:' % (
+ root_package.name),
'',
- './scripts/tools/run_recipe.py %s --properties-file - <<EOF' % recipe,
- repr(properties_to_print),
+ '%s run %s --properties-file - <<EOF' % (os.path.join(
+ '.', root_package.relative_recipes_dir, 'recipes.py'), recipe),
iannucci 2016/04/14 01:18:28 I think there's a discrepancy between run_recipe a
+ '%s' % json.dumps(properties_to_print),
'EOF',
'',
'To run on Windows, you can put the JSON in a file and redirect the',
@@ -237,7 +241,7 @@ def run_steps(properties, stream_engine, step_runner, universe):
# Find and load the recipe to run.
try:
- recipe_script = universe.load_recipe(recipe)
+ recipe_script = universe_view.load_recipe(recipe)
s.write_line('Running recipe with %s' % (properties,))
api = loader.create_recipe_api(recipe_script.LOADED_DEPS,
« no previous file with comments | « recipe_engine/package.py ('k') | recipes.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698