summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Fontein <felix@fontein.de>2020-11-02 19:44:51 +0100
committerMatt Clay <matt@mystile.com>2020-12-03 17:27:44 -0800
commit903f2e267b9e434b4b9acb7adc71e6a1814f0d72 (patch)
tree65d102ebc1a388b8bbc7fd44aeb36888ba11124d
parent2c66c6297c9d3e4fd2ad3e7055ee520b84d783fc (diff)
downloadansible-903f2e267b9e434b4b9acb7adc71e6a1814f0d72.tar.gz
Improve ansible-test classifications for collections (#72353)
(cherry picked from commit 64a809d2b611b102e9192918953e96c3c341729b)
-rw-r--r--changelogs/fragments/ansible-test-collection-classification.yml2
-rw-r--r--test/lib/ansible_test/_internal/classification.py21
2 files changed, 23 insertions, 0 deletions
diff --git a/changelogs/fragments/ansible-test-collection-classification.yml b/changelogs/fragments/ansible-test-collection-classification.yml
new file mode 100644
index 0000000000..7299ceeadd
--- /dev/null
+++ b/changelogs/fragments/ansible-test-collection-classification.yml
@@ -0,0 +1,2 @@
+bugfixes:
+- "ansible-test - improve classification of changes to ``.gitignore``, ``COPYING``, ``LICENSE``, ``Makefile``, and all files ending with one of ``.in`, ``.md`, ``.rst``, ``.toml``, ``.txt`` in the collection root directory (https://github.com/ansible/ansible/pull/72353)."
diff --git a/test/lib/ansible_test/_internal/classification.py b/test/lib/ansible_test/_internal/classification.py
index 20d4591439..e8b5a18544 100644
--- a/test/lib/ansible_test/_internal/classification.py
+++ b/test/lib/ansible_test/_internal/classification.py
@@ -651,6 +651,9 @@ class PathMapper:
if result is not None:
return result
+ filename = os.path.basename(path)
+ dummy, ext = os.path.splitext(filename)
+
minimal = {}
if path.startswith('changelogs/'):
@@ -659,6 +662,24 @@ class PathMapper:
if path.startswith('docs/'):
return minimal
+ if '/' not in path:
+ if path in (
+ '.gitignore',
+ 'COPYING',
+ 'LICENSE',
+ 'Makefile',
+ ):
+ return minimal
+
+ if ext in (
+ '.in',
+ '.md',
+ '.rst',
+ '.toml',
+ '.txt',
+ ):
+ return minimal
+
return None
def _classify_ansible(self, path): # type: (str) -> t.Optional[t.Dict[str, str]]