summaryrefslogtreecommitdiffstats
path: root/test/lib
diff options
context:
space:
mode:
authorMatt Clay <matt@mystile.com>2020-01-28 02:22:02 +0100
committerMatt Clay <matt@mystile.com>2020-01-29 02:48:54 +0100
commitefd2dd89295deffbd60f87c13da2074512340660 (patch)
tree7fe7b56ceb0c29baf4fdb1fbc27bd8dace180710 /test/lib
parentAdd a `--no-pip-check` option to ansible-test. (diff)
downloadansible-efd2dd89295deffbd60f87c13da2074512340660.tar.xz
ansible-efd2dd89295deffbd60f87c13da2074512340660.zip
Add more ansible-test args to delegation config.
Diffstat (limited to 'test/lib')
-rw-r--r--test/lib/ansible_test/_internal/config.py22
-rw-r--r--test/lib/ansible_test/_internal/delegation.py13
2 files changed, 35 insertions, 0 deletions
diff --git a/test/lib/ansible_test/_internal/config.py b/test/lib/ansible_test/_internal/config.py
index 5b2b6c9e9e..53a92efd60 100644
--- a/test/lib/ansible_test/_internal/config.py
+++ b/test/lib/ansible_test/_internal/config.py
@@ -13,6 +13,7 @@ from .util import (
find_python,
generate_pip_command,
get_docker_completion,
+ get_remote_completion,
ApplicationError,
)
@@ -91,6 +92,12 @@ class EnvironmentConfig(CommonConfig):
self.inject_httptester = args.inject_httptester if 'inject_httptester' in args else False # type: bool
self.httptester = docker_qualify_image(args.httptester if 'httptester' in args else '') # type: str
+ if self.get_delegated_completion().get('httptester', 'enabled') == 'disabled':
+ self.httptester = False
+
+ if self.get_delegated_completion().get('pip-check', 'enabled') == 'disabled':
+ self.pip_check = False
+
if args.check_python and args.check_python != actual_major_minor:
raise ApplicationError('Running under Python %s instead of Python %s as expected.' % (actual_major_minor, args.check_python))
@@ -117,6 +124,18 @@ class EnvironmentConfig(CommonConfig):
"""
return generate_pip_command(self.python_executable)
+ def get_delegated_completion(self):
+ """Returns a dictionary of settings specific to the selected delegation system, if any. Otherwise returns an empty dictionary.
+ :rtype: dict[str, str]
+ """
+ if self.docker:
+ return get_docker_completion().get(self.docker_raw, {})
+
+ if self.remote:
+ return get_remote_completion().get(self.remote, {})
+
+ return {}
+
class TestConfig(EnvironmentConfig):
"""Configuration common to all test commands."""
@@ -236,6 +255,9 @@ class IntegrationConfig(TestConfig):
self.no_temp_workdir = args.no_temp_workdir
self.no_temp_unicode = args.no_temp_unicode
+ if self.get_delegated_completion().get('temp-unicode', 'enabled') == 'disabled':
+ self.no_temp_unicode = True
+
if self.list_targets:
self.explain = True
diff --git a/test/lib/ansible_test/_internal/delegation.py b/test/lib/ansible_test/_internal/delegation.py
index 24630277e8..56ca578bdc 100644
--- a/test/lib/ansible_test/_internal/delegation.py
+++ b/test/lib/ansible_test/_internal/delegation.py
@@ -575,6 +575,12 @@ def filter_options(args, argv, options, exclude, require):
'--base-branch': 1,
})
+ if isinstance(args, IntegrationConfig):
+ options.update({
+ '--no-temp-unicode': 0,
+ '--no-pip-check': 0,
+ })
+
if isinstance(args, (NetworkIntegrationConfig, WindowsIntegrationConfig)):
options.update({
'--inventory': 1,
@@ -621,3 +627,10 @@ def filter_options(args, argv, options, exclude, require):
yield '--redact'
else:
yield '--no-redact'
+
+ if isinstance(args, IntegrationConfig):
+ if args.no_temp_unicode:
+ yield '--no-temp-unicode'
+
+ if not args.pip_check:
+ yield '--no-pip-check'