summaryrefslogtreecommitdiff
path: root/test/lib/ansible_test/_internal/commands
diff options
context:
space:
mode:
Diffstat (limited to 'test/lib/ansible_test/_internal/commands')
-rw-r--r--test/lib/ansible_test/_internal/commands/coverage/combine.py4
-rw-r--r--test/lib/ansible_test/_internal/commands/integration/__init__.py8
-rw-r--r--test/lib/ansible_test/_internal/commands/integration/cloud/__init__.py4
3 files changed, 12 insertions, 4 deletions
diff --git a/test/lib/ansible_test/_internal/commands/coverage/combine.py b/test/lib/ansible_test/_internal/commands/coverage/combine.py
index 8458081f05..9d43cb041d 100644
--- a/test/lib/ansible_test/_internal/commands/coverage/combine.py
+++ b/test/lib/ansible_test/_internal/commands/coverage/combine.py
@@ -33,6 +33,7 @@ from ...executor import (
from ...data import (
data_context,
+ PayloadConfig,
)
from ...host_configs import (
@@ -81,9 +82,10 @@ def combine_coverage_files(args, host_state): # type: (CoverageCombineConfig, H
pairs = [(path, os.path.relpath(path, data_context().content.root)) for path in exported_paths]
- def coverage_callback(files): # type: (t.List[t.Tuple[str, str]]) -> None
+ def coverage_callback(payload_config: PayloadConfig) -> None:
"""Add the coverage files to the payload file list."""
display.info('Including %d exported coverage file(s) in payload.' % len(pairs), verbosity=1)
+ files = payload_config.files
files.extend(pairs)
data_context().register_payload_callback(coverage_callback)
diff --git a/test/lib/ansible_test/_internal/commands/integration/__init__.py b/test/lib/ansible_test/_internal/commands/integration/__init__.py
index 2ae1e39c9d..21e68037d3 100644
--- a/test/lib/ansible_test/_internal/commands/integration/__init__.py
+++ b/test/lib/ansible_test/_internal/commands/integration/__init__.py
@@ -89,6 +89,7 @@ from .cloud import (
from ...data import (
data_context,
+ PayloadConfig,
)
from ...host_configs import (
@@ -213,11 +214,13 @@ def delegate_inventory(args, inventory_path_src): # type: (IntegrationConfig, s
if isinstance(args, PosixIntegrationConfig):
return
- def inventory_callback(files): # type: (t.List[t.Tuple[str, str]]) -> None
+ def inventory_callback(payload_config: PayloadConfig) -> None:
"""
Add the inventory file to the payload file list.
This will preserve the file during delegation even if it is ignored or is outside the content and install roots.
"""
+ files = payload_config.files
+
inventory_path = get_inventory_relative_path(args)
inventory_tuple = inventory_path_src, inventory_path
@@ -940,11 +943,12 @@ def command_integration_filter(args, # type: TIntegrationConfig
vars_file_src = os.path.join(data_context().content.root, data_context().content.integration_vars_path)
if os.path.exists(vars_file_src):
- def integration_config_callback(files): # type: (t.List[t.Tuple[str, str]]) -> None
+ def integration_config_callback(payload_config: PayloadConfig) -> None:
"""
Add the integration config vars file to the payload file list.
This will preserve the file during delegation even if the file is ignored by source control.
"""
+ files = payload_config.files
files.append((vars_file_src, data_context().content.integration_vars_path))
data_context().register_payload_callback(integration_config_callback)
diff --git a/test/lib/ansible_test/_internal/commands/integration/cloud/__init__.py b/test/lib/ansible_test/_internal/commands/integration/cloud/__init__.py
index 3ca8171947..92540bc3bf 100644
--- a/test/lib/ansible_test/_internal/commands/integration/cloud/__init__.py
+++ b/test/lib/ansible_test/_internal/commands/integration/cloud/__init__.py
@@ -47,6 +47,7 @@ from ....ci import (
from ....data import (
data_context,
+ PayloadConfig,
)
from ....docker_util import (
@@ -189,13 +190,14 @@ class CloudBase(metaclass=abc.ABCMeta):
self.args = args
self.platform = self.__module__.rsplit('.', 1)[-1]
- def config_callback(files): # type: (t.List[t.Tuple[str, str]]) -> None
+ def config_callback(payload_config: PayloadConfig) -> None:
"""Add the config file to the payload file list."""
if self.platform not in self.args.metadata.cloud_config:
return # platform was initialized, but not used -- such as being skipped due to all tests being disabled
if self._get_cloud_config(self._CONFIG_PATH, ''):
pair = (self.config_path, os.path.relpath(self.config_path, data_context().content.root))
+ files = payload_config.files
if pair not in files:
display.info('Including %s config: %s -> %s' % (self.platform, pair[0], pair[1]), verbosity=3)