This patch adds basic configuration for tox-ansible[1].
Tox-ansible is a plugin for tox which auto-generates tox environments
for running quality assurance tools like ansible-test or molecule. This
tool is rather tightly integrated for the official Molecule testing tool
that integrates with Ansible.
At first, it will allow us to list very quickly all the Ansible Molecule
tests for each roles with their scenario(s):
Example:
$ tox -l
...
roles-ceph-ceph-ansible-installed
roles-ceph-default
roles-check_kernel_version-default
roles-check_network_gateway-default
roles-check_rhsm_version-default
roles-check_rhsm_version-rhsm_mismatch
roles-check_undercloud_conf-config_OK
roles-check_undercloud_conf-default
roles-check_undercloud_conf-deprecated_drivers
roles-check_undercloud_conf-deprecated_params
roles-check_undercloud_conf-required_missing
...
However, we won't be able to execute them as it for now without to make
some small manual modifications in the molecule.yml file first before to
execute them. This will be covered as soon as possible in a following-patch.
[1] - https://github.com/ansible-community/tox-ansible
Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
Change-Id: Ia1606db814f37a11e48508139b90cdd43c083f6b
(cherry picked from commit edb1ad9210)
(cherry picked from commit 07c1e0f9b8)
- dogpile.cache workaround
Bug: https://github.com/sqlalchemy/dogpile.cache/issues/178
Bug: https://bugs.launchpad.net/tripleo/+bug/1876073
- The lower-constraints.txt file has been removed because it is not
useful for TripleO anymore. The .zuul.yaml doesn't exists in ussuri
the modification was reported in zuul.d/layout.yaml file.
Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
Change-Id: I00e2e252700d0229113cc6ee1c4efff0504fb005
(cherry picked from commit b8bb9a5f2c)
(cherry picked from commit 3977997c35)
Update the URL to the upper-constraints file to point to the redirect
rule on releases.openstack.org so that anyone working on this branch
will switch to the correct upper-constraints list automatically when
the requirements repository branches.
Until the requirements repository has as stable/ussuri branch, tests will
continue to use the upper-constraints list on master.
Change-Id: I46fcb0147b89c838f1b229b05f222e2f3857fd46
This repo is now testing only with Python 3, so let's make
a few cleanups:
- Remove python 2.7 stanza from setup.py
- Add requires on python >= 3.6 to setup.cfg so that pypi and pip
know about the requirement
- Remove obsolete sections from setup.cfg
- Update classifiers
- Update requirements, no need for python_version anymore
- Use newer openstackdocstheme version
- Add basepython to tox.ini
Change-Id: I4b731354119ebc3a7519da420121404aa2fbb640
The groups.yaml file is now the source of information concerning the
validations groups. The groups information part is now created
dynamically by reading the groups.yaml file.
This patch also fixes the basepython conflict for the tox py37 testenv.
Change-Id: Id199fc250afa0646b1e851581e3a92290f7bcb00
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
This patch add a custom ansible-lint rule to enforce the structure of
the validations playbooks:
*ValidationHasMetadataRule*:
Throw an ansible-lint error if:
- the *hosts* key is empty or not found,
- *vars* dictionary is missing,
- *metadata* dict is missing in *vars*
- *name*/*description*/*groups* keys are missing or found with a wrong
data type
- the validation belongs to one or several groups NOT in the official list of
groups (groups.yaml)
*YAMLLINT*:
- Enable yamllint check in tox linters
- WIP Fix detected yamllint errors
Change-Id: If233286aa9f4299f02f13dc34f1e8c05d89df851
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
- Mistral has some newer lower requirements.
- Adds the upper contraints file in the 'deps' tox attribute.
- Removes 'VIRTUAL_ENV' environment variable, which is useless here.
Co-Authored-By: Alex Schultz <aschultz@redhat.com>
Co-Authored-By: Daniel Bengtsson <dbengt@redhat.com>
Co-Authored-By: Hervé Beraud <hberaud@redhat.com>
Change-Id: Ia0c67c5980a7e6bc9006a24be775ea6fb815d23c
Remove the useless environment variable to set the virtualenv directory.
It's the default value and the variable was duplicate.
Change-Id: I599fe28a0b9f48cdbf02fd87c95506a3176244e2
This change implements a native zuul runner for all role tests.
The change will now run role tests, executing molecule, in the
same was as tripleo-ansible.
To ensure we're passing lint checks, several files have been
updated to resolve lint issues which are now more strict due
to the pre-commit changes.
Scripts have been added to allow developers to run molecule tests
on local environments. These tools will allow developers to mimic
the upstream test process locally.
Change-Id: I07bbcc0b331aa89dafdae5978ea2bb4859a59143
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
- Adds bashate test using v0.6.0
- Bump pre-commit-hooks release to v2.2.4
- Bump ansible-lint release to v4.1.0a0
- Fix some minor flake8 errors
Change-Id: I66b796fab1d8651163226febbc4e99648a9ecc6a
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
Change-Id: I0551ab56324ede7f1d33e0e9a680c26ea164023c
Signed-off-by: Luke Short <ekultails@gmail.com>
Co-Authored-By: Sorin Sbarnea <ssbarnea@redhat.com>
* Kept old specific linter tox targets for backwards compatibility,
so developer can easily run a single linter if desired.
* Reused tox linters virtualenvs to avoid wasting space
* Moved linter config to their official location which enables
developer to call them in any way he wants (like his IDE)
* tools/validate-files.py has been updated to check out all the custom
library files coming from the new validation framework.
Change-Id: I4118200e6862763a0e9dac921dc7c42019224d12
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
We want to default to running all tox environments under python 3, so
set the basepython value in each environment.
We do not want to specify a minor version number, because we do not
want to have to update the file every time we upgrade python.
We do not want to set the override once in testenv, because that
breaks the more specific versions used in default environments like
py35 and py36.
Change-Id: I7e52b75964077e2cea75006496db29161c6fdeb6
Closes-Bug: #1801657
This is a mechanically generated patch to add a unit test job running
under Python 3.6 as part of the python3-first goal.
See the python3-first goal document for details:
https://governance.openstack.org/tc/goals/stein/python3-first.html
Change-Id: Ida46ff8b27693e64bec9bd21166738b8ba972d68
We want to default to running all tox environments under python 3, so
set the basepython value in each environment.
We do not want to specify a minor version number, because we do not
want to have to update the file every time we upgrade python.
We do not want to set the override once in testenv, because that
breaks the more specific versions used in default environments like
py35 and py36.
Change-Id: Ice90430a7421fd3bf5e7991d81fa0928393354c3
Create a tox environment for running the unit tests against the lower
bounds of the dependencies.
Create a lower-constraints.txt to be used to enforce the lower bounds
in those tests.
Add openstack-tox-lower-constraints job to the zuul configuration.
See http://lists.openstack.org/pipermail/openstack-dev/2018-March/128352.html
for more details.
Change-Id: I54f3f13093ce46778096ed0002fdc1e78e978e7c
Depends-On: https://review.openstack.org/555034
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This patch adds tools/ansible-lint.sh script to lint validations playbooks.
Moreover, it adds `changed_when: False` to commands that should not change
things if nothing needs doing [ANSIBLE0012].
Change-Id: I4fb432bfbd2b73740c29011d08a09058b6c45348
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
The ansible library files should all have a DOCUMENTATION and EXAMPLES variables.
This commit makes the CI fail in case the variables are missing from the
files in 'validations/library' subdirectory.
Change-Id: Ibd38d893ed1ff0e1032c2f97c0eb1e71d3897ea4
- modifies custom module ip_range.py in such a way that its individual
stages can be easily tested
- tests for this module (test_ip_range.py) are created
Change-Id: Id1ee5db19c673da318ec21d98bdd02c766a219f5
Partial-Bug: #1594785