diff options
-rw-r--r-- | .azure-pipelines/azure-pipelines.yml | 2 | ||||
l--------- | .azure-pipelines/commands/alpine.sh (renamed from test/utils/shippable/alpine.sh) | 0 | ||||
-rwxr-xr-x | .azure-pipelines/commands/cloud.sh (renamed from test/utils/shippable/cloud.sh) | 0 | ||||
-rwxr-xr-x | .azure-pipelines/commands/entry-point.sh (renamed from test/utils/shippable/shippable.sh) | 2 | ||||
l--------- | .azure-pipelines/commands/fedora.sh (renamed from test/utils/shippable/fedora.sh) | 0 | ||||
l--------- | .azure-pipelines/commands/freebsd.sh (renamed from test/utils/shippable/freebsd.sh) | 0 | ||||
l--------- | .azure-pipelines/commands/galaxy.sh (renamed from test/utils/shippable/galaxy.sh) | 0 | ||||
-rwxr-xr-x | .azure-pipelines/commands/generic.sh (renamed from test/utils/shippable/generic.sh) | 0 | ||||
-rwxr-xr-x | .azure-pipelines/commands/i.sh (renamed from test/utils/shippable/i.sh) | 2 | ||||
l--------- | .azure-pipelines/commands/incidental/ios.sh (renamed from test/utils/shippable/incidental/ios.sh) | 0 | ||||
-rwxr-xr-x | .azure-pipelines/commands/incidental/network.sh (renamed from test/utils/shippable/incidental/network.sh) | 0 | ||||
l--------- | .azure-pipelines/commands/incidental/vyos.sh (renamed from test/utils/shippable/incidental/vyos.sh) | 0 | ||||
-rwxr-xr-x | .azure-pipelines/commands/incidental/windows.sh (renamed from test/utils/shippable/incidental/windows.sh) | 0 | ||||
-rwxr-xr-x | .azure-pipelines/commands/linux.sh (renamed from test/utils/shippable/linux.sh) | 0 | ||||
l--------- | .azure-pipelines/commands/macos.sh (renamed from test/utils/shippable/macos.sh) | 0 | ||||
-rwxr-xr-x | .azure-pipelines/commands/remote.sh (renamed from test/utils/shippable/remote.sh) | 0 | ||||
l--------- | .azure-pipelines/commands/rhel.sh (renamed from test/utils/shippable/rhel.sh) | 0 | ||||
-rwxr-xr-x | .azure-pipelines/commands/sanity.sh (renamed from test/utils/shippable/sanity.sh) | 0 | ||||
l--------- | .azure-pipelines/commands/ubuntu.sh (renamed from test/utils/shippable/ubuntu.sh) | 0 | ||||
-rwxr-xr-x | .azure-pipelines/commands/units.sh (renamed from test/utils/shippable/units.sh) | 0 | ||||
-rwxr-xr-x | .azure-pipelines/commands/windows.sh (renamed from test/utils/shippable/windows.sh) | 0 | ||||
-rw-r--r-- | test/lib/ansible_test/_internal/classification/__init__.py | 76 | ||||
-rw-r--r-- | test/sanity/code-smell/package-data.py | 3 |
23 files changed, 41 insertions, 44 deletions
diff --git a/.azure-pipelines/azure-pipelines.yml b/.azure-pipelines/azure-pipelines.yml index 1b8085eddc..16f238de03 100644 --- a/.azure-pipelines/azure-pipelines.yml +++ b/.azure-pipelines/azure-pipelines.yml @@ -27,7 +27,7 @@ variables: - name: coverageBranches value: devel - name: entryPoint - value: test/utils/shippable/shippable.sh + value: .azure-pipelines/commands/entry-point.sh - name: fetchDepth value: 500 diff --git a/test/utils/shippable/alpine.sh b/.azure-pipelines/commands/alpine.sh index 6ddb776854..6ddb776854 120000 --- a/test/utils/shippable/alpine.sh +++ b/.azure-pipelines/commands/alpine.sh diff --git a/test/utils/shippable/cloud.sh b/.azure-pipelines/commands/cloud.sh index da037e09e1..da037e09e1 100755 --- a/test/utils/shippable/cloud.sh +++ b/.azure-pipelines/commands/cloud.sh diff --git a/test/utils/shippable/shippable.sh b/.azure-pipelines/commands/entry-point.sh index 8fa12482f2..0a9e571be1 100755 --- a/test/utils/shippable/shippable.sh +++ b/.azure-pipelines/commands/entry-point.sh @@ -59,4 +59,4 @@ fi ansible-test env --dump --show --timeout "${timeout}" --color -v -"test/utils/shippable/${script}.sh" "${test}" +".azure-pipelines/commands/${script}.sh" "${test}" diff --git a/test/utils/shippable/fedora.sh b/.azure-pipelines/commands/fedora.sh index 6ddb776854..6ddb776854 120000 --- a/test/utils/shippable/fedora.sh +++ b/.azure-pipelines/commands/fedora.sh diff --git a/test/utils/shippable/freebsd.sh b/.azure-pipelines/commands/freebsd.sh index 6ddb776854..6ddb776854 120000 --- a/test/utils/shippable/freebsd.sh +++ b/.azure-pipelines/commands/freebsd.sh diff --git a/test/utils/shippable/galaxy.sh b/.azure-pipelines/commands/galaxy.sh index 700ad3edcf..700ad3edcf 120000 --- a/test/utils/shippable/galaxy.sh +++ b/.azure-pipelines/commands/galaxy.sh diff --git a/test/utils/shippable/generic.sh b/.azure-pipelines/commands/generic.sh index 28eb12688e..28eb12688e 100755 --- a/test/utils/shippable/generic.sh +++ b/.azure-pipelines/commands/generic.sh diff --git a/test/utils/shippable/i.sh b/.azure-pipelines/commands/i.sh index efa2866d2e..2b3eed038b 100755 --- a/test/utils/shippable/i.sh +++ b/.azure-pipelines/commands/i.sh @@ -11,4 +11,4 @@ script="${args[1]}" IFS='/' test="${args[*]:1}" -"test/utils/shippable/incidental/${script}.sh" "${test}" +".azure-pipelines/commands/incidental/${script}.sh" "${test}" diff --git a/test/utils/shippable/incidental/ios.sh b/.azure-pipelines/commands/incidental/ios.sh index cad3e41b70..cad3e41b70 120000 --- a/test/utils/shippable/incidental/ios.sh +++ b/.azure-pipelines/commands/incidental/ios.sh diff --git a/test/utils/shippable/incidental/network.sh b/.azure-pipelines/commands/incidental/network.sh index 1c489f9e31..1c489f9e31 100755 --- a/test/utils/shippable/incidental/network.sh +++ b/.azure-pipelines/commands/incidental/network.sh diff --git a/test/utils/shippable/incidental/vyos.sh b/.azure-pipelines/commands/incidental/vyos.sh index cad3e41b70..cad3e41b70 120000 --- a/test/utils/shippable/incidental/vyos.sh +++ b/.azure-pipelines/commands/incidental/vyos.sh diff --git a/test/utils/shippable/incidental/windows.sh b/.azure-pipelines/commands/incidental/windows.sh index ad77ace726..ad77ace726 100755 --- a/test/utils/shippable/incidental/windows.sh +++ b/.azure-pipelines/commands/incidental/windows.sh diff --git a/test/utils/shippable/linux.sh b/.azure-pipelines/commands/linux.sh index 9cc2f966cb..9cc2f966cb 100755 --- a/test/utils/shippable/linux.sh +++ b/.azure-pipelines/commands/linux.sh diff --git a/test/utils/shippable/macos.sh b/.azure-pipelines/commands/macos.sh index 6ddb776854..6ddb776854 120000 --- a/test/utils/shippable/macos.sh +++ b/.azure-pipelines/commands/macos.sh diff --git a/test/utils/shippable/remote.sh b/.azure-pipelines/commands/remote.sh index b64e0d46fc..b64e0d46fc 100755 --- a/test/utils/shippable/remote.sh +++ b/.azure-pipelines/commands/remote.sh diff --git a/test/utils/shippable/rhel.sh b/.azure-pipelines/commands/rhel.sh index 6ddb776854..6ddb776854 120000 --- a/test/utils/shippable/rhel.sh +++ b/.azure-pipelines/commands/rhel.sh diff --git a/test/utils/shippable/sanity.sh b/.azure-pipelines/commands/sanity.sh index 6dc4d1da9a..6dc4d1da9a 100755 --- a/test/utils/shippable/sanity.sh +++ b/.azure-pipelines/commands/sanity.sh diff --git a/test/utils/shippable/ubuntu.sh b/.azure-pipelines/commands/ubuntu.sh index 6ddb776854..6ddb776854 120000 --- a/test/utils/shippable/ubuntu.sh +++ b/.azure-pipelines/commands/ubuntu.sh diff --git a/test/utils/shippable/units.sh b/.azure-pipelines/commands/units.sh index dc115dec15..dc115dec15 100755 --- a/test/utils/shippable/units.sh +++ b/.azure-pipelines/commands/units.sh diff --git a/test/utils/shippable/windows.sh b/.azure-pipelines/commands/windows.sh index 714588b88b..714588b88b 100755 --- a/test/utils/shippable/windows.sh +++ b/.azure-pipelines/commands/windows.sh diff --git a/test/lib/ansible_test/_internal/classification/__init__.py b/test/lib/ansible_test/_internal/classification/__init__.py index 5c7009488a..3cf6044e52 100644 --- a/test/lib/ansible_test/_internal/classification/__init__.py +++ b/test/lib/ansible_test/_internal/classification/__init__.py @@ -662,21 +662,54 @@ class PathMapper: def _classify_ansible(self, path: str) -> t.Optional[dict[str, str]]: """Return the classification for the given path using rules specific to Ansible.""" + dirname = os.path.dirname(path) + filename = os.path.basename(path) + name, ext = os.path.splitext(filename) + + minimal: dict[str, str] = {} + + # Early classification that needs to occur before common classification belongs here. + if path.startswith('test/units/compat/'): return { 'units': 'test/units/', } + if dirname == '.azure-pipelines/commands': + test_map = { + 'cloud.sh': 'integration:cloud/', + 'linux.sh': 'integration:all', + 'network.sh': 'network-integration:all', + 'remote.sh': 'integration:all', + 'sanity.sh': 'sanity:all', + 'units.sh': 'units:all', + 'windows.sh': 'windows-integration:all', + } + + test_match = test_map.get(filename) + + if test_match: + test_command, test_target = test_match.split(':') + + return { + test_command: test_target, + } + + cloud_target = f'cloud/{name}/' + + if cloud_target in self.integration_targets_by_alias: + return { + 'integration': cloud_target, + } + + # Classification common to both ansible and collections. + result = self._classify_common(path) if result is not None: return result - dirname = os.path.dirname(path) - filename = os.path.basename(path) - name, ext = os.path.splitext(filename) - - minimal: dict[str, str] = {} + # Classification here is specific to ansible, and runs after common classification. if path.startswith('bin/'): return all_tests(self.args) # broad impact, run all tests @@ -792,39 +825,6 @@ class PathMapper: if path.startswith('test/support/'): return all_tests(self.args) # test infrastructure, run all tests - if path.startswith('test/utils/shippable/'): - if dirname == 'test/utils/shippable': - test_map = { - 'cloud.sh': 'integration:cloud/', - 'linux.sh': 'integration:all', - 'network.sh': 'network-integration:all', - 'remote.sh': 'integration:all', - 'sanity.sh': 'sanity:all', - 'units.sh': 'units:all', - 'windows.sh': 'windows-integration:all', - } - - test_match = test_map.get(filename) - - if test_match: - test_command, test_target = test_match.split(':') - - return { - test_command: test_target, - } - - cloud_target = 'cloud/%s/' % name - - if cloud_target in self.integration_targets_by_alias: - return { - 'integration': cloud_target, - } - - return all_tests(self.args) # test infrastructure, run all tests - - if path.startswith('test/utils/'): - return minimal - if '/' not in path: if path in ( '.gitattributes', diff --git a/test/sanity/code-smell/package-data.py b/test/sanity/code-smell/package-data.py index 34617c3946..fc894a776b 100644 --- a/test/sanity/code-smell/package-data.py +++ b/test/sanity/code-smell/package-data.py @@ -29,9 +29,6 @@ def assemble_files_to_ship(complete_file_list): 'hacking/ticket_stubs/*', 'test/sanity/code-smell/botmeta.*', 'test/sanity/code-smell/release-names.*', - 'test/utils/*', - 'test/utils/*/*', - 'test/utils/*/*/*', 'test/results/.tmp/*', 'test/results/.tmp/*/*', 'test/results/.tmp/*/*/*', |