Mdd module unit test docs (#31373)

* new documentation for unit testing - especially module unit testing

* unit test documentation reformatting and further fixes

* unit test documentation - point to online coverage reports & fix bad spaces

* Small copy edits.

* First pass copy edit / rewrite. More info needed.

* testing documentation - clean up structure, especially code coverage - reduce repetition

* module unit test documentation - improved introduction

* testing documentation - more fixes from and inspired by review from dharmabumstead

* testing documentation - fixes from mattclay + some other minor tweaks

* More copy edits.

* testing documentation - further fixes from review

* Copy edits

* Copy edits

* More copy edits.
This commit is contained in:
mikedlr 2017-10-19 21:36:57 +01:00 committed by Toshio Kuratomi
commit fbbffbabde
4 changed files with 716 additions and 26 deletions

View file

@ -45,7 +45,19 @@ Use the ``ansible-test shell`` command to get an interactive shell in the same e
Code Coverage
=============
Add the ``--coverage`` option to any test command to collect code coverage data.
Code coverage reports make it easy to identify untested code for which more tests should
be written. Online reports are available but only cover the ``devel`` branch (see
:doc:`testing`). For new code local reports are needed.
Add the ``--coverage`` option to any test command to collect code coverage data. If you
aren't using the ``--tox`` or ``--docker`` options which create an isolated python
environment then you may have to use the ``--requirements`` option to ensure that the
correct version of the coverage module is installed
ansible-test units --coverage apt
ansible-test integration --coverage aws_lambda --tox --requirements
ansible-test coverage html
Reports can be generated in several different formats:
@ -53,4 +65,7 @@ Reports can be generated in several different formats:
* ``ansible-test coverage html`` - HTML report.
* ``ansible-test coverage xml`` - XML report.
To clear data between test runs, use the ``ansible-test coverage erase`` command.
To clear data between test runs, use the ``ansible-test coverage erase`` command. For a full list of features see the online help::
ansible-test coverage --help