* Docsite: move a stepped down steering committee member to past members (#77715) (cherry picked from commita1ddb83fc1) * add collection pr review checklist (#77661) Co-authored-by: Emmanuel Ugwu <32464178+ugwutotheeshoes@users.noreply.github.com> Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru> (cherry picked from commitef2fe6823c) * clarify latest release (#77577) * clarify latest release * fix tables (cherry picked from commitf633b62cbc) * typo in doc (#77672) (cherry picked from commitc71faec595) * Docs: `ansible-test sanity` example with a folder ##### SUMMARY The docs mentions explicitly that you can run the tests against certain files which might not relay that it works on folders too! Let's make this clear :) ##### ISSUE TYPE - Docs Pull Request +label: docsite_pr (cherry picked from commit52bd59c481) * docs: update porting guide for ansible 6.0.0a2 (#77736) (cherry picked from commit0cfc291573) * simplify developing modules (#77647) (cherry picked from commit255745b3e6) * Mention admin requirement for runas become (#77722) (cherry picked from commitdd094a4413) * core branch descriptions (#76152) (cherry picked from commitd352f2ec21) * Fix ansible-test import analysis warning. Fix overlooked in https://github.com/ansible/ansible/pull/68372/ (cherry picked from commit77732ed50d) * Revert "Fix ansible-test import analysis warning." This reverts commit676f1056cb. Co-authored-by: Andrew Klychkov <aklychko@redhat.com> Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com> Co-authored-by: Kristian Heljas <11139388+kristianheljas@users.noreply.github.com> Co-authored-by: David Moreau Simard <moi@dmsimard.com> Co-authored-by: Brian Coca <bcoca@users.noreply.github.com> Co-authored-by: Jordan Borean <jborean93@gmail.com> Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com> Co-authored-by: Matt Clay <matt@mystile.com>
57 lines
1.5 KiB
ReStructuredText
57 lines
1.5 KiB
ReStructuredText
:orphan:
|
|
|
|
.. _testing_sanity:
|
|
|
|
************
|
|
Sanity Tests
|
|
************
|
|
|
|
.. contents:: Topics
|
|
|
|
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.
|
|
|
|
|
|
How to run
|
|
==========
|
|
|
|
.. note::
|
|
To run sanity tests using docker, always use the default docker image
|
|
by passing the ``--docker`` or ``--docker default`` argument.
|
|
|
|
.. note::
|
|
When using docker and the ``--base-branch`` argument,
|
|
also use the ``--keep-git`` argument to avoid git related errors.
|
|
|
|
.. code:: shell
|
|
|
|
source hacking/env-setup
|
|
|
|
# Run all sanity tests
|
|
ansible-test sanity
|
|
|
|
# Run all sanity tests including disabled ones
|
|
ansible-test sanity --allow-disabled
|
|
|
|
# Run all sanity tests against certain file(s)
|
|
ansible-test sanity lib/ansible/modules/files/template.py
|
|
|
|
# Run all sanity tests against certain folder(s)
|
|
ansible-test sanity lib/ansible/modules/files/
|
|
|
|
# Run all tests inside docker (good if you don't have dependencies installed)
|
|
ansible-test sanity --docker default
|
|
|
|
# Run validate-modules against a specific file
|
|
ansible-test sanity --test validate-modules lib/ansible/modules/files/template.py
|
|
|
|
Available Tests
|
|
===============
|
|
|
|
Tests can be listed with ``ansible-test sanity --list-tests``.
|
|
|
|
See the full list of :ref:`sanity tests <all_sanity_tests>`, which details the various tests and details how to fix identified issues.
|