Fix ansible-test coverage of ansible-connection.
This commit is contained in:
parent
21069c84d9
commit
3c3cf50e7a
2 changed files with 11 additions and 0 deletions
|
@ -0,0 +1,2 @@
|
|||
bugfixes:
|
||||
- ansible-test once again properly collects code coverage for ``ansible-connection``
|
|
@ -27,6 +27,7 @@ from .util_common import (
|
|||
)
|
||||
|
||||
from .config import (
|
||||
IntegrationConfig,
|
||||
PosixIntegrationConfig,
|
||||
EnvironmentConfig,
|
||||
CommonConfig,
|
||||
|
@ -75,6 +76,14 @@ def ansible_environment(args, color=True, ansible_config=None):
|
|||
PATH=path,
|
||||
)
|
||||
|
||||
if isinstance(args, IntegrationConfig) and args.coverage:
|
||||
# standard path injection is not effective for ansible-connection, instead the location must be configured
|
||||
# ansible-connection only requires the injector for code coverage
|
||||
# the correct python interpreter is already selected using the sys.executable used to invoke ansible
|
||||
ansible.update(dict(
|
||||
ANSIBLE_CONNECTION_PATH=os.path.join(ANSIBLE_TEST_DATA_ROOT, 'injector', 'ansible-connection'),
|
||||
))
|
||||
|
||||
if isinstance(args, PosixIntegrationConfig):
|
||||
ansible.update(dict(
|
||||
ANSIBLE_PYTHON_INTERPRETER='/set/ansible_python_interpreter/in/inventory', # force tests to set ansible_python_interpreter in inventory
|
||||
|
|
Loading…
Reference in a new issue