openstack-ansible/tox.ini
Jean-Philippe Evrard 933dabb4a6 Be clear about python3: Remove its support
We have never really tested python3 at large scale, and more and
more bugs are filed in stable branches due to dual stack.

We should stick to python2 in the stable branches, which is
what was tested in our gates.

- Python3 inventory testing isn't exercised anywhere and should
  therefore be removed, because of its setting false expectations.
- The bootstrap removed all references to python3, to ensure
  python2 is always used.

Change-Id: I5d98b90709d668f2042bd59238c924101c1d116b
2018-05-02 15:46:21 +00:00

152 lines
3.9 KiB
INI

[tox]
minversion = 2.0
skipsdist = True
envlist = linters,docs,releasenotes,inventory,py3-inventory
[testenv]
usedevelop = True
basepython = python2.7
install_command =
pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/queens} {opts} {packages}
deps =
-r{toxinidir}/global-requirement-pins.txt
-r{toxinidir}/test-requirements.txt
passenv =
HOME
http_proxy
HTTP_PROXY
https_proxy
HTTPS_PROXY
no_proxy
NO_PROXY
whitelist_externals =
bash
setenv =
PYTHONUNBUFFERED=1
PYTHONWARNINGS=default::DeprecationWarning
VIRTUAL_ENV={envdir}
WORKING_DIR={toxinidir}
ANSIBLE_EXTRA_ROLE_DIRS={toxinidir}/playbooks/roles:{homedir}/.ansible/roles/ceph-ansible/roles
ANSIBLE_ROLE_REQUIREMENTS_PATH={toxinidir}/ansible-role-requirements.yml
TEST_PLAYBOOK={toxinidir}/tests/bootstrap-aio.yml {toxinidir}/playbooks/setup-everything.yml
ANSIBLE_LINT_PARAMS=--exclude={homedir}/.ansible/roles
[testenv:docs]
commands=
bash -c "rm -rf doc/build"
doc8 doc
python setup.py build_sphinx
[testenv:deploy-guide]
commands = sphinx-build -a -E -W -d deploy-guide/build/doctrees -b html deploy-guide/source deploy-guide/build/html
[doc8]
# Settings for doc8:
extensions = .rst
[testenv:releasenotes]
commands =
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
# environment used by the -infra templated docs job
[testenv:venv]
commands =
{posargs}
[testenv:pep8]
commands =
bash -c "{toxinidir}/tests/tests-repo-clone.sh"
bash -c "{toxinidir}/tests/common/test-pep8.sh"
[flake8]
# Ignores the following rules due to how ansible modules work in general
# F403 'from ansible.module_utils.basic import *' used;
# unable to detect undefined names
ignore=F403
[testenv:bashate]
commands =
bash -c "{toxinidir}/tests/tests-repo-clone.sh"
bash -c "{toxinidir}/tests/common/test-bashate.sh"
# The deps URL should be set to the appropriate git URL.
# In the tests repo itself, the variable is uniquely set to
# the toxinidir so that the role is able to test itself, but
# the tox config is exactly the same as other repositories.
#
# The value for other repositories must be:
# http://git.openstack.org/cgit/openstack/openstack-ansible-tests/plain/test-ansible-deps.txt
# or for a stable branch:
# http://git.openstack.org/cgit/openstack/openstack-ansible-tests/plain/test-ansible-deps.txt?h=stable/newton
[testenv:ansible]
deps =
{[testenv]deps}
-r{toxinidir}/global-requirement-pins.txt
-rhttps://git.openstack.org/cgit/openstack/openstack-ansible-tests/plain/test-ansible-deps.txt?h=stable/queens
[testenv:ansible-syntax]
deps =
{[testenv:ansible]deps}
commands =
bash -c "{toxinidir}/tests/tests-repo-clone.sh"
bash -c "{toxinidir}/tests/common/test-ansible-syntax.sh"
[testenv:ansible-lint]
deps =
{[testenv:ansible]deps}
commands =
bash -c "{toxinidir}/tests/tests-repo-clone.sh"
bash -c "{toxinidir}/tests/common/test-ansible-lint.sh"
[testenv:inventory]
# Use a fixed seed since some inventory tests rely on specific ordering
setenv =
{[testenv]setenv}
PYTHONHASHSEED = 100
commands =
coverage erase
coverage run -a {toxinidir}/tests/test_inventory.py
coverage run -a {toxinidir}/tests/test_manage.py
coverage run -a {toxinidir}/tests/test_dictutils.py
coverage run -a {toxinidir}/tests/test_ip.py
coverage run -a {toxinidir}/tests/test_filesystem.py
coverage report --show-missing --include={toxinidir}/inventory/*,{toxinidir}/osa_toolkit/*
[testenv:linters]
deps =
{[testenv:ansible]deps}
commands =
{[testenv:pep8]commands}
{[testenv:bashate]commands}
{[testenv:ansible-lint]commands}
{[testenv:ansible-syntax]commands}
{[testenv:inventory]commands}
{[testenv:docs]commands}