diff options
Diffstat (limited to 'test/lib/ansible_test/_internal/commands/sanity/__init__.py')
-rw-r--r-- | test/lib/ansible_test/_internal/commands/sanity/__init__.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/lib/ansible_test/_internal/commands/sanity/__init__.py b/test/lib/ansible_test/_internal/commands/sanity/__init__.py index 3069511091..d09f94c5f8 100644 --- a/test/lib/ansible_test/_internal/commands/sanity/__init__.py +++ b/test/lib/ansible_test/_internal/commands/sanity/__init__.py @@ -159,6 +159,10 @@ def command_sanity(args): # type: (SanityConfig) -> None if args.skip_test: tests = [target for target in tests if target.name not in args.skip_test] + if not args.host_path: + for test in tests: + test.origin_hook(args) + targets_use_pypi = any(isinstance(test, SanityMultipleVersion) and test.needs_pypi for test in tests) and not args.list_tests host_state = prepare_profiles(args, targets_use_pypi=targets_use_pypi) # sanity @@ -756,6 +760,9 @@ class SanityTest(metaclass=abc.ABCMeta): """A tuple of supported Python versions or None if the test does not depend on specific Python versions.""" return CONTROLLER_PYTHON_VERSIONS + def origin_hook(self, args: SanityConfig) -> None: + """This method is called on the origin, before the test runs or delegation occurs.""" + def filter_targets(self, targets): # type: (t.List[TestTarget]) -> t.List[TestTarget] # pylint: disable=unused-argument """Return the given list of test targets, filtered to include only those relevant for the test.""" if self.no_targets: |