ansible/test/integration/targets/ansible-doc/test.yml
Brian Coca 062e780a68
starting metadata sunset (#69454)
* starting metadata sunset

 - purged metadata from any requirements
 - fix indent in generic handler for yaml content (whey metadata display was off)
 - make more resilient against bad formed docs
 - removed all metadata from docs template
 - remove metadata from schemas
 - removed mdata tests and from unrelated tests

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Rick Elrod <rick@elrod.me>
2020-06-04 21:01:46 -04:00

75 lines
2.2 KiB
YAML

- hosts: localhost
gather_facts: no
environment:
ANSIBLE_LIBRARY: "{{ playbook_dir }}/library"
tasks:
- name: non-existent module
command: ansible-doc test_does_not_exist
register: result
- assert:
that:
- '"[WARNING]: module test_does_not_exist not found in:" in result.stderr'
- name: documented module
command: ansible-doc test_docs
register: result
- assert:
that:
- '"WARNING" not in result.stderr'
- '"TEST_DOCS " in result.stdout'
- '"AUTHOR: Ansible Core Team" in result.stdout'
- name: documented module without metadata
command: ansible-doc test_docs_no_metadata
register: result
- assert:
that:
- '"WARNING" not in result.stderr'
- '"TEST_DOCS_NO_METADATA " in result.stdout'
- '"AUTHOR: Ansible Core Team" in result.stdout'
- name: documented module with no status in metadata
command: ansible-doc test_docs_no_status
register: result
- assert:
that:
- '"WARNING" not in result.stderr'
- '"TEST_DOCS_NO_STATUS " in result.stdout'
- '"AUTHOR: Ansible Core Team" in result.stdout'
- name: documented module with non-iterable status in metadata
command: ansible-doc test_docs_non_iterable_status
register: result
- assert:
that:
- '"WARNING" not in result.stderr'
- '"TEST_DOCS_NON_ITERABLE_STATUS " in result.stdout'
- '"AUTHOR: Ansible Core Team" in result.stdout'
- name: documented module with removed status
command: ansible-doc test_docs_removed_status
register: result
- assert:
that:
- '"WARNING" not in result.stderr'
- '"TEST_DOCS_REMOVED_STATUS " in result.stdout'
- '"AUTHOR: Ansible Core Team" in result.stdout'
- name: empty module
command: ansible-doc test_empty
register: result
ignore_errors: true
- assert:
that:
- result is failed
- name: module with no documentation
command: ansible-doc test_no_docs
register: result
ignore_errors: true
- assert:
that:
- result is failed