summaryrefslogtreecommitdiffstats
path: root/docs/docsite/rst/dev_guide/testing_sanity.rst
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-14 20:03:01 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-14 20:03:01 +0000
commita453ac31f3428614cceb99027f8efbdb9258a40b (patch)
treef61f87408f32a8511cbd91799f9cececb53e0374 /docs/docsite/rst/dev_guide/testing_sanity.rst
parentInitial commit. (diff)
downloadansible-a453ac31f3428614cceb99027f8efbdb9258a40b.tar.xz
ansible-a453ac31f3428614cceb99027f8efbdb9258a40b.zip
Adding upstream version 2.10.7+merged+base+2.10.8+dfsg.upstream/2.10.7+merged+base+2.10.8+dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'docs/docsite/rst/dev_guide/testing_sanity.rst')
-rw-r--r--docs/docsite/rst/dev_guide/testing_sanity.rst53
1 files changed, 53 insertions, 0 deletions
diff --git a/docs/docsite/rst/dev_guide/testing_sanity.rst b/docs/docsite/rst/dev_guide/testing_sanity.rst
new file mode 100644
index 00000000..a4f99edd
--- /dev/null
+++ b/docs/docsite/rst/dev_guide/testing_sanity.rst
@@ -0,0 +1,53 @@
+: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 ``--docker-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 against certain files
+ ansible-test sanity lib/ansible/modules/files/template.py
+
+ # 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.