ba5e10832e
* Add missing Ansible & Yamllint configuration files * Fix requirements issues * Add tools/validate-files.py Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
124 lines
3.7 KiB
INI
124 lines
3.7 KiB
INI
[tox]
|
|
minversion = 2.0
|
|
envlist = linters,docs,py37,molecule
|
|
skipdist = True
|
|
|
|
[testenv]
|
|
usedevelop = True
|
|
passenv = *
|
|
setenv =
|
|
ANSIBLE_CALLBACK_PLUGINS={toxinidir}/validations_common/callback_plugins
|
|
ANSIBLE_LOOKUP_PLUGINS={toxinidir}/validations_common/lookup_plugins
|
|
ANSIBLE_LIBRARY={toxinidir}/validations_common/library
|
|
ANSIBLE_ROLES_PATH={toxinidir}/validations_common/roles
|
|
ANSIBLE_NOCOWS=1
|
|
ANSIBLE_RETRY_FILES_ENABLED=0
|
|
ANSIBLE_STDOUT_CALLBACK=debug
|
|
ANSIBLE_LOG_PATH={envlogdir}/ansible-execution.log
|
|
# 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
|
|
commands = python setup.py test --slowest --testr-args='{posargs}'
|
|
sitepackages = True
|
|
deps =
|
|
-c {env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt}
|
|
-r {toxinidir}/requirements.txt
|
|
-r {toxinidir}/test-requirements.txt
|
|
-r {toxinidir}/molecule-requirements.txt
|
|
whitelist_externals = bash
|
|
|
|
[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:debug]
|
|
commands = oslo_debug_helper {posargs}
|
|
|
|
[testenv:pep8]
|
|
envdir = {toxworkdir}/linters
|
|
commands =
|
|
python -m pre_commit run flake8 -a
|
|
|
|
[testenv:ansible-lint]
|
|
envdir = {toxworkdir}/linters
|
|
deps =
|
|
{[testenv:linters]deps}
|
|
commands =
|
|
bash -c "ANSIBLE_ROLES_PATH='{toxinidir}/validations_common/roles'"
|
|
bash -c "ANSIBLE_LIBRARY='{toxinidir}/validations_common/library'"
|
|
python -m pre_commit run ansible-lint -a
|
|
|
|
[testenv:yamllint]
|
|
envdir = {toxworkdir}/linters
|
|
deps = {[testenv:linters]deps}
|
|
commands =
|
|
python -m pre_commit run yamllint -a
|
|
|
|
[testenv:bashate]
|
|
envdir = {toxworkdir}/linters
|
|
deps = {[testenv:linters]deps}
|
|
commands =
|
|
python -m pre_commit run bashate -a
|
|
|
|
[testenv:whitespace]
|
|
envdir = {toxworkdir}/linters
|
|
deps = {[testenv:linters]deps}
|
|
commands =
|
|
python -m pre_commit run trailing-whitespace -a
|
|
|
|
[testenv:shebangs]
|
|
envdir = {toxworkdir}/linters
|
|
deps = {[testenv:linters]deps}
|
|
commands =
|
|
python -m pre_commit run check-executables-have-shebangs -a
|
|
|
|
[testenv:linters]
|
|
deps =
|
|
-r {toxinidir}/requirements.txt
|
|
-r {toxinidir}/test-requirements.txt
|
|
-r {toxinidir}/molecule-requirements.txt
|
|
commands =
|
|
python '{toxinidir}/tools/validate-files.py' .
|
|
{[testenv:ansible-lint]commands}
|
|
{[testenv:yamllint]commands}
|
|
{[testenv:bashate]commands}
|
|
{[testenv:whitespace]commands}
|
|
{[testenv:shebangs]commands}
|
|
|
|
[testenv:releasenotes]
|
|
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:cover]
|
|
deps =
|
|
-r {toxinidir}/requirements.txt
|
|
-r {toxinidir}/test-requirements.txt
|
|
-r {toxinidir}/molecule-requirements.txt
|
|
commands = python setup.py test --coverage --testr-args='{posargs}'
|
|
|
|
[testenv:docs]
|
|
deps =
|
|
-r {toxinidir}/doc/requirements.txt
|
|
-r {toxinidir}/molecule-requirements.txt
|
|
commands=
|
|
sphinx-build -a -E -W -d doc/build/doctrees --keep-going -b html doc/source doc/build/html -T
|
|
doc8 doc
|
|
|
|
[doc8]
|
|
# Settings for doc8:
|
|
extensions = .rst
|
|
ignore = D001
|
|
|
|
[testenv:lower-constraints]
|
|
deps =
|
|
-c{toxinidir}/lower-constraints.txt
|
|
-r{toxinidir}/test-requirements.txt
|
|
-r{toxinidir}/requirements.txt
|
|
-r{toxinidir}/molecule-requirements.txt
|