1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/test/sanity
Daniel Shepherd 698fa37a44 [cloud] Fix #23152 in route53 module and pep8 cleanup (#23156)
update module to support more standard state=present/absent syntax

update module to use required_if, required_together, mutually_exclusive functions where possible

per ryansb review: make documentation section more clear, fix some extra quotes, remove FIXME comment

pre willthames review: force private_zone to True if vpc_id is set and fix word wrap
2017-04-18 11:49:25 -04:00
..
ansible-doc Remove remnants of obsolete fireball mode. 2016-12-09 16:56:34 -07:00
code-smell Fix var precedence check to support python 3. (#23552) 2017-04-13 00:07:40 -07:00
pep8 [cloud] Fix #23152 in route53 module and pep8 cleanup (#23156) 2017-04-18 11:49:25 -04:00
pylint Fix var precedence check to support python 3. (#23552) 2017-04-13 00:07:40 -07:00
rstcheck Add rstcheck to ansible-test and correct issues. (#23550) 2017-04-13 10:28:52 -07:00
shellcheck Disable newer shellcheck tests which don't pass. 2017-02-27 22:31:47 -08:00
validate-modules Fix module validator blacklist handling. 2017-04-12 23:19:39 -07:00
README.rst Expand test documentation. (#23598) 2017-04-13 17:46:21 -07:00

Sanity Tests
============

Sanity tests are made up of scripts and tools used to perform static code analysis.
The primary purpose of these tests is to enforce Ansible coding standards and requirements.

Tests are run with ``ansible-test sanity``.
All available tests are run unless the ``--test`` option is used.

Available Tests
===============

Tests can be listed with ``ansible-test sanity --list-tests``.

This list is a combination of two different categories of tests.

Code Smell Tests
----------------

Miscellaneous `scripts <code-smell/>`_ used for enforcing coding standards and requirements, identifying trip hazards, etc.

    These tests are listed and accessed by script name. There is no actual test named ``code-smell``.

All executable scripts added to the ``code-smell`` directory are automatically detected and executed by ``ansible-test``.

Scripts in the directory which fail can be skipped by adding them to `skip.txt <code-smell/skip.txt>`_.
This is useful for scripts which identify issues that have not yet been resolved in the code base.

Files tested are specific to the individual test scripts and are not affected by command line arguments.

Built-in Tests
--------------

These tests are integrated directly into ``ansible-test``.
All files relevant to each test are tested unless specific files are specified.

ansible-doc
~~~~~~~~~~~

Verifies that ``ansible-doc`` can parse module documentation on all supported python versions.

pep8
~~~~

Python static analysis for PEP 8 style guideline compliance.

pylint
~~~~~~

Python static analysis for common programming errors.

rstcheck
~~~~~~~~

Check reStructuredText files for syntax and formatting issues.

shellcheck
~~~~~~~~~~

Static code analysis for shell scripts using the excellent `shellcheck <https://www.shellcheck.net/>`_ tool.

validate-modules
~~~~~~~~~~~~~~~~

Analyze modules for common issues in code and documentation.

yamllint
~~~~~~~~

Check YAML files for syntax and formatting issues.