-
Notifications
You must be signed in to change notification settings - Fork 172
Expand file tree
/
Copy pathMakefile
More file actions
28 lines (25 loc) · 885 Bytes
/
Makefile
File metadata and controls
28 lines (25 loc) · 885 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
venv:
rm -rf .venv
python3 -m venv .venv
. .venv/bin/activate && \
pip install ansible-core>=2.19 ansible-lint \
-r requirements.txt \
-r test-requirements.txt
ifneq ($(origin tname), undefined)
ttype?=modules
TC?=tests/unit/plugins/$(ttype)/test_$(tname).py
else ifneq ($(origin ttype), undefined)
TC?=tests/unit/plugins/$(ttype)
else
TC?=tests/unit/plugins
endif
# Examples
# 1. make unit-test # to run all
# 2. make unit-test ttype=module_utils # to run only module_utils
# 3. make unit-test ttype=modules_ttils tname=ome # to run only modules_utils/ome
# 4. make unit-test tname=idrac_secure_boot # ttype defaults to modules
# 5. make unit-test TC=tests/unit/plugins/modules/test_idrac_secure_boot.py
unit-test:
rm -rf coverage
PYTHONPATH=$(subst ansible_collections/dellemc/openmanage,,$(CURDIR)):$(PYTHONPATH) \
pytest $(TC) --cov=plugins/ --cov-report=html:coverage