Skip to content

Commit

Permalink
CI provider fixes for ansible-test. (ansible#71929)
Browse files Browse the repository at this point in the history
* Make Azure Pipelines resource_prefix lowercase.

* Make classification of CI files consistent.

* Update package-data sanity test for AZP.
  • Loading branch information
mattclay committed Sep 25, 2020
1 parent 4f990e7 commit 92b66e3
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 2 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/ansible-test-azp-resource-prefix.yml
@@ -0,0 +1,2 @@
bugfixes:
- ansible-test - The ``resource_prefix`` variable provided to tests running on Azure Pipelines is now converted to lowercase to match other CI providers.
2 changes: 2 additions & 0 deletions changelogs/fragments/ansible-test-change-classification.yml
@@ -0,0 +1,2 @@
bugfixes:
- ansible-test - Change classification using ``--changed`` now consistently handles common configuration files for supported CI providers.
2 changes: 1 addition & 1 deletion test/lib/ansible_test/_internal/ci/azp.py
Expand Up @@ -73,7 +73,7 @@ def generate_resource_prefix(self): # type: () -> str
except KeyError as ex:
raise MissingEnvironmentVariable(name=ex.args[0])

prefix = re.sub(r'[^a-zA-Z0-9]+', '-', prefix)
prefix = re.sub(r'[^a-zA-Z0-9]+', '-', prefix).lower()

return prefix

Expand Down
11 changes: 10 additions & 1 deletion test/lib/ansible_test/_internal/classification.py
Expand Up @@ -377,6 +377,16 @@ def _classify_common(self, path): # type: (str) -> t.Optional[t.Dict[str, str]]

minimal = {}

if os.path.sep not in path:
if filename in (
'azure-pipelines.yml',
'shippable.yml',
):
return all_tests(self.args) # test infrastructure, run all tests

if is_subdir(path, '.azure-pipelines'):
return all_tests(self.args) # test infrastructure, run all tests

if is_subdir(path, '.github'):
return minimal

Expand Down Expand Up @@ -873,7 +883,6 @@ def _classify_ansible(self, path): # type: (str) -> t.Optional[t.Dict[str, str]

if path in (
'setup.py',
'shippable.yml',
):
return all_tests(self.args) # broad impact, run all tests

Expand Down
1 change: 1 addition & 0 deletions test/sanity/code-smell/package-data.py
Expand Up @@ -21,6 +21,7 @@ def assemble_files_to_ship(complete_file_list):
# All files which are in the repository except these:
ignore_patterns = (
# Developer-only tools
'.azure-pipelines/*',
'.github/*',
'.github/*/*',
'changelogs/fragments/*',
Expand Down

0 comments on commit 92b66e3

Please sign in to comment.