[stable-2.10] Test netconf plugins in ansible-doc sanity test.

(cherry picked from commit 8d92df4537)

Co-authored-by: Matt Clay <matt@mystile.com>
This commit is contained in:
Matt Clay 2020-06-24 15:23:55 -07:00
parent 143827b0ad
commit 73d9054b32
2 changed files with 4 additions and 3 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- ansible-test - The ``ansible-doc`` sanity test now works for ``netconf`` plugins.

View file

@ -50,18 +50,17 @@ class AnsibleDocTest(SanitySingleVersion):
def filter_targets(self, targets): # type: (t.List[TestTarget]) -> t.List[TestTarget]
"""Return the given list of test targets, filtered to include only those relevant for the test."""
# This should use documentable plugins from constants instead
plugin_type_blacklist = set([
unsupported_plugin_types = set([
# not supported by ansible-doc
'action',
'doc_fragments',
'filter',
'module_utils',
'netconf',
'terminal',
'test',
])
plugin_paths = [plugin_path for plugin_type, plugin_path in data_context().content.plugin_paths.items() if plugin_type not in plugin_type_blacklist]
plugin_paths = [plugin_path for plugin_type, plugin_path in data_context().content.plugin_paths.items() if plugin_type not in unsupported_plugin_types]
return [target for target in targets
if os.path.splitext(target.path)[1] == '.py'