mirror of
https://github.com/linux-system-roles/network.git
synced 2026-01-23 02:15:17 +00:00
support testing/linting module_utils code
This does not directly affect network because network has its own solution for dealing with testing/linting module_utils code, but it gets network to feature/code parity with the template and other repos. Defines a shell function in utils.sh - lsr_setup_module_utils - that allows configuring a tox venv installed ansible to have the repo module_utils code in the default pythonpath for the venv, which allows testing and linting the module_utils code without having to otherwise munge or mock the pythonpath. Projects needing this functionality can set in `.travis/config.sh` the variable `RUN_PYTEST_SETUP_MODULE_UTILS` to setup module_utils/ for pytest, and `RUN_PYLINT_SETUP_MODULE_UTILS` to setup module_utils/ for pylint.
This commit is contained in:
parent
11a03f0ceb
commit
dec163940e
6 changed files with 90 additions and 0 deletions
2
tox.ini
2
tox.ini
|
|
@ -22,6 +22,8 @@ passenv = *
|
|||
setenv =
|
||||
PYTHONPATH = {toxinidir}/library:{toxinidir}/module_utils
|
||||
LC_ALL = C
|
||||
SRC_MODULE_UTILS_DIR = {envsitepackagesdir}/ansible/module_utils
|
||||
DEST_MODULE_UTILS_DIR = {toxinidir}/module_utils
|
||||
changedir = {toxinidir}/tests
|
||||
covtargets = --cov={toxinidir}/library --cov={toxinidir}/module_utils
|
||||
pytesttarget = unit
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue