Commit Graph

46 Commits

Author SHA1 Message Date
Dmitriy Rabotyagov 4130be36d0 Bump ansible-core to 2.15.3 and ansible-lint
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-os_cinder/+/895688
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-os_glance/+/895682
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-openstack_hosts/+/895681
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-os_nova/+/895689

Change-Id: I38f91c716cfdb82eaec20ab3c7de6fcda363a11d
2023-09-19 10:11:44 +00:00
Dmitriy Rabotyagov bb3a58604b Restore dynamic_inventory unit testing
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
2023-01-11 10:14:43 +00:00
Dmitriy Rabotyagov 0ca4ddf578 Update ansible-lint version
Change-Id: Ic738d717b4364c3fa67ccab1f7d171a8ea81cd03
2022-01-10 14:54:43 +02:00
Dmitriy Rabotyagov 82e3d013fe Bump ansible-lint version
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-os_sahara/+/792241
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-os_octavia/+/792242
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-memcached_server/+/793400
Change-Id: I73cd3ef5a8c63be66f1a68e9e2de34421e27e6fd
2021-05-31 10:03:26 +00:00
Jonathan Rosser c556a7f1c2 Update pip/setuptools/wheel to latest version
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
2021-02-11 11:54:29 +00:00
wu.shiming 469b7d66b3 Use unittest.mock instead of mock
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
2020-11-23 05:24:25 +00:00
Jonathan Rosser ec3233f9f8 Update ansible-lint==4.3.5, flake8==3.8.3, bashate>=0.5.1
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
2020-10-05 13:32:51 +00:00
zhangbailin a14c2d9b1a Fix hacking min version to 3.0.1
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
2020-09-02 10:04:34 +00:00
Andreas Jaeger 2860f1bda5 Update hacking for Python3
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
2020-04-29 06:20:40 +00:00
Dmitriy Rabotyagov 94e8518f68 Add unified linters check
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
2019-10-15 11:11:14 +00:00
confi-surya 66316a0cfe Update hacking version to latest
Change-Id: I6a78932f7adb953e56b050f01846ad8f5d29be98
2019-01-09 11:19:44 +05:30
ZhongShengping c9eb1441fb Follow the new PTI for document build
For compliance with the Project Testing Interface as described in:
https://governance.openstack.org/tc/reference/project-testing-interface.html

For more detials information, please refer to:
http://lists.openstack.org/pipermail/openstack-dev/2017-December/125710.html

Change-Id: I97c08f18e60b75308099228d08ffd9436cc5b6e2
2018-03-09 12:37:18 +08:00
OpenStack Proposal Bot 1fca3416a1 Updated from global requirements
Change-Id: Ia55275858ff4b2a0887751e93f75f8315a5b6838
2018-01-24 01:15:08 +00:00
OpenStack Proposal Bot 59bc83b7a1 Updated from global requirements
Change-Id: Ia3075c7b37864ac8a1c287f5e50b663114009e45
2018-01-18 03:13:10 +00:00
OpenStack Proposal Bot cbd552eee7 Updated from global requirements
Change-Id: I7f083ecf8e19030c621324fa2b162f22cb831bd0
2017-11-16 11:11:46 +00:00
Dirk Mueller a86cfab633 Install hacking first and let it pull in right linter versions
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
2017-10-26 13:43:58 +02:00
OpenStack Proposal Bot 7dcc04866a Updated from global requirements
Change-Id: I05381aba9b37477adf0c28ec3069cdc4f194a0c8
2017-09-16 23:18:59 +00:00
OpenStack Proposal Bot 9ba94a05e7 Updated from global requirements
Change-Id: I854ea0f1d778d4fed0c4c387222f395b3b127c89
2017-09-13 12:57:41 +00:00
OpenStack Proposal Bot e1a997a835 Updated from global requirements
Change-Id: I846f67840c9d478f64595a501ed423f79451c01f
2017-08-18 15:53:50 +00:00
OpenStack Proposal Bot faa5fdd842 Updated from global requirements
Change-Id: I161d5cbecda244239e017f1e4796fd0d75a1963a
2017-07-28 21:43:37 +00:00
Jesse Pretorius 315780f350 March to the beat of the new docs drum
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
2017-07-05 09:13:13 +00:00
OpenStack Proposal Bot 3feeb57bfc Updated from global requirements
Change-Id: Ie711693b3c4a01a9ac09a60dae88381a2334d908
2017-06-27 12:17:12 +00:00
OpenStack Proposal Bot 09b9641628 Updated from global requirements
Change-Id: Ifdaf9b01545a41cda947a38f770f3b1d21642790
2017-06-02 22:02:22 +00:00
OpenStack Proposal Bot e8680739ab Updated from global requirements
Change-Id: Ic33a7ed5e4e8f7c94bc1f67ddb955d47f730cebc
2017-05-17 03:54:09 +00:00
OpenStack Proposal Bot e32cfead4a Updated from global requirements
Change-Id: I4d9e67e64c0b3136affe7a07207be2ba60df4ccf
2017-05-15 00:50:49 +00:00
OpenStack Proposal Bot 9831ad87e1 Updated from global requirements
Change-Id: I21b0d4ded1cd756db117a32c2a4d02ef5cdd0c5a
2017-02-10 05:55:14 +00:00
OpenStack Proposal Bot 1b341c8bea Updated from global requirements
Change-Id: Ibb088f3c393aee7d7633f5964b1bc9beec1d3e22
2016-11-24 22:56:07 +00:00
OpenStack Proposal Bot db61c772d2 Updated from global requirements
Change-Id: Icbe79bb575449cc17aced0a60557f0742c978fdc
2016-11-02 21:58:21 +00:00
OpenStack Proposal Bot 4015d7aeed Updated from global requirements
Change-Id: Ibd978c1c0eb998289ce6785386a784113f31f106
2016-10-22 01:24:16 +00:00
OpenStack Proposal Bot 8b400611a8 Updated from global requirements
Change-Id: I6a89caa92e8b00322851a3999a9bc9230824b9aa
2016-10-10 20:45:46 +00:00
Nish Patwa 5265e1b5eb [docs] Move sphinxmark requirement to test-requirements.txt
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
2016-10-10 09:15:15 +00:00
OpenStack Proposal Bot 75cb2c6f16 Updated from global requirements
Change-Id: Ifa0d51c21694a17bc2da5bec52a301279e8255e6
2016-09-29 22:36:16 +00:00
OpenStack Proposal Bot c51fe9b44c Updated from global requirements
Change-Id: Ia927e8531990c5951ff1965fe354824f58061541
2016-08-26 05:12:13 +00:00
OpenStack Proposal Bot 7b75c2211c Updated from global requirements
Change-Id: I93efaf00ca29502890a4aec5d2a2c3a4330bfa76
2016-07-21 22:26:49 +00:00
OpenStack Proposal Bot 47bd970672 Updated from global requirements
Change-Id: I2476f413fd182a8203604c099d074d06eb1a5656
2016-07-15 12:58:23 +00:00
Jesse Pretorius 03041378f2 Docs: Implement Manuals Theme and doc8 checks
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
2016-07-10 00:30:22 +01:00
Jesse Pretorius 255de9876b Update tox configuration
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
2016-07-06 16:22:18 +01:00
Nolan Brubaker 12ba1306a7 Extract and test inventory and backup I/O
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
2016-06-07 14:45:30 +00:00
Kevin Carter c904de2db5 Isolate Ansible from the deployment host
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>
2016-05-26 10:41:27 +00:00
Nolan Brubaker 559d2dc865 Add coverage reporting to inventory testing
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
2016-04-20 09:38:17 -04:00
Kevin Carter 4604950dbb
blacklist Ansible 1.9.6
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>
2016-04-16 08:49:41 -05:00
Jesse Pretorius 13bea32989 Cap bashate and fix linters tests
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
2016-03-07 17:36:30 +00:00
Jimmy McCrory c8630f72be Resolve ansible-lint ANSIBLE0008
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
2016-02-11 07:40:09 -08:00
Matt Thompson b4bb5105b6 Skip V-38462 in gate and cap ansible-lint
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
2016-02-11 15:36:31 +00:00
Jesse Pretorius 4effbbddae Add reno for release notes management
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
2015-11-12 14:12:45 +00:00
Paul Belanger 5715151e22 Rename dev-requirements.txt to test-requirements.txt
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>
2015-11-11 21:50:44 -05:00