-
Notifications
You must be signed in to change notification settings - Fork 60
Running Sanity Tests, Unit Tests, and Coverage Report Generation
Kerry Meyer edited this page Aug 20, 2024
·
1 revision
-
Install the collection version to be tested.
-
Install Docker if you wish to use the "docker" method. For Ubuntu, you can use the following instructions for this: https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-20-04
-
For OpenSuse (Leap 15), the following instructions can be used: https://www.linuxtechi.com/install-docker-on-opensuse-leap/
-
cd to the ansible collection installation root directory (e.g. "cd ~/.ansible/collections/ansible_collections/dellemc/enterprise_sonic")
- ansible-tests sanity [--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>
- 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"
https://docs.ansible.com/ansible/latest/dev_guide/testing_units.html#running-tests