Commit Graph

35 Commits

Author SHA1 Message Date
Dmitriy Rabotyagov d163850d7c Bump ansible-core to 2.12.8
On 30.09.2023, "old" ansible galaxy(galaxy.ansible.com) was replaced
with "galaxy ng"[1].
There was a bug [2][3][4] that was fixed only in a supported
ansible-core versions, so:
- v2.12.8
- v2.13.3
- v2.14.0 (and all newer versions)

All openstack-ansible versions up to Yoga are using older ansible-core
versions.
As a result, bootstrap-ansible.sh script fails with an error:

```
Skipping Galaxy server https://galaxy.ansible.com/api/. Got an
unexpected error when getting available versions of collection
ansible.netcommon:
'/api/v3/plugin/ansible/content/published/collections/index/ansible/netcommon/versions/'
```

This patch bumps ansible-core version to 2.12.8 that includes required
fix.

[1] https://www.ansible.com/blog/new-ansible-galaxy
[2] https://github.com/ansible/ansible/issues/81830
[3] https://github.com/ansible/ansible/issues/77911
[4] https://github.com/ansible/ansible/pull/78325

Change-Id: I2c15c220ca8c6b6f0cbedbf0da8e802b7c0f5e2d
2023-10-16 15:32:55 +00:00
Dmitriy Rabotyagov 747c5f6554 Update tox.ini to work with 4.0
With tox release of 4.0, some parameters were deprecated and are ignored now
which causes tox failures. One of the most spread issues we have is using
`whitelist_externals` isntead of `allowlist_externals`


Change-Id: Id2a4cb712b4099bff1c05c4d10502a7572517268
2022-12-28 09:14:53 +00:00
Dmitriy Rabotyagov 2ebc57082c Add SERVICES_BRANCH variable for better control
Currently TESTING_BRANCH serving 2 purposes - it controls over OSA
branch to use and services branch.
At the same time we need to have these separated from time to time, as
OSA is trailing.

Change-Id: Ib5ca8c7d3300f4e8efd81f87612c821594bebfac
2022-05-31 16:59:26 +01:00
Marc Gariepy a504a35d29 Cleanup setup.py config
Change-Id: I8f09bb6e6752eced91a0276495c3b0cf5764e0c1
2022-03-31 10:41:50 -04:00
zhoulinhui 88634fd929 Replace deprecated UPPER_CONSTRAINTS_FILE variable
Change-Id: Id06f4f0d593b0a9867387797ba0474f744d15727
2020-11-10 13:12:16 +08:00
Andreas Jaeger 3862cba2e8 Enable warnings for docs build
-W should be set to default docs environment to complain about warnings,
add it.

Change-Id: I264570ea462c4df6c9208c039fa11b0e17e62b04
2020-04-26 14:49:12 +02:00
Andreas Jaeger 74797e4291 Use "pip -m install"
Currently, we are overriding 'install_command' to use 'pip'. This is
considered poor behavior and 'python -m pip' should be used instead:

https://snarky.ca/why-you-should-use-python-m-pip/

It turns out that this is the the default value provided by tox:

https://tox.readthedocs.io/en/latest/config.html#conf-install_command

So we can remove the line and simply use the default value - after
adding constraints to deps as is best practice as well.

Mosts tests itself use "pip install" in the shell scripts which sets
also the constraints. Change that to "python -m pip install" like done
for tox.

Change-Id: I27f80d8aa4ac3688ee56e8a9234e34f4e09afe34
2020-04-26 14:48:25 +02:00
Andreas Jaeger 3bca43ceae Cleanup py27 support
Make a few cleanups:
- Remove python 2.7 stanza from setup.py
- Remove obsolete sections from setup.cfg
- Update requirements, no need for python_version anymore
- Cleanup doc/source/conf.py to remove now obsolete content.
- Use newer openstackdocstheme version
- Cleanup tox.ini for Python 3 only

Change-Id: I9d63e63cf142fded002f7212588266d88f41dd06
2020-04-10 12:34:59 +02:00
Jonathan Rosser c45e630762 Run tox functional tests under python3
This requires the centos-7 functional jobs to be non-voting as
a precursor to replacing them with integrated repo tests. These
are centos-7 jobs are removed entirely from the gate template.

Change-Id: I0cd779bb6debaf7b77788b671b2d77869ec89667
2020-02-17 14:07:22 +00:00
jacky06 c61d73d902 tox: Keeping going with docs
1. Sphinx 1.8 introduced [1] the '--keep-going' argument which, as its name
suggests, keeps the build running when it encounters non-fatal errors.
This is exceptionally useful in avoiding a continuous edit-build loop
when undertaking large doc reworks where multiple errors may be
introduced.

2. Remove the unnecessary blank line for tox.ini

[1] https://github.com/sphinx-doc/sphinx/commit/e3483e9b045

Change-Id: Ie837d376bb1a1d93367369d25140dd8a9d5ac14e
2019-11-18 13:26:07 +00:00
sonpn13 c96edc7975 PDF Documentation Build tox target
Change-Id: I6f24c663ae188f36f7ac33ea57d175af501bbfd6
Signed-off-by: sonpn13 <sonpn13@viettel.com.vn>
Story: 2006105
Task: 35339
2019-11-01 15:11:41 +02:00
Dmitriy Rabotjagov 3bf45d57cb Replace git.openstack.org with opendev.org
This patch replaces git.openstack.org with opendev.org as redirection
from old path was enabled.

Change-Id: I8a070e0aded59dd7a4751218bd95bc23d153c6d3
2019-05-08 19:49:28 +03:00
Tuan Do Anh c44352f31b fix tox python3 overrides
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 of that
breaks the more specific versions used in default environments like
py35 and py36.

Change-Id: Iadbc25016279958768928e9c63ee545c0bca0e23
2018-07-06 10:18:02 +07:00
Jesse Pretorius 57010b8be5 Use tests repo for common role test requirements
Using tox for requirements management requires in-repo
requirements files for all our repositories. Rather than
do that, we make use of the tests repo to capture our
common requirements and use this to install them.

This reduces our review requirement rate and simplifies
maintenance for us for the tox config. It also makes it
usable with 'Depends-On', which is marvellous!

The tox changes in this review will need to be replicated
to all other roles. All other roles will also need their
'test-requirements.txt' file removed unless they have
something special in them which is not common.

The tox requirements definitions for docs/releasenotes
builds are left in-place as those are standard entries
across the community. If that changes at some point, we
can re-assess those entries too.

Change-Id: I7c209dc69eb893b2448a7d70cf195e55b628604b
2018-07-02 09:33:32 +01:00
Jesse Pretorius 0a4ac2a1c7 Have run_tests clone the test repo
Current run_tests.sh executes another script (tests-repo-clone.sh)
to clone the tests repo. That script therefore has to be replicated
out to all the other repositories too.

In order to try to reduce the footprint of things that need to be
replicated out to the repositories, we fold the tests repo clone
into run_tests.sh and move the clone of the previous tests repo
into the common test script. We also remove the conditional for
the previous test repo clone as it does no harm to always have it.

To reduce the maintenance when creating new branches, we key the
branch to be cloned by run_tests.sh to the content in the .gitreview
file. This way as soon as a branch is created and that file is
updated, the right branch is cloned and the system becomes self
maintaining.

Some extra comments are added to explain the purpose of variables/
commands and the install_pkg_deps function is changed to just be
in line script as the function is no re-used anywhere else.

We change the set vars in the common script to add x and remove v
to reduce the output verbosity and only output the useful stuff.

Finally, the linters job definition is changed so that it uses
run_tests.sh to execute the lint tests. This simplifies the job
definition and also ensures that zuul runs tests in the same way
that humans do.

Change-Id: I9f26f4f438715ce6361cc9960f58f2d256c5a839
2018-03-26 18:18:05 +01:00
Jesse Pretorius b5be5add3d tox.ini: Expose USER environment variable to execution environment
In order to allow the use of the environment variable which informs
Ansible which user executed the playbook, we pass the USER env var
into the environment that tox builds.

Change-Id: I529134be4cf557202450606189de6fe70244b494
Implements: blueprint python-build-install-simplification
Signed-off-by: Jesse Pretorius <jesse.pretorius@rackspace.co.uk>
2018-03-15 18:04:30 +00:00
ZhongShengping 2816f8db75 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: I15d31277284596eec7f3066d2be477a6e27c54e9
2018-03-11 07:09:23 +00:00
Jesse Pretorius b58a2c0287 Implement zuul v2/v3 role fetch shim
In order to be able to simultaneously work with the
differing implementations of zuul-cloner in zuul v2
and zuul v3 we implement a detection routine to
behave appropriately for each version.

This is very much a band-aid just to help us transition
because once the transition to zuul v3 is complete we
should be able to ditch this whole playbook for
something built into zuul v3, and use something very
simple for executing tests when not using zuul.

Change-Id: Ic824e7ca7c564d5de7a27c77a79014ad274afade
2017-10-16 18:08:05 +01:00
Jesse Pretorius 0ca9a2c45c Ensure that role tests pin pip/setuptools/wheel
Currently the role tests use whatever versions of pip,
setuptools and wheel are already installed on the host.

When a version of these tools changes it often causes
problems for our testing.

This will ensure that we use a known good set of pins
which is maintained in the general SHA bumping process.

Change-Id: I5720eb69cfbbe24136ebdfcac9c68893b3595b27
2017-06-04 09:04:58 +00:00
Jesse Pretorius ad298c4277 Use zuul-cloner for tests repo in OpenStack-CI
When executing the tests repo clone in OpenStack-CI,
use zuul-cloner instead of git to enable cross-repo
testing. This ensures that if a dependent patch from
the tests repo is noted using 'Depends-On: <change-id>'
in the commit message, that patch will be included.

Change-Id: Idce7abebf32f24c356a27e099fbca954d917402b
2017-05-04 11:39:44 +01:00
gecong1973 74c9969243 Delete deprecated Hacking in tox.ini
Some hacking have been removed,so we can delete them.
More details:
     https://github.com/openstack-dev/hacking/blob/master/setup.cfg

Change-Id: If5e1792d6fa5d703fb40f82f1f8bca2e425cee9f
2016-12-02 11:37:10 +08:00
Jesse Pretorius 643328ecbd Use upper constraints for all tox targets
With the implementation of https://review.openstack.org/388087 all
tox targets may now use upper constraints.

Change-Id: I72bbc3d1cbd2b03c3c41d9fb5782b18fe5afbe8b
2016-10-19 07:46:56 +01:00
Jesse Pretorius 90d76c59f8 Implement centralised Ansible test scripts
This patch implements test scripts intended for use by all
OpenStack-Ansible role tests.

The intent is to simplify the role tox.ini configuration
and ensure that as many changes to role testing configuration
can be managed from the centralised tests repo instead of
individually in each repository.

This patch implements the scripts to centralise the
ansible-lint, ansible-syntax, and functional Ansible tests.

Functionality included:

- For a simple functional test, the defaults will be allow
  the execution of the test without any parameters set.
- For a scenario test the scripts allow the inventory,
  extra vars and any other CLI parameters for Ansible to be
  set via environment variables.
- Both check mode and an idempotence test.

In addition to this functionality, the bash scripts are all
set to fail on error to ensure that tox shows a failure.

Change-Id: I23c24146485da340d4f046f80e4814652e6e3876
2016-10-05 09:56:12 +01:00
Jesse Pretorius 9a09e9ff07 Implement centralised test scripts
This patch implements test scripts intended for use by all
OpenStack-Ansible role tests.

The intent is to simplify the role tox.ini configuration
and ensure that as many changes to role testing configuration
can be managed from the centralised tests repo instead of
individually in each repository.

The common tests repo target location when cloned is changed
from 'tests/playbooks' to 'tests/common' to better reflect
the content and purpose.

Change-Id: I1a93329ada24670c87588ce5a07f92c9bce4e50b
2016-09-23 16:04:36 +01:00
Travis Truman ff2c2bea3c Use common log commands for tox config
Change-Id: Ibc44f587a741d12d48e8ce528f40e2d21c177b98
2016-09-19 10:57:23 -04:00
Travis Truman 1943251152 Address ansible_ssh_* var deprecation
Replacing usage of ansible_ssh_host, ansible_ssh_user,
ansible_ssh_port with ansible_host, ansible_user and ansible_port
Depends-On: I35371879a87c115f219cd181245fe59f6d7d3f77
Change-Id: I97c3958c406b44b271d361860516d0b903438a83
2016-09-19 11:06:48 +01:00
Kevin Carter 7bef676c06 Update testing bits for consistency
Change-Id: Ibc139be4ff5c4fde7429284d1dc68f94b8291d7d
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2016-09-16 21:19:23 -05:00
Travis Truman 8c1fbd3bb0 Ansible 2.1.1 role testing
Change-Id: I5b42bea81f26af5e2d4e3a51645fafc3040eb490
2016-09-13 10:17:08 -04:00
Jesse Pretorius aac2f5411d Compress test execution logs
The volume of logs we collect in CI jobs are extensive. This
patch ensures that the logs collected are compressed to reduce
the space taken in CI systems.

PYTHONUNBUFFERED is also set to ensure that the console log
from the CI jobs is recorded in the exact order of execution.

Change-Id: I323987e281eff6245189109e6c4b17e999739b8c
Related-Bug: #1620849
2016-09-09 10:58:01 +01:00
Andy McCrae 44547e2696 Fix the central repository to work with CentOS
Add interface drop for CentOS (Will need to be extended to allow
multiple interfaces)
Add network config files based on ansible_os_family.
Add nodepool tasks for CentOS
Add a default network file for both CentOS and Ubuntu

Change-Id: Ideb84f153fbd9f8f83ff39042f139b25719b39d8
2016-09-02 15:04:43 +00:00
Jenkins e9714958d9 Merge "Add convergence test for test repo." 2016-08-30 17:03:54 +00:00
Andy McCrae c01f249046 Add convergence test for test repo.
For test repo we should build out keystone + infra services, as they are
the most commonly used roles/tasks.

We still need to add some funcitonal tests but this should give a good
base. The test repo will consume it's own test plays in the same way as
other repositories would. We use a "git clone ." to avoid a situation
where we clone the old repo containing the errors we are trying to fix.

Additional fix, we don't need a "when" clause on the rabbit/db creation
tasks - since these are already delegated and a "run_once" will suffice.
This fix is required for the tests to pass.

Change-Id: I482500872f9e29a71e1576f67a0ad390be2a3ece
2016-08-30 14:37:25 +00:00
Kevin Carter 7e1be0c26f Enable log collection after functional testing
This change enables log collection within the gate so that further analysis
on gate tasks can be performed post build. This is very useful when
debugging problems.

Change-Id: I50f0baf3050942c47c135270f911c4baa29791c8
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2016-08-29 21:38:49 -05:00
Jesse Pretorius 9b8832ef50 Make all linting tests use upper-constraints
As per [1] all linting tests can now use upper-constraints. This patch
removes all instances of the install_command override relating to lint
testing which were needed to negate the use of upper-constraints.

[1] http://lists.openstack.org/pipermail/openstack-dev/2016-August/101474.html

Change-Id: I6dde0c0b7259b231e243fdb0c4627bc7b485c800
2016-08-20 16:08:33 +01:00
Jean-Philippe Evrard 64e65750cd Introduced all the scaffolding for test repo
- gitignore to avoid bad files
- git review to enable git review/gerrit integration
- Vagrantfile like the other repos, but not useful (yet!)
- dummy inventory file
- setup.* files because docs use pbr
- requirements files
- tox.ini for test launcher to match openstack standards
- scaffolded docs and release notes for gates to pass

Change-Id: Iaf78c8fd3c2138e1d7d4384fb83c90cb7ddd6d10
2016-08-12 14:50:07 +00:00