tripleo-ci/tox.ini
Douglas Viroel 941bbcdfff Fixes for ansible-lint in tox linter job
This patch updated ansible-lint version on pre-commit configuration
file and updates tox.ini to install ansible and collections needed for
ansible-lint validation.

Closes-Bug: #2019875

Change-Id: Ib68f5b26ea5672d294709a8a1d7e725133be0203
2023-05-16 14:46:18 -03:00

64 lines
1.8 KiB
INI

[tox]
# keep py3 before py2 to assure they are preffered for envs like linters:
envlist = linters,py,molecule
minversion = 3.18.0
ignore_basepython_conflict = True
skip_missing_interpreters = True
[testenv]
usedevelop = True
setenv =
ANSIBLE_FORCE_COLOR=1
ANSIBLE_INVENTORY={toxinidir}/test/hosts.ini
ANSIBLE_NOCOWS=1
ANSIBLE_RETRY_FILES_ENABLED=0
ANSIBLE_STDOUT_CALLBACK=debug
PY_COLORS=1
VIRTUAL_ENV={envdir}
# Avoid 2020-01-01 warnings: https://github.com/pypa/pip/issues/6207
PYTHONWARNINGS=ignore:DEPRECATION::pip._internal.cli.base_command
PIP_DISABLE_PIP_VERSION_CHECK=1
TEST_PARAMS=--cov=emit_releases_file -k "not molecule"
molecule: TEST_PARAMS=-ra -k molecule --ignore=roles/build-containers/files
passenv =
ANSIBLE_*
CURL_CA_BUNDLE
DOCKER_*
MOLECULE_*
PIP_CONSTRAINT={env:PIP_CONSTRAINT:constraints.txt}
REQUESTS_CA_BUNDLE
SSH_AUTH_SOCK
SSL_CERT_FILE
TERM
deps = -r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt
allowlist_externals =
bash
commands_pre =
pip install -q bindep
bindep test
commands =
python -m pytest --html={envlogdir}/reports.html --self-contained-html {tty:-s} {env:TEST_PARAMS} {posargs}
[testenv:deps]
description = Bump all test dependencies
basepython = python3
deps =
pre-commit>=2.6.0
pip-tools>=5.4.0
setuptools>=51.1.1
skip_install = true
commands =
pip-compile --upgrade --output-file=constraints.txt --pip-args "-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}" setup.py test-requirements.txt requirements.txt
[testenv:venv]
commands = {posargs}
[testenv:linters]
deps =
pre-commit>=1.20.0
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt
commands =
python -m pre_commit run -a