Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run unit tests in parallel. #45812

Merged
merged 1 commit into from
Sep 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions test/runner/lib/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1156,6 +1156,7 @@ def command_units(args):
'pytest',
'--boxed',
'-r', 'a',
'-n', 'auto',
'--color',
'yes' if args.color else 'no',
'--junit-xml',
Expand Down
13 changes: 12 additions & 1 deletion test/units/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -36,3 +44,6 @@ def coverage_exit(*args, **kwargs):
os_exit(*args, **kwargs)

os._exit = coverage_exit

if cov:
cov.start()