From c43b03abe9d5cb77277edb346b3620bb8c70381d Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Thu, 11 Jun 2020 00:13:30 +0200 Subject: [PATCH] Fix shebang sanity test module identification. (#69404) (cherry picked from commit 9d0113be5cc5797e8afe9daadada7ca2d1422ba8) Co-authored-by: Matt Clay --- changelogs/fragments/ansible-test-shebang-sanity.yml | 2 ++ test/lib/ansible_test/_data/sanity/code-smell/shebang.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/ansible-test-shebang-sanity.yml diff --git a/changelogs/fragments/ansible-test-shebang-sanity.yml b/changelogs/fragments/ansible-test-shebang-sanity.yml new file mode 100644 index 00000000000..9159d721553 --- /dev/null +++ b/changelogs/fragments/ansible-test-shebang-sanity.yml @@ -0,0 +1,2 @@ +bugfixes: + - ansible-test - The shebang sanity test now correctly identifies modules in subdirectories in collections. diff --git a/test/lib/ansible_test/_data/sanity/code-smell/shebang.py b/test/lib/ansible_test/_data/sanity/code-smell/shebang.py index 4cd1d3e5d8b..1fbd6971450 100755 --- a/test/lib/ansible_test/_data/sanity/code-smell/shebang.py +++ b/test/lib/ansible_test/_data/sanity/code-smell/shebang.py @@ -83,7 +83,7 @@ def main(): 'test/integration/targets/module_precedence/lib_with_extension', ): is_module = True - elif dirname == 'plugins/modules': + elif path.startswith('plugins/modules/'): is_module = True if is_module: