mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-01 13:59:09 -07:00
Fix bugs in ansible-test units command. (#24044)
* Handle old versions of coverage. * Handle old versions of setuptools. * Detect python version for docker/remote units. * Add sanity override for test constraints.
This commit is contained in:
parent
51e3390333
commit
d662f6f0db
6 changed files with 20 additions and 1 deletions
|
@ -16,6 +16,7 @@ from lib.executor import (
|
|||
SubprocessError,
|
||||
ShellConfig,
|
||||
SanityConfig,
|
||||
UnitsConfig,
|
||||
create_shell_command,
|
||||
)
|
||||
|
||||
|
@ -201,6 +202,10 @@ def delegate_docker(args, exclude, require):
|
|||
docker_exec(args, test_id, ['mkdir', '/root/ansible'])
|
||||
docker_exec(args, test_id, ['tar', 'oxzf', '/root/ansible.tgz', '-C', '/root/ansible'])
|
||||
|
||||
# docker images are only expected to have a single python version available
|
||||
if isinstance(args, UnitsConfig) and not args.python:
|
||||
cmd += ['--python', 'default']
|
||||
|
||||
try:
|
||||
docker_exec(args, test_id, cmd, options=cmd_options)
|
||||
finally:
|
||||
|
@ -356,6 +361,10 @@ def delegate_remote(args, exclude, require):
|
|||
if not args.allow_destructive:
|
||||
cmd.append('--allow-destructive')
|
||||
|
||||
# remote instances are only expected to have a single python version available
|
||||
if isinstance(args, UnitsConfig) and not args.python:
|
||||
cmd += ['--python', 'default']
|
||||
|
||||
manage = ManagePosixCI(core_ci)
|
||||
manage.setup()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue