Debian Codegraph @

ansible_collections/dellemc/openmanage/tests/README.md

raw symbols SCIP
1 ### Overview
2 Dell OpenManage Ansible Modules unit test scripts are located under
3 [unit](./unit) directory.
4
5 ### Implementing the unit tests
6 Any contribution must have an associated unit test. This section covers the
7 tests that need to be carried out.
8 * The unit tests are required for each new resource, bug fix, or enhancement. They must cover what is being submitted.
9 * The name of the test modules should start with the prefix "test_" in
10 addition to the tested module name. For example: test_ome_user
11
12 ### Prerequisites
13 * Dell OpenManage collections - to install run `ansible-galaxy collection
14 install dellemc.openmanage`
15 * To run the unittest for iDRAC modules, install OpenManage Python Software Development Kit (OMSDK) using
16 `pip install omsdk --upgrade` or from [Dell OpenManage Python SDK](https://github.com/dell/omsdk)
17
18 ### Executing unit tests
19 You can execute them manually by using any tool of your choice, like `pytest` or `ansible-test`.
20
21 #### Executing with `ansible-test`
22 * To install `ansible-test` requirements use
23 ```
24 ansible-test units --requirements
25 ```
26 * To perform a test, run the following command
27 ```
28 ansible-test units -vvv
29 ```
30 * To run any specific module use the below command,
31 ```
32 ansible-test units idrac_server_config_profile
33 ```
34 See [here](https://docs.ansible.com/ansible/latest/dev_guide/testing_units.html#testing-units) for more details on unit-testing.
35
36 #### Executing with `pytest`
37
38 See [here](https://docs.pytest.org/en/stable/).
39
40 ### Acceptance criteria
41 The code coverage of new module should be more than 90%.
42 Execute code coverage with `pytest` as explained [here](https://pytest-cov.readthedocs.io/en/latest/reporting.html).