system-config/tox.ini
Clark Boylan 9f78af3776 Run tox-linters on Noble
This uses a modern Hacking which is necessary to get a newer flake8
which can run on python3.12. We remove the nodeset pin at the same time
to ensure we get good test results. These tests will almost certainly
fail with all of the new rules are violating. Subsequent patchsets will
correct those.

Change-Id: Ifda62f61bdac870e7d9c0baa2f6a930d770ed101
2024-08-21 16:41:37 -07:00

61 lines
1.7 KiB
INI

[tox]
minversion = 1.6
envlist = linters
skipsdist = True
[testenv]
basepython = python3
usedevelop = True
install_command = pip install {opts} {packages}
[testenv:linters]
deps =
hacking>=7.0.0,<8.0.0 # Apache-2.0
bashate>=0.2 # Apache-2.0
PyYAML>=3.10.0 # MIT
ansible
openstacksdk
testtools
mock
allowlist_externals =
bash
{toxinidir}/tools/run-bashate.sh
setenv =
ANSIBLE_LIBRARY= {toxinidir}/tools/fake-ansible/library
commands =
flake8
{toxinidir}/tools/run-bashate.sh
python3 {toxinidir}/tools/sorted_modules_env.py {toxinidir}/modules.env
python3 {toxinidir}/tools/irc_checks.py
python3 {toxinidir}/tools/check_clouds_yaml.py
# The following command validates that inventory/base/hosts.yaml
# parses, but doesn't do anything.
bash -c "ANSIBLE_INVENTORY_PLUGINS=./playbooks/roles/install-ansible/files/inventory_plugins ansible -i ./inventory/base/hosts.yaml not_a_host -a 'true'"
python3 -m unittest playbooks/roles/install-ansible/files/inventory_plugins/test_yamlgroup.py
[testenv:docs]
deps = -r{toxinidir}/doc/requirements.txt
commands = sphinx-build -W -E -b html doc/source doc/build/html
[testenv:testinfra]
deps =
pytest-html # MPL-2.0
pytest-testinfra[ansible]>=6.0.0
selenium
requests
# This environment assumes a gate-hosts.yaml file has been written.
passenv =
TESTINFRA_EXTRA_DATA
commands = py.test \
--junit-xml junit.xml -o junit_family=xunit1 \
--html=test-results.html --self-contained-html \
--connection=ansible \
--ansible-inventory=/home/zuul/src/opendev.org/opendev/system-config/inventory/base/gate-hosts.yaml -v testinfra {posargs}
[flake8]
show-source = True
exclude = .tox,.eggs
ignore = E125,H
select = H231