You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

49 lines
1.9 KiB

[tox]
envlist = py3,flake8,docs
[testenv]
setenv =
VIRTUAL_ENV={envdir}
DJANGO_SETTINGS_MODULE=enough.settings
passenv =
GITLAB_CI
PYTEST_ADDOPTS
HOME
allowlist_externals = env
usedevelop = True
install_command = pip install {opts} {packages}
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/requirements-dev.txt
commands = coverage run --source=enough {envbindir}/py.test -vvv --durations 10 {posargs:tests}
coverage report --omit=*test*,*tox* --show-missing
[testenv:flake8]
commands = flake8 {posargs}
#
# Integration tests
#
[testenv:{infrastructure,bind,authorized_keys,backup,certificate,postfix,icinga,openvpn,wekan,misc,pad,firewall,gitlab,api,wazuh,weblate,website,chat,cloud,enough,forum,packages,securedrop,jitsi,wordpress,openedx,psono}]
passenv =
ENOUGH_API_TOKEN
PYTEST_ADDOPTS
# REQUESTS_CA_BUNDLE is set in enough/common/data/base.dockerfile but inconvenient in a test environment
commands = env --unset=REQUESTS_CA_BUNDLE {envbindir}/py.test --log-cli-level INFO -s --ssh-identity-file=infrastructure_key --ansible-inventory={envdir}/.pytest_cache/d/dotenough/{envname}.test/inventory {posargs:playbooks/{envname}/tests}
[testenv:enough_nginx]
passenv =
ENOUGH_API_TOKEN
PYTEST_ADDOPTS
# REQUESTS_CA_BUNDLE is set in enough/common/data/base.dockerfile but inconvenient in a test environment
commands = env --unset=REQUESTS_CA_BUNDLE {envbindir}/py.test --log-cli-level INFO -s --ssh-identity-file=infrastructure_key --ansible-inventory={envdir}/.pytest_cache/d/dotenough/enough-nginx.test/inventory {posargs:playbooks/enough-nginx/tests}
[testenv:docs]
deps =
-r{toxinidir}/docs/requirements.txt
commands = sphinx-build -W -vvv -b html docs build/html
[flake8]
exclude = venv,.tox,dist,doc,*.egg,build,docs/conf.py,src,playbooks/debops*,playbooks/wazuh/wazuh-ansible,playbooks/wazuh/roles
show-source = true
max_line_length = 100