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

pull/58995/head
Matt Clay 5 years ago
parent 43c3b9fb0e
commit 6327a6114b

@ -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)

@ -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 ''

@ -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',

Loading…
Cancel
Save