Add ansible-test units --num-workers option.

This commit is contained in:
Matt Clay 2019-07-11 14:38:50 -07:00
parent 43c3b9fb0e
commit 6327a6114b
3 changed files with 7 additions and 1 deletions

View file

@ -382,6 +382,11 @@ def parse_args():
action='store_true',
help='collect tests but do not execute them')
# noinspection PyTypeChecker
units.add_argument('--num-workers',
type=int,
help='number of workers to use (default: auto)')
units.add_argument('--requirements-mode',
choices=('only', 'skip'),
help=argparse.SUPPRESS)

View file

@ -261,6 +261,7 @@ class UnitsConfig(TestConfig):
super(UnitsConfig, self).__init__(args, 'units')
self.collect_only = args.collect_only # type: bool
self.num_workers = args.num_workers # type: int
self.requirements_mode = args.requirements_mode if 'requirements_mode' in args else ''

View file

@ -1331,7 +1331,7 @@ def command_units(args):
'pytest',
'--boxed',
'-r', 'a',
'-n', 'auto',
'-n', str(args.num_workers) if args.num_workers else 'auto',
'--color',
'yes' if args.color else 'no',
'--junit-xml',