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

Unified Diff: recipes.py

Issue 1421843006: Add simple depends_on API. (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/recipes-py@master
Patch Set: Made it do properties and multi Created 5 years, 1 month 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
Index: recipes.py
diff --git a/recipes.py b/recipes.py
index 5c4c67760d25013cc4593d0916f4676b608035e5..6e1ed31caeac7ac75dc9b9e8d995562ee375e20e 100755
--- a/recipes.py
+++ b/recipes.py
@@ -31,7 +31,12 @@ def get_package_config(args):
def simulation_test(package_deps, args):
from recipe_engine import simulation_test
- simulation_test.main(package_deps, args=json.loads(args.args))
+ from recipe_engine import loader
+
+ _, config_file = get_package_config(args)
+ universe = loader.RecipeUniverse(package_deps, config_file.path)
+
+ simulation_test.main(universe, args=json.loads(args.args))
def lint(package_deps, args):
@@ -46,9 +51,8 @@ def handle_recipe_return(recipe_result, result_filename, stream):
if result_filename:
with open(result_filename, 'w') as f:
f.write(result_string)
- else:
- with stream.step('recipe result') as s:
- s.write_log_lines('result', [result_string])
+ with stream.step('recipe result') as s:
+ s.write_log_lines('result', [result_string])
if 'reason' in recipe_result.result:
with stream.step('recipe failure reason') as s:
@@ -101,7 +105,8 @@ def run(package_deps, args):
os.environ['PYTHONUNBUFFERED'] = '1'
os.environ['PYTHONIOENCODING'] = 'UTF-8'
- universe = loader.RecipeUniverse(package_deps)
+ _, config_file = get_package_config(args)
+ universe = loader.RecipeUniverse(package_deps, config_file.path)
workdir = (args.workdir or
os.path.join(os.path.dirname(os.path.realpath(__file__)), 'workdir'))
@@ -115,7 +120,6 @@ def run(package_deps, args):
try:
ret = recipe_run.run_steps(properties, stream, universe=universe)
-
finally:
os.chdir(old_cwd)

Powered by Google App Engine
This is Rietveld 408576698