Commit Graph

72 Commits

Author SHA1 Message Date
Clark Boylan cc8ff00d04 Update tox.ini for tox v4
This updates whitelist_externals to allowlist_externals for tox v4
compatibility. We override the ensure_tox_version from ensure-tox to
force latest tox to be used which should check that we are compatible in
this change.

Change-Id: I0ac3c1aa35c949d9b83a8607d43ed29f2fca480e
2022-12-12 16:09:39 -08:00
Ian Wienand deed697853
testinfra: Update selenium calls
Now that all the bridge nodes are Jammy (3.10), we can uncap this
dependency which will bring in the latest selenium.  Unfortunately
after investigation the easier way to do things I hoped this would
allow doesn't work; comments are added and small updates for new API.

Update the users file-match so they run too.

Change-Id: I6a9d02bfc79b90417b1f5b3d9431f4305864869c
2022-10-20 09:00:43 +11:00
Ian Wienand 34dc0f2679
Run jobs with a jammy bridge.openstack.org
In prepartion for upgrading this host, run jobs with a Jammy based
bridge.openstack.org.

Since this has a much later Python, it brings in a later version of
selenium when testing (used for screenshots) which has dropped some of
the APIs we use.  Pin it to the old version; we will fix this in a
follow-on just to address one thing at a time
(I6a9d02bfc79b90417b1f5b3d9431f4305864869c).

Change-Id: If53286c284f8d25248abf4a1b2edd6951437dec2
2022-10-20 09:00:43 +11:00
Ian Wienand 21a3c40d04
testinfra: install with ansible extras
Swap the dependency to testinfra's "ansbile" extras rather than
bringing this in ourselves.  This really makes no difference, but I
think it is a bit clearer about what is going on.

Change-Id: I95b1e921a0891e3be6df6c25c3b30b3903f0393b
2022-10-10 16:08:14 +11:00
Ian Wienand 122644b5c6
install-ansible: remove testinfra version install workaround
This was added with 3cd8cd0765 but
ansible-core is a package now.  We can remove this workaround.

Change-Id: Ide1f3bbfe8887315a9f574bb1c19bf3234f58686
2022-10-10 16:08:14 +11:00
Jeremy Stanley e2649a1aba Stop redirecting for the paste site
The pastebinit command-line tool hard-codes an allowed list of
pastebin URLs, one of which is "http://paste.openstack.org" so
redirecting to HTTPS and to other hostnames seems to break it.

It has a specific user-agent, so allow plain HTTP access for this
tool, but redirect others.

Change-Id: Ia7c983986e6e9c08299ded5282a83761448b35bb
2021-08-19 15:21:03 +10:00
James E. Blair e58a18d8a1 Stop running ansible-lint on this repo
It is buggy (throwing exceptions for undefinied variables which are
actualyl defined via set_fact), and we frequently run into problems
using it in this repo.  It was designed to lint roles for Galaxy,
not the way we write ansible.  As of the 5.0.0 release it's
generating >4.5K lines of complaints about files in this repository.

Change-Id: If9d8c19b5e663bdd6b6f35ffed88db3cff3d79f8
2021-02-09 22:08:38 +00:00
Ian Wienand be085e564e run-selenium: run selenium on a node
This runs selenium from a container on a node, and exposes port 4444
so you can issue commands to it.  This is used in the follow-on
I56cda99790d3c172e10b664e57abeca10efc5566 to take some screenshots of
gerrit.

Change-Id: Idcbcd9a8f33bd86b5f3e546dd563792212e0751b
2021-01-18 07:58:23 -08:00
Ian Wienand 3cd8cd0765 devel job: use ansible-core name
As described inline, installing ansible from source now installs the
"ansible-core" package, instead of "ansible-base".  Since they can't
live together nicely, we have to do a manual override for the devel
job.

Change-Id: I1299ea330e6de048b661fc087f016491758631c7
2020-11-18 14:49:46 +11:00
Sorin Sbarnea 05c4bcbfa7 Account for testinfra project rename
testinfra was project moved and renamed at the same time. Only
the package name was renamed, the module installed is still the same
testinfra and there are no known side effects.

Change-Id: If041f61ba00c8fb8d2d52e07654283d3c4a238f0
2020-11-09 14:58:43 +00:00
Ian Wienand 001ad4d7b1 tox: drop test-requirements.txt
We have several tox environments that don't really share the same
dependencies.  Currently we put everything into test-requirements.txt,
meaning the linter environment gets testinfra and testinfra
environment gets things like ansible-lint it's not using.

Apart from being a bit faster not installing things, this is helpful
for restoring the ansible -devel test.  In that case, we have ansible
as a project dependency; when installing from git, ansible now
installs itself as "ansible-base" ("ansible" is the released pypi
package that incorporates collections).  So if we install ansible-lint
in the testinfra environment, this pulls in ansible ... and then it
breaks when tox wants to install our Zuul clone of upstream ansible
(you can't have ansible and ansible-base together).

Change-Id: I5f3fc93e6ddd611f319fa269e122ed576c9cb378
2020-08-25 08:41:44 +10:00
Ian Wienand ba45f251d1 Fix junit error, add HTML report
Specifying the family stops a deprecation warning being output.

Add a HTML report and report it as an artifact as well; this is easier
to read.

Change-Id: I2bd6505c19cee2d51e9af27e9344cfe2e1110572
2020-07-15 07:03:22 +10:00
Monty Taylor 83ced7f6e6 Split inventory into multiple dirs and move hostvars
Make inventory/service for service-specific things, including the
groups.yaml group definitions, and inventory/base for hostvars
related to the base system, including the list of hosts.

Move the exisitng host_vars into inventory/service, since most of
them are likely service-specific. Move group_vars/all.yaml into
base/group_vars as almost all of it is related to base things,
with the execption of the gerrit public key.

A followup patch will move host-specific values into equivilent
files in inventory/base.

This should let us override hostvars in gate jobs. It should also
allow us to do better file matchers - and to be able to organize
our playbooks move if we want to.

Depends-On: https://review.opendev.org/731583
Change-Id: Iddf57b5be47c2e9de16b83a1bc83bee25db995cf
2020-06-04 07:44:36 -05:00
Ian Wienand 0d004ea73d testinfra: pass inventory and zuul data
Create a zuul_data fixture for testinfra.

The fixture directly loads the inventory from the inventory YAML file
written out.  This lets you get easy access to the IP addresses of the
hosts.

We pass in the "zuul" variable by writing it out to a YAML file on
disk, and then passing an environment variable to this.  This is
useful for things like determining which job is running.  Additional
arbitrary data could be added to this if required.

Change-Id: I8adb7601f7eec6d48509f8f1a42840beca70120c
2020-05-20 13:41:04 +10:00
Monty Taylor 2513a1b519 Go back to using find with ansible-lint
ansible-lints ability to find ansible files is less than
good. Go back to find - but leave the config in the .ansible-lint
file since that does clean up the command invocation.

While we're there - turn off quiet - let's be loud.

Change-Id: Ie495e3d9ff1b82e84069e07c60c7217fc8399a1c
2020-03-11 16:30:33 -05:00
Clark Boylan 9e394d24d0 Return goaccess html as zuul artifact
This will give us a nice link to the goaccess reports on the zuul
dashboard build pages.

Move ansible-lint config into config file

As of 4.2.0 we can configure ansible-lint with a config file. It's
also apparently now smart enough to only find ansible yaml. Let's
see how that goes.

Add a fake zuul_return module

This should let us fake out ansible-lint without having to install
all of zuul.

Change-Id: Ib233eb577a8ca2aabfe3a49b2cd823dd4a00bd82
2020-03-11 14:28:28 -05:00
Ian Wienand ac11734cf9 ansible-lint : disable 503
This has got me a number of times; I think we can tell in review if a
task firing in response to a "changed" is best in a handler or not.

Remove existing noqa flags

Change-Id: I80ad631f978eeeb9903abe230a95f23f5709d20e
2020-03-06 09:57:00 +11:00
Ian Wienand 41127eb1c9 linters: ensure openstack/inventory.yaml parses
This runs openstack/inventory.yaml through a basic syntax check.  This
would have caught a typo such as in
I0e55d2c575427e404709e78d0c7a10a974117ac4 (fixed
I834411ef2dee458ae15fb99a3c88b6d2fee4cf1e)

Change-Id: I4cbf9898d598aeeef1583ab22ceb9d0cdf081064
2019-06-12 10:23:46 +10:00
Ian Wienand 52780440ff Update to ansible-lint 4.1.0
In a follow-on change (I9bf74df351e056791ed817180436617048224d2c) I
want to use #noqa to ignore an ansible-lint rule on a task; however
emperical testing shows that it doesn't work with 3.5.1.  Upgrading to
4.1.0 it seems whatever was wrong has been fixed.

This, however, requires upgrading to 4.1.0.

I've been through the errors ... the comments inline I think justify
what has been turned off.  The two legitimate variable space issues I
have rolled into this change; all other hits were false positives as
described.

Change-Id: I7752648aa2d1728749390cf4f38459c1032c0877
2019-06-06 22:13:12 +00:00
James E. Blair 9ff29b108d Test gitea project creation playbook
Add an option to run a playbook (in the fake bridge context) after
running the base playbook.  Use this to run a new playbook which
exercises gitea project creation after bootstrapping the gitea
service.

Disable ansible-lint 304 because it erroneously thinks shell and
command are the same thing.

Change-Id: I0394b614771bc62b9fe23d811defd7767b3d10db
2019-03-06 18:42:39 +00:00
Monty Taylor 214662a424 Install latest openstacksdk on bridge
It's designed to always be used from the latest version.

This trips an ansible lint rule (ANSIBLE0010) which we can ignore, as
we often have pip things that we want to install the latest release
of automatically.

Change-Id: Ieac93ab3a555f2423d4fbcf101d6d9681ae0e497
2018-11-07 06:20:33 +11:00
Ian Wienand 526a423dd2 Add unittest for yamlgroup inventory plugin
This mocks out enough of the Ansible inventory framework so we can
test the group matching against a range of corner cases as present in
the results.yaml file.

Change-Id: I05114d9aae6f149122da20f239c8b3546bc140bc
2018-11-02 08:20:02 +11:00
Zuul 59f03951f7 Merge "Use zuul-sphinx README.rst detection" 2018-09-19 23:54:54 +00:00
James E. Blair 09b1ff4bc3 Add system-config-run-eavesdrop
Add a job which runs testinfra for the eavesdrop server.  When we
have a per-hostgroup playbook, we will add it to this job too.

The puppet group is removed from the run-base job because the
groups.yaml file is now used to construct groups (as it does
in production) and will construct the group correctly.

The testinfra iptables module may throw an error if it's run
multiple times simultaneously on the same host.  To avoid this,
stop using parallel execution.

Change-Id: I1a7bab5c14b0da22393ab568000d0921c28675aa
2018-08-30 10:25:23 -07:00
Paul Belanger 20286235b6 Generate junit.xml file for testinfra
And collect it on post, it is helpful to see the results.

Change-Id: I0dbecf57bf9182168eb6f99cdf88329fcdeb1bdc
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2018-08-29 12:00:43 -04:00
Zuul fcfacc7e52 Merge "Add system-config-run-base job" 2018-08-24 19:57:27 +00:00
James E. Blair 19aebca3e7 Add system-config-run-base job
This adds a job which creates a bridge-like node and bootstraps it,
and then runs the base playbook against all of the node types we
use in our control plane.  It uses testinfra to validate the results.

Change-Id: Ibdbaf511bbdaee46e1335f2c83b95ba1553a1d94
Depends-On: https://review.openstack.org/595905
2018-08-24 08:50:01 -07:00
Ian Wienand a6c2fb53e7 Use zuul-sphinx README.rst detection
With the dependent change, zuul-sphinx will raise a warning when the
autoroles matcher finds a role without a README.rst.  Since we
error-on-warnings this will stop the docs build.  Thus we don't need
this explicit linters check.

Change-Id: I02eefce2448152505bacba3b2a12021515b4a31a
Depends-On: https://review.openstack.org/596014
2018-08-24 17:59:28 +10:00
Ian Wienand 1939f3e8ec Move exim role to top-level
Move the exim role to be a "generic" role in the top-level roles/
directory, making it available for use as a Zuul role.

Update the linters jobs to look for roles in the top level

Update the Role documentation to explain what the split in roles is
about.

Change-Id: I6b49d2a4b120141b3c99f5f1e28c410da12d9dc3
2018-08-23 21:34:47 +10:00
Ian Wienand 4402201d56 roles: Add README.rst and lint
These role docs aren't exactly War and Peace, but I think longer term
as we fiddle about making things generic or not and moving them
around, we'll be better off having kept ourselves to writing
*something*.

Add terse README.rst files for all existing roles, and add simple
linter check to ensure new roles get them too.

Change-Id: Ibc836310fb8a45e12c2e31f112d92509ac350413
2018-08-23 21:34:42 +10:00
Zuul 181aa06d8e Merge "Move tox basepython to top-level" 2018-08-22 01:26:16 +00:00
Ian Wienand c3c5cb97af Update to latest docs PTI
We now put the documentation-only requirements in doc/requirements.txt
and call build-sphinx directly [1]; see

[1] https://governance.openstack.org/tc/reference/project-testing-interface.html#documentation

Change-Id: I4ade203f1746409275d213f409603199ecb93878
2018-08-22 07:51:46 +10:00
Ian Wienand 93b8f98fac Move tox basepython to top-level
Currently we're building docs with python 2.  It works fine with
python3, so move the basepython override up to the top level so we're
all-python3-all-the-time.

Change-Id: I2c49a0b8bcda72385a9594f40a6b9db10403d688
2018-08-22 07:50:40 +10:00
Ian Wienand 19ed6637b6 Add a clouds.yaml checker
Load our various cloud configuration files into openstacksdk for a
basic sanity check of the configuration.

Change-Id: Ieedb3439533f3162d2b5cecca4b7fc07b631019e
2018-06-22 11:47:39 +10:00
Mohammed Naser a99f033a08 Switch ansible-lint to using multiple -x options
ansible-lint 3.4.22 seems to have introduced a change in behaviour
in how it parses the excludes (-x) back in March[1]. However, it
seems that the new release never got pushed to PyPi until now.

This has resulted in the linting jobs failing, so switching the
format to be the new one instead of pinning to an older release.

[1]: https://github.com/willthames/ansible-lint/commit/96d0a0bc

Change-Id: I446e734364298e90a64063e811343aa11430765f
2018-06-17 10:17:04 -04:00
Paul Belanger a08424387e Run ansible-lint on playbooks
This fixes the issues we have with our rename_repos.yaml file. We are
also skipping additional failures for now, which will be cleaned up in
a follow up patch.

Change-Id: I726535e195a292e3f2d457f0ed039d01bb96c66b
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2017-01-12 15:32:46 -05:00
Andreas Jaeger 4139c901d8 Check number of meetbot channels
Check that we do not have more than 120 channels setup for meetbot.

Change-Id: Ib5b948c68691ec959d4826a2cdf28f3e50631e60
2016-11-02 20:45:06 +01:00
Andreas Jaeger 6af9364e68 Remove pep8/bashate targets
These targets are now part of the linters environment, so can be
removed.

Change-Id: I2bfdac672b3d1d375e098e9b38371935a6f208fe
2015-12-28 19:43:23 +01:00
Andreas Jaeger 98146b48f8 Test for sorted modules as part of linting
Merge the currently not used modulesenv target into the linters
target so that we test that modules are sorted properly which is
some kind of lint. There's no need to run an extra VM just
for checking the sorting, so include it here.

Change-Id: I547c77de92a00a42ac0841b087350144e760562f
2015-12-23 20:14:57 +01:00
Andreas Jaeger 091ff2816c Create linters test target
Merge bashate and pep8 into a single linters test environment.

Change-Id: I13c68da7cb69fe240179a2074512decbf2a35560
2015-12-22 10:15:21 +01:00
Andreas Jaeger 1f7bb54dd9 Fix pep8 failures
Exclude .eggs directory from testing.
The run-pep8 script now calls "python setup.py sdist" and that
one creates an .eggs directory that should not be tested.

Change-Id: I854be157ed04d5bc9d8c568a37c00298cb4a71bf
2015-12-07 10:52:35 +01:00
Ramy Asselin 14fd503aaa Migrate to puppet-openstackci openstackci::nodepool
Manage nodepool configurations using the common-ci solution
in puppet-openstackci

Remove nodepool.yaml.erb from this repo as openstackci::nodepool
will pull it in from project-config/nodepool/nodepool.yaml

Remove the tox nodepool environment and test dependency as it
has been migrated to project-config

The nodepool logging template file and associated tool that generates the file
will remain in this repo. In the short term, updates to nodepool.yaml in
project-config repo may require a related change in this repo to update the logging
configuration. In the longer term, nodepool will be updated to automatically
log image creations without needing a customized logging configuration.

Depends-on: I89207d100eb4b6bbb502a6ed38831f49e4b29096
Depends-on: I473a1b78acdb035eb379394a7ed5f771434dc942
Depends-on: I6b01ab7260a41927fff34b9b81b631ea2c933f22
Change-Id: I2b45a7145805368b1598d3a3e8a94f0e4eb8cf2d
2015-11-10 15:13:50 -08:00
Spencer Krum 1f0704e462 Alpha-sort modules.env
Also adds a test to ensure that they stay that way.

Change-Id: Ib34a81885f1eda28e85d04b727e8b810b274cb44
2015-07-02 12:25:24 -07:00
Ian Wienand 6892b11603 Add nodepool config-validation environment
Add validation test for the nodepool configuration.  We get nodepool
directly from git so we can always handle the latest syntax changes
automatically.

Change-Id: I5d58648bca160d8afc81aae3d8daf0c7bd01c976
Depends-On: I250ea4959740cfc4650e9057caba09ae7bc25768
2015-03-19 00:55:40 +00:00
Jenkins 5dba0f5637 Merge "Clean up bashate failures" 2014-10-20 18:35:44 +00:00
K Jonathan Harker 948aff1f02 Clean up bashate failures
Fix all of the bashate failures.  Also, bashate will install its negative
tests in its virtualenv, so we need to generate a list of files to pass to
bashate that excludes .tox/

Change-Id: I55559bf6137f705aec9a7f277928ad8d4cadc2ca
2014-09-30 12:40:59 -07:00
Steve Martinelli 5b20a385f6 Remove undefined upstream environment from tox.ini
Commit number 3fa3be7ede initially
added the upstream testenv, but it was merged to the 'projects'
testenv a long time ago. Which is now obsolete, because of the
split to project-config.

Change-Id: I2d011af7df2ad9d14d2db67fa78c4dc6e4e4cbb6
2014-09-30 15:20:19 -04:00
Steve Martinelli b32ab2d00a Remove irc testenv from tox.ini
Change-Id: I1b998ba9cfeb8744b9801c4968afae872ebcfeb3
testenv:irc is obsolete since the project-config split
2014-09-30 15:18:38 -04:00
Steve Martinelli 022cfb6142 Remove jjb from tox.ini
Since the split to project-config, there is no longer a need to
test this environment in tox.

Change-Id: I9a3866126506a9784a38f2c859bac6b5774660b7
2014-09-30 15:17:25 -04:00
Steve Martinelli 8cf6e680f4 Remove projects_alphabetized from tox.ini
Since the split to project-config, there is no longer a need to
run 'tox' for projects_alphabetized, since those resources no
longer exist. Also removing the shell scripts that were running
the tests.

Change-Id: Ib7a762d872da9c5d945206807c405e7452b49638
2014-09-30 15:15:10 -04:00