It seems that we have dropped unit testing of our dynamic_inventory
some time ago. This patch aims to setup zuul tests using tox
and restore test functionality to make it passing with current codebase
Change-Id: I8ccee779fd629e8696ec2e12397b148b52cd0c73
This will bring in a version of pip using the new requirements
resolver
Depends-On: Ib4c3592184973ba9908a1ba17d935a96448969a1
Depends-On: Idbd71ade1ab82d2d218e560b2f10c38116ff47e3
Depends-On: I9be6bbf4a29a4da2ddf96dc0336bc2a7d8ec9281
Depends-On: I599f9de82a6350599444096e98a0e25a417e18ef
Depends-On: I2c4009fbdf524f2d54adf1d4a730604c123f72fd
Depends-On: Ib17a2712993c6c7e3b5622fc944d7754dbb872ba
Depends-On: Ie2c30984b9ad7fc2cc55900f49b2300e2bdaa1e3
Depends-On: I00b42c61d03c83bfbfec69ad3bd47d940bb449d2
Depends-On: If53aca6f16324d305b150466b94d3f18c8a1096a
Depends-On: Ibab50a351d5e14bfc993884036c27cc3f2eee424
Depends-On: I41fc05409433b4e22307ad604c15d30bcea32abd
Depends-On: I49c75dd11d6c4e8d37fe013b7ffdfd56ff193fcd
Change-Id: I387eeeea7bb7a122b275219ac6ca858824b137e2
The mock third party library was needed for mock support in py2
runtimes. Since we now only support py36 and later, we can use the
standard lib unittest.mock module instead
Change-Id: Ie36f12a4a6dd3c06b9ffd9bfb7bbb0106311820f
Correct lint errors that arise from these version updates.
This also fixes ceph deployment after backporting breaking changes
to stable-5.0 branch.
Change-Id: Iaa6bd137ebc4bf6cc2071712eb3f53a08c85d75e
flake8 new release 3.8.0 added new checks and gate pep8
job start failing. hacking 3.0.1 fix the pinning of flake8 to
avoid bringing in a new version with new checks.
Though it is fixed in latest hacking but 2.0 and 3.0 has cap for
flake8 as <4.0.0 which mean flake8 new version 3.9.0 can also
break the pep8 job if new check are added.
To avoid similar gate break in future, we need to bump the hacking min
version.
- http://lists.openstack.org/pipermail/openstack-discuss/2020-May/014828.html
Change-Id: Id086fbfefa941aa87db5f2b105e559265208b225
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.
Fix problems found.
Depends-On: https://review.opendev.org/722854
Change-Id: I190f32b2eea20024c71fc74bac7f5d011768473c
Since now linters check are provided by openstack-ansible-tests repo
which we're trying to get rid of, this patch implements new job template
openstack-ansible-linters-jobs which aims to cover linters checks, that
will be runned by gate-check-commit script. It provides next checks:
- ansible-lint
- ansible syntax-check
- bashate
- flake8
Role for the check will be selected based on the zuul.project.short_name
and passed as a scenario, while provided action is linters.
We can't use this check for openstack-ansible repo itself, since we have
a lot of linters debt, so we need to fix things inside roles first.
Depends-On: https://review.opendev.org/679238
Depends-On: https://review.opendev.org/679105
Change-Id: I24880ab92f89ca02f6b09a63da9f03dd5b230083
hacking pulls in the right versions of flake8 and flake8 does
depend on the right versions of mccabe, flake8, pycodestyle by itself,
so install that one first and remove the explicit listing of those
dependencies.
Change-Id: I99ad1c1c31c4ba9e0c7e3ed692e650a9b4aba13b
Boss drum, motivating rhythm of life with the
healing, rhythmic synergy.
More seriously, this patch re-arranges the
documentation structure to conform to the
structure outlined in [1].
With it, some changes are made to effectively
transition the links and simplify the sphinx
configuration.
The Mitaka/Liberty documentation links are
removed as they are no longer available.
[1] http://specs.openstack.org/openstack/docs-specs/specs/pike/os-manuals-migration.html
Change-Id: Icc985de3af4de5ea7a5aa01b6e6f6e524c67f11b
In https://review.openstack.org/372565 sphinxmark was added to
tox.ini to bypass the global requirements management restrictions
related to the stable/newton branch.
Since sphinxmark is in g-r master, it can now live in the right
place to be managed through the g-r process.
Related-Bug: #1624489
Change-Id: I39116db310c57c4cf224063d527e63ac755f968a
This patch implements:
- The OpenStack Manuals documentation theme.
- Some minor content changes to the index pages to ensure
that they render correctly.
- Adjustments to the tox/requirements configuration in order
to implement doc8 checks to facilitate improved documentation
checking for incoming patches.
- Adjustments to the sphinx configuration for easier
maintenance.
Note:
The bug_title in the openstackdocstheme is not currently
customisable. A patch to implement the ability to do so
has been submitted: https://review.openstack.org/338299
Partially-Implements: blueprint osa-install-guide-overhaul
Change-Id: I8af1a7ce9008e70abad00be96614c9997f59596b
In order to prepare for implementing requirements management by the
OpenStack requirements management process, and to enable the use of
tox to execute the functional test, this patch implements
some changes to the tox configuration:
- The minimum tox version is increased in order to be able to use
constraints for the python packages.
- The OpenStack upper-constraints are used when preparing the test
venv for the linters checks.
- Any proxy environment variables set on the test host are passed
into the venv to enable testing from behind a proxy.
- The environment variables used by Ansible tests are moved into
a new venv called 'ansible' and this environment is inherited
by all Ansible-related tests.
- The docs test will clean-up an existing build directory before
executing the docs build.
- The releasenotes build cannot use upper-constraints at this point,
so it doesn't.
- The Ansible role download will no longer ignore errors so that any
problems discovered will result in a failed test.
- A functional test environment which executes the gate-check-commit
script is added in order to allow the switch to using the same
functional test execution job in OpenStack-CI as is used for the
roles. This, in turn, enables the execution of the job for multiple
Operating Systems (CentOS, Ubuntu Xenial, etc).
- The 'ansible' and 'ansible-lint' requirements are moved from
test-requirements to the tox file in order to ensure that we
can abide by the global-requirements contract.
- The test-requirement for 'mock' has its formatting changed to
be consistent with other test-requirements.
Change-Id: Ida78a2eae93da5fc56ec6a3d58e75c7db0f08b16
Til now, the main() function of the script did all the input/output
logic of reading in the openstack_inventory.json file and creating the
backup files after multiple runs. While this is functional, it makes
elements of the script hard to test. Either files have to be written to
the file system during tests, which means they must be cleaned up
correctly, or very invasive mocking has to be done at a high level to
test other interactions.
This change moves the creation of the tar backup and the loading of the
openstack_inventory.json file into their own functions that can be
mocked in future tests. Because of their nature, testing of these two
functions is being done with invasive mocks to provide a starting point
in extracting actual filesystem I/O from happening unless explicitly
planned for. With this, future tests could provide mocked versions of
make_backup that are essentially no-ops, and provide smaller, more
customized structures via a mocked get_inventory. Such future changes
could then remove the manipulation of symlinks to
etc/openstack_deploy/openstack_user_config.yml.
Also, this extraction means the implementations could be overriden to
provide different sources and storage, though this is not as robust as a
fully extensible system such as plugins.
The get_backup_name function was created as an easier mocking point,
since the mock module does not allow for replacing builtin Python types,
which include datetime. While specific datetime manipulation libraries
do exist, they were not included here in order to reduce the scope of
changes and external dependencies.
Change-Id: I4bd2a0d06366844b2a60e29cc9c5481903ada4e2
This change allows Ansible to be installed and executed from within
a virtual environment.
Closes-Bug: 1431324
Implements: blueprint ansible-2-1-support
Change-Id: I2fb19dd8218753f75bd7550ed7ba9b79f777083d
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
Using the coverage report will show how much of the dynamic_inventory.py
script is actually exercised by tests. As of this commit, there is no
enforced coverage level, rather it is used for informational purposes
only. In the future, an enforce coverage percentage would be a good
idea.
Change-Id: Ic2ccc9ae5f306465b6990d935c82f81bb7b7956a
This version of ansible is broken due to the following upstream
Ansible issue:
* https://github.com/ansible/ansible-modules-extras/issues/2042
Change-Id: I832073c31f1ea1828ee48a541b03acb9e836e431
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
Bashate is pinned to ensure that for the rest of the cycle, and
once this becomes a stable branch, there are no code changes
needed for updates to the linting tool.
Also, the tox configuration is updated to ensure that it consumes
the dev-requirements file for all lint testing.
Finally, a small pep8 failure is fixed in the dynamic inventory script.
Change-Id: I78056d1d22228f073c44e9ee4e78534a4010effe
ansible-lint 2.3.7 added a rule checking for use of the deprecated
'sudo' and 'sudo_user' directives. They have been replaced with 'become'
and 'become_user' respectively.
Change-Id: I2271fe8468840884f19f41abba37e696c6296350
openstack-infra are creating images containing an apt.d configuration
that sets AllowUnauthenticated to true to support their custom apt
repos which contain unsigned packages. The presence of this file causes
openstack-ansible-security to fail. We can either remove the file, or
skip the V-38462 tag. Skipping the tag in the gate is probably the
better long term solution.
Additionally, ansible-lint 2.3.8 was released today and is now causing
a number of ANSIBLE0008 errors to fail the gate. This is a temporary
cap to unblock the gate.
Change-Id: I2c78f4e913e99e5fc5d84fba9e28197b73ac8f25
As per the release process changes for liberty and mitaka [1], the
reno tooling is being added to the repository for the purpose of
implementing on-going release note additions.
[1] http://lists.openstack.org/pipermail/openstack-dev/2015-November/078301.html
Change-Id: Ibbf4dc43b1fd5704a72cc7af82ddccfb1464926b
This is a cosmetic change to bring our requirement.txt files inline
with other OpenStack project.
Change-Id: I759acbbe9655884815df512835353dbb009b002c
Signed-off-by: Paul Belanger <pabelanger@redhat.com>