mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 11:51:26 -07:00
Add sanity import test to ansible-test. (#26730)
* Add sanity import test to ansible-test. * Run sanity import test on all python versions.
This commit is contained in:
parent
74cc99fa35
commit
0b784c65b1
9 changed files with 257 additions and 4 deletions
|
@ -864,7 +864,7 @@ def compile_version(args, python_version, include, exclude):
|
|||
return TestSuccess(command, test, python_version=python_version)
|
||||
|
||||
|
||||
def intercept_command(args, cmd, target_name, capture=False, env=None, data=None, cwd=None, python_version=None):
|
||||
def intercept_command(args, cmd, target_name, capture=False, env=None, data=None, cwd=None, python_version=None, path=None):
|
||||
"""
|
||||
:type args: TestConfig
|
||||
:type cmd: collections.Iterable[str]
|
||||
|
@ -874,6 +874,7 @@ def intercept_command(args, cmd, target_name, capture=False, env=None, data=None
|
|||
:type data: str | None
|
||||
:type cwd: str | None
|
||||
:type python_version: str | None
|
||||
:type path: str | None
|
||||
:rtype: str | None, str | None
|
||||
"""
|
||||
if not env:
|
||||
|
@ -883,7 +884,7 @@ def intercept_command(args, cmd, target_name, capture=False, env=None, data=None
|
|||
inject_path = get_coverage_path(args)
|
||||
config_path = os.path.join(inject_path, 'injector.json')
|
||||
version = python_version or args.python_version
|
||||
interpreter = find_executable('python%s' % version)
|
||||
interpreter = find_executable('python%s' % version, path=path)
|
||||
coverage_file = os.path.abspath(os.path.join(inject_path, '..', 'output', '%s=%s=%s=%s=coverage' % (
|
||||
args.command, target_name, args.coverage_label or 'local-%s' % version, 'python-%s' % version)))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue