tripleo-ansible/tox.ini
Kevin Carter 74f2f81870 Convert docker molecule usage to podman
This change updates all uses of docker to podman and removes our docker
installation process from zuul and our local test process. Some container
based tests have been moved to "delegated" becuase they no longer make
sense to run in a container and the hacks needed to maintain the container
based testing are not worth maintaining for podman.

Change-Id: I02de94a1229bfa847f14ecf282eadbcfe6396875
Signed-off-by: Kevin Carter <kecarter@redhat.com>
2020-04-30 09:55:18 -05:00

121 lines
4.3 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} -c{toxinidir}/constraints.txt {opts} {packages}
passenv = *
setenv =
VIRTUAL_ENV={envdir}
ANSIBLE_ACTION_PLUGINS={toxinidir}/tripleo_ansible/roles.galaxy/config_template/action:{toxinidir}/tripleo_ansible/ansible_plugins/action
ANSIBLE_CALLBACK_PLUGINS={toxinidir}/tripleo_ansible/ansible_plugins/callback
ANSIBLE_FILTER_PLUGINS={toxinidir}/tripleo_ansible/ansible_plugins/filter
ANSIBLE_LIBRARY={toxinidir}/tripleo_ansible/roles.galaxy/config_template/library:{toxinidir}/tripleo_ansible/ansible_plugins/modules
ANSIBLE_MODULE_UTILS={toxinidir}/tripleo_ansible/ansible_plugins/module_utils
ANSIBLE_ROLES_PATH={toxinidir}/tripleo_ansible/roles.galaxy:{toxinidir}/tripleo_ansible/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
true
[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]
skipsdist = True
skip_install = True
sitepackages = False
setenv =
UPPER_CONSTRAINTS_FILE=file:///dev/null
deps =
pre-commit
virtualenv<20 # known to break things
-r {toxinidir}/ansible-requirements.txt
commands =
bash -c "ANSIBLE_ROLES_PATH='{toxinidir}/tripleo_ansible/roles.galaxy' \
ansible-galaxy install -fr {toxinidir}/tripleo_ansible/ansible-role-requirements.yml"
python -m pre_commit run -a
bash -c '{toxinidir}/scripts/detect-broken-symlinks.sh'
[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=
# NOTE(cloudnull): This will ensure we always have the latest version of
# tripleo-common installed, which is required for documentation
# to build when running with in development modules which use
# tripleo-common as a library.
pip install tripleo-common -c{toxinidir}/constraints.txt --force --upgrade
doc8 doc
sphinx-build -a -E -W -d doc/build/doctrees --keep-going -b html doc/source doc/build/html -T
[doc8]
# Settings for doc8:
extensions = .rst
ignore = D001
[testenv:venv]
commands = {posargs}
[testenv:pep8]
description = "[deprecated], use linters instead."
deps =
commands = true
skipsdist = True
skip_install = True
sitepackages = False
[testenv:role-addition]
setenv =
UPPER_CONSTRAINTS_FILE=file:///dev/null
basepython = python3
deps =
{[testenv:linters]deps}
-r {toxinidir}/molecule-requirements.txt
commands =
bash -c "ansible-playbook -i localhost, role-addition.yml -e role_name=skeleton_test"
bash -c "if podman ps 2> /dev/null; then \
cd {toxinidir}/tripleo_ansible/roles/skeleton_test; \
molecule test --all; \
else \
echo -e '\n\nNo molecule tests have been executed\nSee https://docs.openstack.org/tripleo-ansible/latest/contributing.html#local-testing-of-new-roles\n\n'; \
fi"
{[testenv:linters]commands}
[testenv:modules]
deps=
{[testenv:linters]deps}
commands =
bash -c "cd {toxinidir}/tripleo_ansible/ansible_plugins/tests; molecule test --all;"
{[testenv:linters]commands}