tripleo-ansible/tox.ini
Michele Baldessari 8e2a54d5d5 Fix role-addition CI
By artificially setting the upper constraint file we ignore
global-requirements which then creates errors like the following:

role-addition run-test: commands[2] | pip check
setting PATH=/home/zuul/src/opendev.org/openstack/tripleo-ansible/.tox/role-addition/bin:/home/zuul/.local/bin:/home/zuul/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin
[43268] /home/zuul/src/opendev.org/openstack/tripleo-ansible$ /home/zuul/src/opendev.org/openstack/tripleo-ansible/.tox/role-addition/bin/pip check
openstacksdk 0.48.0 has requirement decorator>=4.4.1, but you have decorator 4.2.1.
ERROR: InvocationError for command /home/zuul/src/opendev.org/openstack/tripleo-ansible/.tox/role-addition/bin/pip check (exited with code 1)

A job test that was failing previously with the above error, now passed
correctly:
- Before: https://zuul.opendev.org/t/openstack/build/8ad3a5951133418e8be132db218a4480
- After: https://zuul.opendev.org/t/openstack/build/01d33b85362d430cb30b619803814677

Closes-Bug: #1893734

Change-Id: I0e5f4692efe387d97f940b5323e593a94b6f833a
2020-09-01 12:21:05 +02:00

119 lines
4.2 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>=2.7.1
virtualenv>=20.0.31
-r {toxinidir}/ansible-requirements.txt
commands =
pip check
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
[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]
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}