You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docsite/rst/dev_guide/testing_sanity.rst
+30-19Lines changed: 30 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -14,39 +14,50 @@ The primary purpose of these tests is to enforce Ansible coding standards and re
14
14
Tests are run with ``ansible-test sanity``.
15
15
All available tests are run unless the ``--test`` option is used.
16
16
17
+
.. _set_up_env_to_run_tests:
18
+
19
+
Set up your environment
20
+
=======================
21
+
22
+
1. :ref:`Install ansible-core<installation_guide>` that provides the ``ansible-test`` tool.
23
+
24
+
* If you want to run checks available in the development version of ``ansible-core``, :ref:`install it from source code<from_source>`.
25
+
26
+
* Run ``source hacking/env-setup`` from its source code directory in the same terminal session you run your tests.
27
+
28
+
2. Install ``podman`` or ``docker`` to avoid installing all the dependencies on your system.
29
+
3. If you test files in a collection:
30
+
31
+
* Ensure you have your collection installed in the following path in your home directory: ``~/ansible_collections/<NAMESPACE>/<COLLECTION_NAME>``. For instance, in case of the ``community.general`` collection, it will be ``~/ansible_collections/community/general``
32
+
* If your collection is hosted on a remote server such as GitHub, clone it to that path as follows: ``git clone <COLLECTION_REPO_URL> ~/ansible_collections/<NAMESPACE>/<COLLECTION_NAME>``
17
33
18
34
How to run
19
35
==========
20
36
21
37
.. note::
22
-
To run sanity tests using docker, always use the default docker image
23
-
by passing the ``--docker`` or ``--docker default`` argument.
38
+
To run sanity tests using podman or docker, always use the default docker image
39
+
by passing the ``--docker`` argument without specifying the image name.
40
+
41
+
42
+
1. When testing files in a collection, change your location to your collection directory you created while :ref:`setting up your environment<set_up_env_to_run_tests>`:
0 commit comments