Skip to content

Running Sanity Tests, Unit Tests, and Coverage Report Generation

Kerry Meyer edited this page Aug 20, 2024 · 1 revision

Prerequisites

Running sanity tests

  • ansible-tests sanity [--docker]

Running Unit and Coverage tests: Execution method 1 (using docker)

  • ansible-test units --python python version --coverage --docker
  • ansible-test coverage combine --export tests/output/coverage/
  • ansible-test coverage report | tee <output file name>

Running Unit and Coverage tests: Execution method 2 (native package installation):

  • ansible-test units --python python version --coverage --requirements
  • ansible-test coverage report | tee <output file name>

NOTE: An example value for the python version value in the above execution methods is "3.10"

Additional information on running Unit Tests

https://docs.ansible.com/ansible/latest/dev_guide/testing_units.html#running-tests