Commit Graph

30 Commits

Author SHA1 Message Date
Sorin Sbarnea 59dad009e9 Bits to keep ansible-lint happy
- moved vars file under vars to avoid failure to load file (newer
  version raise error if you try to put vars outside vars/defaults as
  it will assume they are broken playbooks.
- added missing file-modes on few tasks

Change-Id: I7217469d089b655ee16cd038391cffa4197c8c83
Part-Of: https://review.opendev.org/c/zuul/zuul-jobs/+/773245
2021-03-10 18:04:08 +00:00
Pierre-Louis Bonicoli 222056a26f
Avoid to use 'length' filter with null value
This error occurs when variables are null and
DEFAULT_JINJA2_NATIVE is enabled:

    object of type 'NoneType' has no len()

Change-Id: I7c69be60b846c03e30a0a6e8893bf2f3a3d5e5b8
2020-08-03 03:31:29 +02:00
Mohammed Naser 1e72ab0a13 tox: run ensure-python first
We currently run ensure-python after running ensure-tox which means that
both ensure-pip and ensure-tox ran against the system Python instead of
the version that's created by ensure-python.

Depends-On: https://review.opendev.org/726549
Change-Id: Id2100bb5f981944223063cf4b2a5a568cc1dc366
2020-05-09 17:56:37 +00:00
Sorin Sbarnea 4af438d136 Made sequence indent consistent
Change-Id: I5ea4232ca4fd6e03d5b5f72eb6704bee84d04ea5
2020-05-07 14:13:55 +01:00
vass c80b593fb6 Rename install-docker to ensure-docker for consistency
The old role will be kept and include ensure-docker for backwards compatability.

Change-Id: Icb76a954b04631c405b09eb54343fd852a511b83
2020-04-04 15:41:29 -04:00
Sagi Shnaidman 4d168ed016 Rename vars/ directory to prevent conflicts
/vars directories from 'tox' playbook and roles are merged, which
creates conflicts and wrong variables are loaded into the playbook
Prevent merge of /vars directories from roles and 'tox' playbook
by renaming variables directory of playbook to molecule-vars.
It should fix failing job tripleo-ansible-centos-7-role-addition

Change-Id: Iee6768a27db36a3a18c0728040ab9c09857d55b6
2020-01-13 02:30:17 +02:00
Kevin Carter 7f156f22c7
Make pre-molecule tox playbook platform agnostic
This change updates the tox molecule playbook to make it platform
agnostic by moving the OS specific package lists into var files
that will be dynamically loaded based on the operating system
the playbook is being executed against. This is being done so
that we can use molecule on OS's like CentOS, Ubuntu, SUSE,
Debian, etc. While the only platforms supported at this time
are Red Hat based, this change will allow additional var files
to be added enabling additional platforms without needing any
chanages to our task structure.

> The linters job has been updated to exclude vars files from the
  ansible lint playbook commands. This is done because the playbook
  commands assume all found files are playbooks.

Change-Id: I88f3551838e3676374d0a795631c8769ba40fbf4
Signed-off-by: Kevin Carter <kecarter@redhat.com>
2020-01-02 09:49:28 -06:00
Monty Taylor 0865fe0387 Switch to fetch-sphinx-tarball for tox-docs
Also, change success-url to docs/ since that's where the new role places
them.

Change-Id: Ic8141bb4b12780a14928fb7978677ca6144d09da
2019-08-28 16:47:10 +02:00
Sorin Sbarnea 440592a560 Install system dependencies for tox-molecule
Avoids the need to add complex bindep.txt on each repository that
uses molecule by adding the boostraping of dependencies directly
in the job definition.

This was already tested on CentOS/Fedora/RHEL via
https://review.rdoproject.org/r/#/c/21486/

Change-Id: I2a3b1143b566b31fb866f7c3ecae7ff0276cb246
2019-07-16 14:13:13 +01:00
Sorin Sbarnea 1211185f3b Adds tox-molecule job
This adds job definition for running Ansible Molecule testing framework
from inside tox.

This would ease use of molecule testing for any projects that
want to use by avoiding the need to duplicate the setup code across
each repository.

It uses tox `molecule` environment.

Change-Id: I8df4df5448a78b9e21f45fac12d534eb84b29d3d
Needed-By: https://review.opendev.org/#/c/663599/
Needed-By: https://review.opendev.org/#/c/651772/
Needed-By: https://review.opendev.org/#/c/663336/
2019-06-11 16:25:24 +00:00
Corey Bryant 42cf8e680a Add ensure-python role
ensure-python allows for installation of a specific version of
the python interpreter and development files. Add this role to
tox pre.yaml.

Change-Id: Ia56cba58c87aa48de3e8e3f3d28f6252f7dcd7c3
2018-10-11 21:45:00 -04:00
Monty Taylor 91d1126097
Add tox-nodejs-npm base job for python and javascript
Sometimes projects are multi-language. Specifically, sometimes they need
to run both javascript and python toolchains. Support this by making a
tox-nodejs-npm job which installs both toolchains, then runs the npm
command followed by the tox command.

Most people won't need/want this, but it should make at least some folks
happy.

Change-Id: Iaedd680a548c6e8159693b7a79cd8676e805aa1f
2017-12-21 12:02:04 -06:00
Monty Taylor 6d8d1a4408
Move revoke-sudo from unittest pre to job run
Having revoke-sudo in the pre playbook of unittest has made us not able
to re-use unittest for javascript, and also means we can't use
nodejs-npm for nodejs-npm-run-test, which is a bit odd.

Instead, add the role to the run playbook for tox and npm, which allows
us to stack and combine things a bit better.

Change-Id: I0c7c508996ad2647db706d4ebf156c5dd96bf9b5
2017-12-21 11:54:54 -06:00
Monty Taylor d7cba9d7d5
Combine tox-siblings and tox roles
There is a bunch of duplicate logic between tox and tox-siblings, the
tox-siblings logic is already protected with a flag - and having them be
split already led to not doing the right thing with constraints files in
siblings when we did it right in tox itself.

Combine them into one role.

This means the siblings code will run as part of run instead of as part
of pre- but that's how things have worked for years anyway until
siblings was introduced - and is also the behavior is the siblings flag
is false -so it's more consistent overall.

Leave a no-op tox-siblings role so that we can gracefully remove the use of
tox-siblings from castellan, python-openstacksdk, shade and tacker.

Change-Id: Id61ae52d48b28cfc2221cb556a1c1f7c6dfd60dd
2017-11-29 15:34:08 -06:00
Tom Barron 74a40ec89e Collect output from coverage job
Add a post-run playbook to tox-cover job to collect the coverage
report detail and copy it to the log root of the executor.

Change-Id: Ibad091f7630832eb993133b0f43a60931b3dfd75
2017-10-17 21:58:36 -04:00
Monty Taylor 56f6938968
Override tox requirments with zuul git repos
It's a common desire to be able to have a job that runs unittests
against the git checkout of another repository, but getting the tox
environment into that shape is a bunch of extra work.

Now that we have a defined place where repos go and they're always on
the build node, we can look in the source dir for git repos that contain
python packages and ask setup.py for the name of the python package they
provide.

We can then see what packages tox decided to install for this
environment, see if we have any matching ones in the source code repos
we've put on disk and if so we can re-install those depends from the
source location.

That way we can cause a tox job to use a second repo for cross-repo
unittesting simply by adding that project to required_projects.

Add a flag to disable the behavior ... although the easiest way to
disable the behavior is to just not list other projects in
required_projects.

Change-Id: Ia5250c11b1d73baaa70ea1cef7ea1ba4d5bab821
Story: 2001136
Task: 4852
2017-09-11 12:55:26 -06:00
Zuul 14e2a22299 Merge "Split ensuring tox is installed into a role" 2017-08-22 20:47:21 +00:00
Monty Taylor 80ec023985
Remove tox-tarball job
This isn't really a general thing. We'll add a different thing in
openstack-zuul-jobs.

Change-Id: I7343977bd678c50a2ad1221692d56cafae3111f0
2017-08-22 16:09:03 -04:00
Monty Taylor c36d95b4ba
Rename tox/tarball-post to python/tarball-post
The actions of the playbook don't really have anything to do with tox.
Tarballs go into dist/ whether tox is used or not.

Change-Id: I49d9efaf34644c47df0a1acb6ca108fe4ec99fa4
2017-08-22 16:09:02 -04:00
Monty Taylor dafe1bfcb4
Split ensuring tox is installed into a role
We do this in a few places, make it reusable.

Change-Id: Ied118508dc4b8e4cbfca88b5636730664dbe10b4
2017-08-22 15:19:33 -04:00
Jenkins 5046ad8447 Merge "Create fetch-tox-output role" 2017-08-08 20:59:49 +00:00
Paul Belanger 4420bbd2c9 Create fetch-tox-output role
We can move the content from tox/post.yaml into an ansible role. This
allows other projects to use it.

Change-Id: Ic7fc31a372de29a3a97ef84539faf3b0a1d6e181
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2017-08-03 16:37:00 -04:00
Paul Belanger 1b5c55d875 Log file stats for tox tarball / wheels
Add some additional information about tarballs / wheels we are
copying. For example, md5 and sha1 info.

Change-Id: I96d6903f8bc5ced196b1b57f93277fa87bdf31c1
Depends-On: I86ff459d283eaf348821c2f11c1f8575598f088d
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2017-08-02 16:57:33 -04:00
Paul Belanger 64785f464b
Update tox-tarball to use tox role
We no longer need to depend on our run-tarball / run-wheel roles. I
also plan to add back our sha1sum / md5sum files back in a follow
patch.

Change-Id: If4814a21192112d841fdb24cfdd1fd1a8bd427e6
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2017-08-02 10:35:29 -04:00
Paul Belanger 851ba9ea4d
Support multi node jobs for tox logs
It is possible somebody may want to run tox jobs over multiple nodes.
Check to see if more then one node is in our inventory, if so then add
the inventory_hostname to the log path.

Change-Id: Icd0532cb415fdae42eae6d2269d5a0be5fcdf98a
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2017-07-21 17:36:43 -04:00
Paul Belanger 1280a99434
Create tox-pep8 jobs
Because we want to use tox role variables (tox_envlist) across
multiple plays. We need to setup the variable in zuul.yaml.  However,
this now means we need to create tox-pep8 job now since we are using
the tox/run playbook.

Change-Id: I6c15c076a510375dfacc66a0e07bc3f1228adf06
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2017-07-18 17:35:56 -04:00
Paul Belanger 829297c37a
Ensure we load roles for linting
Did didn't have ansible-lint setup properly, as a results our roles
weren't actually linted properly.

Fix variable linting issues and ignore ANSIBLE0012.

Change-Id: I07aa940245e700c9f08df0f1920720f0ed9d3de0
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2017-07-17 16:50:06 -04:00
Paul Belanger 9258e5b6d8
Update to tox_envlist variable
Rename tox_environment to tox_envlist to better map with tox --help
documentation. This also allows the following patch to support shell
environmental variables.

Change-Id: I2fb4e1c167ef93ad2948f2d328beff5e39ac52b7
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2017-07-14 11:49:20 -04:00
Paul Belanger 9e464b6438
Enable verify_host for synchronize
There is no need to have this disabled (seems to be by default). We
already have ensured our SSH hostkeys have been setup properly.

Change-Id: I5f0ffea13b4adb053c10d56728bcf02c13255513
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2017-07-11 15:55:03 -04:00
Monty Taylor 4b9fc09a1c
Port in tox jobs from openstack-zuul-jobs
The original idea was that we'd have a "python27" job. But it turns out
that "python27" isn't actually as universal as you might think.
"tox-py27" on the other hand is a thing that can and should always work
for people who want to run tox with the py27 env.

Port in the jobs we had in openstack-zuul-jobs.

Also, copy in the text of the old shell scripts so that we can iterate on
them and make them better piecemeal.

These are named zuul-tox not tox because we already have tox jobs
defined elsewhere. We'll need to do the naming dance while we work on
them.

Change-Id: I813f3f2ae138c07918556bc81655518023527131
2017-07-06 11:18:47 -05:00