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/developing_modules_general.rst
+2-12Lines changed: 2 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@ It is highly recommended that you use a ``venv`` or ``virtualenv`` for Python de
33
33
34
34
To create a module:
35
35
36
-
1. Create a ``library`` directory in your workspace, your test play should live in the same directory.
36
+
1. Create a ``library`` directory in your workspace. Your test play should live in the same directory.
37
37
2. Create your new module file: ``$ touch library/my_test.py``. Or just open/create it with your editor of choice.
38
38
3. Paste the content below into your new module file. It includes the :ref:`required Ansible format and documentation <developing_modules_documenting>`, a simple :ref:`argument spec for declaring the module options <argument_spec>`, and some example code.
39
39
4. Modify and extend the code to do what you want your new module to do. See the :ref:`programming tips <developing_modules_best_practices>` and :ref:`Python 3 compatibility <developing_python_3>` pages for pointers on writing clean and concise module code.
@@ -149,23 +149,13 @@ You can easily run a full test by including it in a playbook, as long as the ``l
149
149
Testing your newly-created module
150
150
=================================
151
151
152
-
The following two examples will get you started with testing your module code. Please review our :ref:`testing <developing_testing>` section for more detailed
152
+
Review our :ref:`testing <developing_testing>` section for more detailed
153
153
information, including instructions for :ref:`testing module documentation <testing_module_documentation>`, adding :ref:`integration tests <testing_integration>`, and more.
154
154
155
155
.. note::
156
156
If contributing to Ansible, every new module and plugin should have integration tests, even if the tests cannot be run on Ansible CI infrastructure.
157
157
In this case, the tests should be marked with the ``unsupported`` alias in `aliases file <https://docs.ansible.com/ansible/latest/dev_guide/testing/sanity/integration-aliases.html>`_.
158
158
159
-
Performing sanity tests
160
-
-----------------------
161
-
162
-
You can run through Ansible's sanity checks in a container:
Note that this example requires Docker to be installed and running. If you'd rather not use a container for this, you can choose to use ``--venv`` instead of ``--docker``.
0 commit comments