98 lines
2.7 KiB
INI
98 lines
2.7 KiB
INI
[tox]
|
|
envlist = docs, linters, molecule
|
|
minversion = 3.4.0
|
|
ignore_basepython_conflict = True
|
|
skip_missing_interpreters = True
|
|
skipsdist = True
|
|
|
|
[testenv]
|
|
usedevelop = True
|
|
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt} {opts} {packages}
|
|
setenv =
|
|
ANSIBLE_FORCE_COLOR={env:ANSIBLE_FORCE_COLOR:1}
|
|
ANSIBLE_INVENTORY={toxinidir}/tests/hosts.ini
|
|
ANSIBLE_NOCOWS=1
|
|
ANSIBLE_RETRY_FILES_ENABLED=0
|
|
ANSIBLE_STDOUT_CALLBACK={env:ANSIBLE_STDOUT_CALLBACK:debug}
|
|
ANSIBLE_VERBOSITY={env:ANSIBLE_VERBOSITY:1}
|
|
PY_COLORS={env:PY_COLORS:1}
|
|
VIRTUAL_ENV={envdir}
|
|
# pip: Avoid 2020-01-01 warnings: https://github.com/pypa/pip/issues/6207
|
|
# paramiko CryptographyDeprecationWarning: https://github.com/ansible/ansible/issues/52598
|
|
PYTHONWARNINGS=ignore:DEPRECATION::pip._internal.cli.base_command,ignore::UserWarning
|
|
PIP_DISABLE_PIP_VERSION_CHECK=1
|
|
passenv =
|
|
ANSIBLE_*
|
|
DOCKER_*
|
|
MOLECULE_*
|
|
SSH_AUTH_SOCK
|
|
TERM
|
|
deps = -r{toxinidir}/test-requirements.txt
|
|
whitelist_externals =
|
|
bash
|
|
echo
|
|
|
|
[testenv:bindep]
|
|
basepython = python3
|
|
# Do not install any requirements. We want this to be fast and work even if
|
|
# system dependencies are missing, since it's used to tell you what system
|
|
# dependencies are missing! This also means that bindep must be installed
|
|
# separately, outside of the requirements files.
|
|
deps = bindep
|
|
commands = bindep test
|
|
|
|
[testenv:docs]
|
|
basepython = python3
|
|
commands = python setup.py build_sphinx
|
|
|
|
[testenv:bashate]
|
|
envdir = {toxworkdir}/linters
|
|
commands =
|
|
python -m pre_commit run bashate -a
|
|
|
|
[testenv:molecule]
|
|
# basepython forces tox to use system python and avoid other python versions like pyenv ones
|
|
# because those are unlikely to have the required libselinux library available.
|
|
basepython=python
|
|
deps =
|
|
ansi2html
|
|
docker>=4.0.1
|
|
paramiko>=2.5.0
|
|
pytest
|
|
pytest-cov
|
|
pytest-html
|
|
pytest-xdist
|
|
mock
|
|
molecule>=2.22rc1
|
|
selinux>=0.1.5rc1
|
|
commands =
|
|
python -m pytest --color=yes --html={envlogdir}/reports.html --self-contained-html {tty:-s} {posargs:tests}
|
|
|
|
[testenv:pep8]
|
|
envdir = {toxworkdir}/linters
|
|
commands =
|
|
python -m pre_commit run flake8 -a
|
|
|
|
[testenv:ansible-lint]
|
|
setenv =
|
|
ANSIBLE_LIBRARY=./library
|
|
envdir = {toxworkdir}/linters
|
|
commands =
|
|
python -m pre_commit run ansible-lint -a
|
|
|
|
[testenv:linters]
|
|
basepython = python3
|
|
commands =
|
|
# check only modified files:
|
|
python -m pre_commit run -a
|
|
|
|
[testenv:releasenotes]
|
|
basepython = python3
|
|
whitelist_externals = bash
|
|
commands = bash -c ci-scripts/releasenotes_tox.sh
|
|
|
|
[testenv:venv]
|
|
changedir = {toxinidir}
|
|
commands =
|
|
{posargs:echo done}
|