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

Unified Diff: recipes.py

Issue 2721613004: simulation_test_ng: initial CL (Closed)
Patch Set: Created 3 years, 10 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
« recipe_engine/simulation_test_ng.py ('K') | « recipe_engine/simulation_test_ng.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: recipes.py
diff --git a/recipes.py b/recipes.py
index 7455f6f0e20c4d4b3b1c22bb3cbef10da666f038..302dae168118248c66c2848ec2a80de3f0e5da73 100755
--- a/recipes.py
+++ b/recipes.py
@@ -64,6 +64,32 @@ def simulation_test(package_deps, args, op_args):
engine_flags=op_args.engine_flags)
+def simulation_test_ng(package_deps, args, op_args):
+ try:
+ from recipe_engine import simulation_test_ng
+ except ImportError:
+ logging.error(
+ 'Error while importing testing libraries. You may be missing the pip'
+ ' package "coverage". Install it, or use the --use-bootstrap command'
+ ' line argument when calling into the recipe engine, which will install'
+ ' it for you.')
+ raise
+
+ from recipe_engine import loader
+ from recipe_engine import package
+
+ _, config_file = get_package_config(args)
+ universe = loader.RecipeUniverse(package_deps, config_file)
+ universe_view = loader.UniverseView(universe, package_deps.root_package)
+
+ # Prevent flakiness caused by stale pyc files.
+ package.cleanup_pyc(package_deps.root_package.recipes_dir)
+
+ return simulation_test_ng.main(
+ universe_view, raw_args=args.args,
+ engine_flags=op_args.engine_flags)
+
+
def lint(package_deps, args):
from recipe_engine import lint_test
from recipe_engine import loader
@@ -429,6 +455,12 @@ def main():
simulation_test_p.set_defaults(command='simulation_test')
simulation_test_p.add_argument('args')
+ simulation_test_ng_p = subp.add_parser(
+ 'simulation_test_ng',
+ description='Generate or check expectations by simulation (EXPERIMENTAL)')
+ simulation_test_ng_p.set_defaults(command='simulation_test_ng')
+ simulation_test_ng_p.add_argument('args', nargs=argparse.REMAINDER)
+
lint_p = subp.add_parser(
'lint',
description='Check recipes for stylistic and hygenic issues')
@@ -667,6 +699,8 @@ def _real_main(args, op_args):
return 0
if args.command == 'simulation_test':
return simulation_test(package_deps, args, op_args)
+ elif args.command == 'simulation_test_ng':
+ return simulation_test_ng(package_deps, args, op_args)
elif args.command == 'bundle':
return bundle(package_deps, args)
elif args.command == 'lint':
« recipe_engine/simulation_test_ng.py ('K') | « recipe_engine/simulation_test_ng.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698