ansible-test ansible-doc sanity test: also run with --json parameter (#69288)

This commit is contained in:
Felix Fontein 2020-05-29 17:52:29 +02:00 committed by GitHub
parent 4794b98f2a
commit 0b82d4499e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 20 deletions

View file

@ -0,0 +1,2 @@
minor_changes:
- "ansible-test - also run the ``ansible-doc`` sanity test with ``--json`` to ensure that the documentation does not contain something that cannot be exported as JSON (https://github.com/ansible/ansible/issues/69238)."

View file

@ -103,7 +103,11 @@ class AnsibleDocTest(SanitySingleVersion):
error_messages = [] error_messages = []
for doc_type in sorted(doc_targets): for doc_type in sorted(doc_targets):
cmd = ['ansible-doc', '-t', doc_type] + sorted(doc_targets[doc_type]) for format_option in [None, '--json']:
cmd = ['ansible-doc', '-t', doc_type]
if format_option is not None:
cmd.append(format_option)
cmd.extend(sorted(doc_targets[doc_type]))
try: try:
with coverage_context(args): with coverage_context(args):