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

Unified Diff: recipe_engine/test.py

Issue 2790493007: test: promote --train to its own subcommand (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « recipe_engine/autoroll.py ('k') | unittests/repo_test_util.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: recipe_engine/test.py
diff --git a/recipe_engine/test.py b/recipe_engine/test.py
index 4636733073aa4e741ef22d3a748f8944f28a6525..1568035c7d027404be528757185cdd6c2d4659ae 100644
--- a/recipe_engine/test.py
+++ b/recipe_engine/test.py
@@ -732,10 +732,29 @@ def parse_args(args):
'the globs have the form of '
'`<recipe_name_glob>[.<test_name_glob>]`. If `.<test_name_glob>` '
'is omitted, it is implied to be `.*`, i.e. all tests.)')
+ # TODO(phajdan.jr): remove --train the switch in favor of train subcommand.
run_p.add_argument(
'--train', action='store_true',
help='re-generate recipe expectations')
iannucci 2017/03/31 17:50:09 let's add a deprecation text in the help too.
Paweł Hajdan Jr. 2017/03/31 17:51:44 Done.
+ train_p = subp.add_parser('train', description='Re-train recipe expectations')
+ train_p.set_defaults(func=lambda opts: run_run(
+ opts.filter, jobs=opts.jobs, json_file=opts.json, train=True))
+ train_p.add_argument(
+ '--jobs', metavar='N', type=int,
+ default=multiprocessing.cpu_count(),
+ help='run N jobs in parallel (default %(default)s)')
+ train_p.add_argument(
+ '--json', metavar='FILE', type=argparse.FileType('w'),
+ help='path to JSON output file')
+ train_p.add_argument(
+ '--filter', action='append',
+ help='glob filter for the tests to run; '
+ 'can be specified multiple times; '
+ 'the globs have the form of '
+ '`<recipe_name_glob>[.<test_name_glob>]`. If `.<test_name_glob>` '
+ 'is omitted, it is implied to be `.*`, i.e. all tests.)')
+
debug_p = subp.add_parser(
'debug', description='Run the tests under debugger (pdb)')
debug_p.set_defaults(func=lambda opts: run_run(
« no previous file with comments | « recipe_engine/autoroll.py ('k') | unittests/repo_test_util.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698