Files
tripleo-ci/tox.ini
Sorin Sbarnea b5777f8519 Adds tripleo-repos molecule test job
Adds local method for testing the validity of the modified roles via
molecule on supported platforms.

This change is adding a pytest that calls molecule to validate
tripleo-repos role on supported platforms.

On CI this change uses a local docker installation but if the developer
wants, (s)he can just define a DOCKER_HOST=ssh://user@server variable
to enable remote execution of the containers (tested).

Change-Id: I2acecc16064b3f155de3e82368c64b060304a5e2
Story: https://tree.taiga.io/project/tripleo-ci-board/us/805
Depends-On: https://review.opendev.org/#/c/663599/
2019-06-11 14:32:34 +01:00

66 lines
1.8 KiB
INI

[tox]
# keep py3 before py2 to assure they are preffered for envs like linters:
envlist = linters,py{37,36,35,27},mol
minversion = 3.4.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
passenv =
ANSIBLE_*
DOCKER_*
MOLECULE_*
SSH_AUTH_SOCK
TERM
deps = -r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt
whitelist_externals =
bash
commands_pre =
pip install -q bindep
bindep test
commands =
python -m pytest --html={envlogdir}/reports.html --self-contained-html {posargs:--cov=emit_releases_file} scripts
[testenv:venv]
commands = {posargs}
[testenv:linters]
commands =
python -m pre_commit run -a
# deprecated: use linters instead. kept only as a convenience alias
[testenv:pep8]
envdir = {toxworkdir}/linters
whitelist_externals = {[testenv]whitelist_externals}
commands = {[testenv:linters]commands}
[testenv:cireport]
commands = python scripts/tripleo-jobs-gerrit.py {posargs}
[testenv:molecule]
deps =
ansi2html # GPL (soft-dependency of pytest-html)
docker>=3.7 # Apache
molecule>=2.22rc1 # MIT
paramiko>=2.5.0 # LGPL (soft-dependency of docker that enables ssh protocol)
pytest # MIT
pytest-cov # MIT
pytest-html # MPL 2.0
pytest-xdist # MIT
commands =
python -m pytest -ra --html={envlogdir}/reports.html --self-contained-html {tty:-s} {posargs} tests