|
|
@ -662,21 +662,54 @@ class PathMapper:
|
|
|
|
|
|
|
|
|
|
|
|
def _classify_ansible(self, path: str) -> t.Optional[dict[str, str]]:
|
|
|
|
def _classify_ansible(self, path: str) -> t.Optional[dict[str, str]]:
|
|
|
|
"""Return the classification for the given path using rules specific to Ansible."""
|
|
|
|
"""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/'):
|
|
|
|
if path.startswith('test/units/compat/'):
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
'units': 'test/units/',
|
|
|
|
'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)
|
|
|
|
result = self._classify_common(path)
|
|
|
|
|
|
|
|
|
|
|
|
if result is not None:
|
|
|
|
if result is not None:
|
|
|
|
return result
|
|
|
|
return result
|
|
|
|
|
|
|
|
|
|
|
|
dirname = os.path.dirname(path)
|
|
|
|
# Classification here is specific to ansible, and runs after common classification.
|
|
|
|
filename = os.path.basename(path)
|
|
|
|
|
|
|
|
name, ext = os.path.splitext(filename)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
minimal: dict[str, str] = {}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if path.startswith('bin/'):
|
|
|
|
if path.startswith('bin/'):
|
|
|
|
return all_tests(self.args) # broad impact, run all tests
|
|
|
|
return all_tests(self.args) # broad impact, run all tests
|
|
|
@ -792,39 +825,6 @@ class PathMapper:
|
|
|
|
if path.startswith('test/support/'):
|
|
|
|
if path.startswith('test/support/'):
|
|
|
|
return all_tests(self.args) # test infrastructure, run all tests
|
|
|
|
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 '/' not in path:
|
|
|
|
if path in (
|
|
|
|
if path in (
|
|
|
|
'.gitattributes',
|
|
|
|
'.gitattributes',
|
|
|
|