2017-03-01 13:32:34 +00:00
|
|
|
[tox]
|
2020-02-29 15:13:58 -06:00
|
|
|
minversion = 3.1
|
2019-11-22 02:23:19 +00:00
|
|
|
envlist = py3,pep8
|
2020-02-29 15:13:58 -06:00
|
|
|
ignore_basepython_conflict = True
|
2017-03-01 13:32:34 +00:00
|
|
|
|
|
|
|
[testenv]
|
2019-11-22 02:23:19 +00:00
|
|
|
basepython = python3
|
2017-03-01 13:32:34 +00:00
|
|
|
usedevelop = True
|
2017-11-17 09:57:28 +00:00
|
|
|
passenv =
|
|
|
|
HOME
|
2022-12-14 08:38:05 +01:00
|
|
|
allowlist_externals =
|
2017-11-17 09:57:28 +00:00
|
|
|
bash
|
2022-12-14 08:38:05 +01:00
|
|
|
make
|
|
|
|
python3
|
2018-05-02 11:31:11 +01:00
|
|
|
rm
|
2017-03-29 14:02:51 +01:00
|
|
|
setenv =
|
|
|
|
VIRTUAL_ENV={envdir}
|
|
|
|
PYTHONWARNINGS=default::DeprecationWarning
|
2018-02-22 12:00:02 +00:00
|
|
|
OS_STDOUT_CAPTURE=1
|
|
|
|
OS_STDERR_CAPTURE=1
|
|
|
|
OS_TEST_TIMEOUT=60
|
2018-03-15 16:28:02 +00:00
|
|
|
deps =
|
2023-01-10 09:50:04 +00:00
|
|
|
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
2018-03-15 16:28:02 +00:00
|
|
|
-r{toxinidir}/requirements.txt
|
|
|
|
-r{toxinidir}/test-requirements.txt
|
2018-02-22 12:00:02 +00:00
|
|
|
commands = stestr run {posargs}
|
2017-03-01 13:32:34 +00:00
|
|
|
|
|
|
|
[testenv:pep8]
|
2019-10-21 11:10:13 +02:00
|
|
|
# sphinx8 needs the sphinx package which is required via doc/requirements.txt
|
|
|
|
deps =
|
2023-01-10 09:50:04 +00:00
|
|
|
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
2019-10-21 11:10:13 +02:00
|
|
|
-r{toxinidir}/requirements.txt
|
|
|
|
-r{toxinidir}/doc/requirements.txt
|
|
|
|
-r{toxinidir}/test-requirements.txt
|
2017-04-06 10:19:34 +01:00
|
|
|
commands =
|
2022-12-14 08:38:05 +01:00
|
|
|
bash {toxinidir}/tools/run-bashate.sh
|
2017-09-02 09:40:25 +01:00
|
|
|
flake8 {posargs} kayobe
|
2017-04-06 10:19:34 +01:00
|
|
|
# Check the *.rst files
|
2017-09-04 10:57:55 +01:00
|
|
|
# We use a thin wrapper around doc8 currently, which has support for sphinx
|
2018-02-21 13:40:19 +00:00
|
|
|
# directives.
|
2022-12-14 08:38:05 +01:00
|
|
|
python3 {toxinidir}/tools/sphinx8 README.rst CONTRIBUTING.rst doc/source --ignore D001
|
2019-02-14 12:12:17 +00:00
|
|
|
yamllint etc/kayobe
|
2017-03-01 13:32:34 +00:00
|
|
|
|
|
|
|
[testenv:venv]
|
2018-05-02 11:31:11 +01:00
|
|
|
deps =
|
2023-01-10 09:50:04 +00:00
|
|
|
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
2018-05-02 11:31:11 +01:00
|
|
|
-r{toxinidir}/test-requirements.txt
|
|
|
|
-r{toxinidir}/doc/requirements.txt
|
2017-03-01 13:32:34 +00:00
|
|
|
commands = {posargs}
|
|
|
|
|
2017-11-17 09:57:28 +00:00
|
|
|
[testenv:ansible]
|
|
|
|
# Create the virtualenv with access to system site packages, as this is
|
|
|
|
# required to use the python and apt modules, which are not available via PyPI.
|
|
|
|
sitepackages = True
|
|
|
|
commands =
|
2018-02-07 09:04:11 +00:00
|
|
|
# Install ansible role dependencies from Galaxy.
|
2022-12-14 08:38:05 +01:00
|
|
|
bash {toxinidir}/tools/ansible-galaxy-retried.sh install \
|
2018-02-07 09:04:11 +00:00
|
|
|
-r {toxinidir}/requirements.yml \
|
|
|
|
-p {toxinidir}/ansible/roles
|
2022-12-14 08:38:05 +01:00
|
|
|
bash {toxinidir}/tools/test-ansible.sh {posargs}
|
2017-11-17 09:57:28 +00:00
|
|
|
|
2018-02-08 11:56:11 +00:00
|
|
|
[testenv:molecule]
|
2018-04-18 19:05:08 +01:00
|
|
|
deps =
|
2023-01-10 09:50:04 +00:00
|
|
|
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
2020-09-23 18:34:23 +02:00
|
|
|
-r{toxinidir}/requirements.txt
|
2021-09-03 23:10:39 +02:00
|
|
|
-r{toxinidir}/molecule-requirements.txt
|
2018-02-08 11:56:11 +00:00
|
|
|
commands =
|
|
|
|
# Install ansible role dependencies from Galaxy.
|
2022-12-14 08:38:05 +01:00
|
|
|
bash {toxinidir}/tools/ansible-galaxy-retried.sh install \
|
2018-02-08 11:56:11 +00:00
|
|
|
-r {toxinidir}/requirements.yml \
|
|
|
|
-p {toxinidir}/ansible/roles
|
2018-11-12 10:58:34 +00:00
|
|
|
bash -c "source {envdir}/bin/activate && {toxinidir}/tools/test-molecule.sh {posargs}"
|
2018-02-08 11:56:11 +00:00
|
|
|
|
2017-09-05 10:03:27 +01:00
|
|
|
[testenv:alint]
|
2020-11-23 11:21:13 +01:00
|
|
|
commands = /bin/bash -c "ansible-lint {toxinidir}/ansible/*.yml"
|
2017-09-05 10:03:27 +01:00
|
|
|
|
2017-11-17 10:34:28 +00:00
|
|
|
[testenv:ansible-syntax]
|
|
|
|
commands =
|
|
|
|
# Install ansible role dependencies from Galaxy.
|
Stop using kolla-ansible bootstrap-servers
The 'kayobe * host configure' commands no longer use the 'kolla-ansible
bootstrap-servers' command, and associated 'baremetal' role in Kolla
Ansible. The functionality provided by the 'baremetal' role has been
extracted into the openstack.kolla Ansible collection, and split
into separate roles. This allows Kayobe to use it directly, and only the
necessary parts.
This change improves failure handling in these Kayobe commands, and aims
to reduce confusion over which '--limit' and '--tags' arguments to
provide. This ensures that if a host fails during a host configuration
command, other hosts are able to continue to completion. Previously, if
any host failed during the Kayobe playbooks, the 'kolla-ansible
bootstrap-servers' command would not run. This is useful at scale, where
host failures occur more frequently.
This change has implications for configuration of Kayobe, since some
variables that were previously in Kolla Ansible are now in Kayobe.
Several parts of the baremetal role have been split out and used here:
* apparmor-libvirt: disable AppArmor rules for libvirt on Ubuntu.
* docker: Docker installation & configuration. The docker role in
openstack.kolla combines functionality from kolla-ansible and kayobe.
* etc-hosts: it proved difficult to generalise this, so we have some
almost duplicated the code from kolla-ansible here. Requires delegated
fact gathering for the case when --limit is used.
* firewall: support to disable UFW, for feature parity.
* kolla-packages: miscellaneous package installs & removals.
The addition of the stack user to the docker group has been moved to the
user bootstrapping playbook, and the docker SDK installation has been
moved to the virtualenv setup playbook.
Depends-On: https://review.opendev.org/c/openstack/ansible-collection-kolla/+/829587
Story: 2009854
Task: 44505
Change-Id: I61a61ca59652b13687c2247d5881012b51f666a7
2021-11-09 15:50:45 +00:00
|
|
|
bash {toxinidir}/tools/ansible-galaxy-retried.sh role install \
|
2017-11-17 10:34:28 +00:00
|
|
|
-r {toxinidir}/requirements.yml \
|
|
|
|
-p {toxinidir}/ansible/roles
|
Stop using kolla-ansible bootstrap-servers
The 'kayobe * host configure' commands no longer use the 'kolla-ansible
bootstrap-servers' command, and associated 'baremetal' role in Kolla
Ansible. The functionality provided by the 'baremetal' role has been
extracted into the openstack.kolla Ansible collection, and split
into separate roles. This allows Kayobe to use it directly, and only the
necessary parts.
This change improves failure handling in these Kayobe commands, and aims
to reduce confusion over which '--limit' and '--tags' arguments to
provide. This ensures that if a host fails during a host configuration
command, other hosts are able to continue to completion. Previously, if
any host failed during the Kayobe playbooks, the 'kolla-ansible
bootstrap-servers' command would not run. This is useful at scale, where
host failures occur more frequently.
This change has implications for configuration of Kayobe, since some
variables that were previously in Kolla Ansible are now in Kayobe.
Several parts of the baremetal role have been split out and used here:
* apparmor-libvirt: disable AppArmor rules for libvirt on Ubuntu.
* docker: Docker installation & configuration. The docker role in
openstack.kolla combines functionality from kolla-ansible and kayobe.
* etc-hosts: it proved difficult to generalise this, so we have some
almost duplicated the code from kolla-ansible here. Requires delegated
fact gathering for the case when --limit is used.
* firewall: support to disable UFW, for feature parity.
* kolla-packages: miscellaneous package installs & removals.
The addition of the stack user to the docker group has been moved to the
user bootstrapping playbook, and the docker SDK installation has been
moved to the virtualenv setup playbook.
Depends-On: https://review.opendev.org/c/openstack/ansible-collection-kolla/+/829587
Story: 2009854
Task: 44505
Change-Id: I61a61ca59652b13687c2247d5881012b51f666a7
2021-11-09 15:50:45 +00:00
|
|
|
# Install ansible collection dependencies from Galaxy.
|
|
|
|
bash {toxinidir}/tools/ansible-galaxy-retried.sh collection install \
|
|
|
|
-r {toxinidir}/requirements.yml \
|
|
|
|
-p {toxinidir}/ansible/collections
|
2017-11-17 10:34:28 +00:00
|
|
|
# Perform an Ansible syntax check. Skip some playbooks which require extra
|
|
|
|
# variables to be defined.
|
|
|
|
bash -c \
|
|
|
|
"ansible-playbook \
|
|
|
|
--connection=local \
|
|
|
|
--syntax-check \
|
|
|
|
--list-tasks \
|
|
|
|
$(find {toxinidir}/ansible \
|
|
|
|
-maxdepth 1 \
|
|
|
|
-name '*.yml' \
|
|
|
|
-not -name idrac-bootstrap-one.yml \
|
|
|
|
-not -name idrac-bootstrap.yml) \
|
|
|
|
{posargs}"
|
|
|
|
|
2018-02-22 12:00:02 +00:00
|
|
|
[testenv:cover]
|
|
|
|
setenv =
|
|
|
|
VIRTUAL_ENV={envdir}
|
|
|
|
PYTHON=coverage run --source kayobe --parallel-mode
|
|
|
|
commands =
|
|
|
|
coverage erase
|
|
|
|
stestr run {posargs}
|
|
|
|
coverage combine
|
|
|
|
coverage report
|
|
|
|
coverage html -d cover
|
|
|
|
coverage xml -o cover/coverage.xml
|
|
|
|
|
2018-02-22 13:52:08 +00:00
|
|
|
[testenv:docs]
|
2018-03-15 16:28:02 +00:00
|
|
|
deps =
|
2023-01-10 09:50:04 +00:00
|
|
|
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
2018-03-15 16:28:02 +00:00
|
|
|
-r{toxinidir}/doc/requirements.txt
|
2019-10-27 14:39:09 +08:00
|
|
|
commands =
|
|
|
|
rm -rf doc/build/html
|
|
|
|
sphinx-build -W --keep-going -b html doc/source doc/build/html
|
2020-08-27 20:18:41 +01:00
|
|
|
whereto doc/source/_extra/.htaccess doc/test/redirect-tests.txt
|
2018-02-22 13:52:08 +00:00
|
|
|
|
2019-09-17 12:07:33 +01:00
|
|
|
[testenv:pdf-docs]
|
|
|
|
deps = {[testenv:docs]deps}
|
|
|
|
commands =
|
2019-10-27 14:39:09 +08:00
|
|
|
rm -rf doc/build/pdf
|
|
|
|
sphinx-build -W --keep-going -b latex doc/source doc/build/pdf
|
2019-09-17 12:07:33 +01:00
|
|
|
make -C doc/build/pdf
|
|
|
|
|
2018-02-22 13:52:08 +00:00
|
|
|
[testenv:debug]
|
|
|
|
commands = oslo_debug_helper {posargs}
|
|
|
|
|
2018-05-02 11:31:11 +01:00
|
|
|
[testenv:releasenotes]
|
2020-09-18 20:49:09 +08:00
|
|
|
deps = {[testenv:docs]deps}
|
2018-05-02 11:31:11 +01:00
|
|
|
commands =
|
|
|
|
rm -rf releasenotes/build
|
2019-10-27 14:39:09 +08:00
|
|
|
sphinx-build -a -E -W -d releasenotes/build/doctrees --keep-going -b html releasenotes/source releasenotes/build/html
|
2018-05-02 11:31:11 +01:00
|
|
|
|
2017-03-01 13:32:34 +00:00
|
|
|
[flake8]
|
2017-03-29 14:02:51 +01:00
|
|
|
# E123, E125 skipped as they are invalid PEP-8.
|
2021-04-26 11:43:41 +01:00
|
|
|
# W504 line break after binary operator
|
2017-03-29 14:02:51 +01:00
|
|
|
|
|
|
|
show-source = True
|
2021-04-26 11:43:41 +01:00
|
|
|
ignore = E123,E125,W504
|
2017-03-29 14:02:51 +01:00
|
|
|
builtins = _
|
|
|
|
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
|