mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Run unit tests in parallel. (#45812)
This commit is contained in:
parent
f430f60541
commit
abe8e4c9e8
2 changed files with 13 additions and 1 deletions
|
@ -1156,6 +1156,7 @@ def command_units(args):
|
|||
'pytest',
|
||||
'--boxed',
|
||||
'-r', 'a',
|
||||
'-n', 'auto',
|
||||
'--color',
|
||||
'yes' if args.color else 'no',
|
||||
'--junit-xml',
|
||||
|
|
|
@ -24,7 +24,15 @@ def pytest_configure():
|
|||
coverage_instances.append(obj)
|
||||
|
||||
if not coverage_instances:
|
||||
return
|
||||
coverage_config = os.environ.get('_ANSIBLE_COVERAGE_CONFIG')
|
||||
|
||||
if not coverage_config:
|
||||
return
|
||||
|
||||
cov = coverage.Coverage(config_file=coverage_config)
|
||||
coverage_instances.append(cov)
|
||||
else:
|
||||
cov = None
|
||||
|
||||
os_exit = os._exit
|
||||
|
||||
|
@ -36,3 +44,6 @@ def pytest_configure():
|
|||
os_exit(*args, **kwargs)
|
||||
|
||||
os._exit = coverage_exit
|
||||
|
||||
if cov:
|
||||
cov.start()
|
||||
|
|
Loading…
Reference in a new issue