
Latest version changes the file name from playbook.yml to converage.yaml. Also the lint section isn't necessary because we run linters seperate. Change-Id: Id4fd60672576b640c0669bad6112f1259c983a05
106 lines
3.4 KiB
INI
106 lines
3.4 KiB
INI
[tox]
|
|
minversion = 2.0
|
|
envlist = docs, linters
|
|
skipdist = 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}
|
|
passenv = *
|
|
setenv =
|
|
VIRTUAL_ENV={envdir}
|
|
ANSIBLE_ACTION_PLUGINS={toxinidir}/plugins/action
|
|
ANSIBLE_CALLBACK_PLUGINS={toxinidir}/plugins/callback
|
|
ANSIBLE_FILTER_PLUGINS={toxinidir}/plugins/filter
|
|
ANSIBLE_LIBRARY={toxinidir}/plugins/modules
|
|
ANSIBLE_MODULE_UTILS={toxinidir}/plugins/module_utils
|
|
ANSIBLE_ROLES_PATH={toxinidir}/roles
|
|
ANSIBLE_INVENTORY={toxinidir}/tests/hosts.ini
|
|
ANSIBLE_NOCOWS=1
|
|
ANSIBLE_RETRY_FILES_ENABLED=0
|
|
ANSIBLE_STDOUT_CALLBACK=debug
|
|
ANSIBLE_LOG_PATH={envlogdir}/ansible-execution.log
|
|
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
|
|
sitepackages = True
|
|
deps =
|
|
-r {toxinidir}/test-requirements.txt
|
|
-r {toxinidir}/ansible-requirements.txt
|
|
commands = stestr run {posargs}
|
|
whitelist_externals =
|
|
bash
|
|
tox
|
|
|
|
[testenv:bindep]
|
|
# 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:linters]
|
|
description =
|
|
Runs all linters, if you want to run a single one, use posargs to mention
|
|
it. Example `tox -e linters -- ansible-lint`
|
|
deps =
|
|
pre-commit>=1.20 # MIT
|
|
commands =
|
|
python -m pre_commit run -a {posargs}
|
|
|
|
# Use 'linters' instead, kept only for compatibility with:
|
|
# https://opendev.org/openstack/openstack-zuul-jobs/src/branch/master/zuul.d/project-templates.yaml#L459
|
|
[testenv:pep8]
|
|
envdir = {toxworkdir}/linters
|
|
deps = {[testenv:linters]deps}
|
|
commands = {[testenv:linters]commands}
|
|
|
|
[testenv:releasenotes]
|
|
basepython = python3
|
|
deps = -r{toxinidir}/doc/requirements.txt
|
|
commands =
|
|
sphinx-build -a -E -W -d releasenotes/build/doctrees --keep-going -b html releasenotes/source releasenotes/build/html
|
|
|
|
[testenv:docs]
|
|
basepython = python3
|
|
deps =
|
|
-r {toxinidir}/doc/requirements.txt
|
|
commands=
|
|
doc8 doc
|
|
sphinx-build -a -E -W -d doc/build/doctrees --keep-going -b html doc/source doc/build/html -T
|
|
|
|
[testenv:venv]
|
|
commands = {posargs}
|
|
|
|
[testenv:build]
|
|
basepython = python3
|
|
deps = -r{toxinidir}/ansible-requirements.txt
|
|
commands =
|
|
ansible-galaxy collection build --force --output-path {toxinidir}/build/ .
|
|
|
|
[testenv:molecule]
|
|
setenv =
|
|
ANSIBLE_FORCE_COLOR=1
|
|
ANSIBLE_CALLBACK_WHITELIST=profile_tasks
|
|
ANSIBLE_SHOW_CUSTOM_STATS=1
|
|
deps =
|
|
ansi2html # GPL (soft-dependency of pytest-html)
|
|
ansible>=2.9
|
|
docker>=4.0.1
|
|
mock
|
|
molecule>=3.0a6
|
|
paramiko>=2.5.0 # LGPL (soft-dependency of docker that enables ssh protocol)
|
|
pytest-cov # MIT
|
|
pytest-html # MPL 2.0
|
|
pytest-molecule>=1.2.4 # MIT
|
|
pytest-xdist
|
|
selinux>=0.2.1 # MIT
|
|
oslotest
|
|
commands =
|
|
python -m pytest -ra --continue-on-collection-errors -v --color=yes --html={envlogdir}/reports.html --self-contained-html {tty:-s} -k {posargs}
|
|
|
|
# do not put tool config in tox.ini, use setup.cfg or tool specific files
|