Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zuul CI configuration #9107

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .zuul.d/jobs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
- job:
name: pypa-pip-base
abstract: true
description: Run pypa/pip testing
pre-run: .zuul.d/playbooks/tox/pre.yaml
run: .zuul.d/playbooks/tox/main.yaml
post-run: .zuul.d/playbooks/tox/post.yaml

- job:
name: pypa-pip-py38
parent: pypa-pip-base
nodeset: ubuntu-focal
vars:
tox_envlist: py38
Comment on lines +9 to +14
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we look into adding more envs? Other distros?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like that was the initial reasoning for exploring Zuul :) @ssbarnea I think was most involved in that disucssion

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I just wasn't sure if it's expected that they'd appear in this PR or follow-ups

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My preference is probably to not overload this initial support with a bunch more things, but I'm open to suggestion. Note that any new jobs proposed in a pull request are speculatively tested by Zuul, so things will never get into a failure state

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what you mean by saying that things won't get into a failure state. I think I may be unfamiliar with what speculative testing actually means in this context. Mind explaining?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I mean is just like this change, any pull requests that modify/add/remove jobs in .zuul.d will be tested by Zuul with that config applied. i.e. if we add a pull request to add centos/debian/XYZ jobs as a follow-up pull-request, those jobs will run on that pull request before it is committed, and we can iterate, debug, etc. That's what I mean by speculative testing; the proposed config changes are tested by Zuul from the pull request, without being committed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, so it's basically the same as what other CIs do... I didn't know there's a special term for this behavior.

Empty file added .zuul.d/playbooks/.zuul.ignore
Empty file.
18 changes: 18 additions & 0 deletions .zuul.d/playbooks/tox/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
- hosts: all
tasks:

# TODO(ianw) : let's see if this is interferring
# with some of the pip tox runs
- name: Remove OpenDev mirror config
file:
path: /etc/pip.conf
state: absent
become: yes
Comment on lines +6 to +10
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe set PIP_CONFIG_FILE=/dev/null env var instead?
cc @pradyunsg

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If yes, this could probably be done per-test to make use of the mirrors in tests that don't need to hit the production PyPI.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or even PIP_ISOLATED=true (is this a thing?)


- name: Run tox testing
include_role:
name: tox
vars:
tox_extra_args: "-- --html={{ zuul_output_dir }}/logs/test-results.html --self-contained-html --verbose -n auto --use-venv"
tox_environment:
CI: true
14 changes: 14 additions & 0 deletions .zuul.d/playbooks/tox/post.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
- hosts: all
tasks:

- name: Fetch tox output
include_role:
name: fetch-tox-output

- name: Return testinfra report HTML artifact
zuul_return:
data:
zuul:
artifacts:
- name: pytest results
url: 'test-results.html'
6 changes: 6 additions & 0 deletions .zuul.d/playbooks/tox/pre.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- hosts: all
tasks:

- name: Install tox
include_role:
name: ensure-tox
4 changes: 4 additions & 0 deletions .zuul.d/project.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- project:
check:
jobs:
- pypa-pip-py38
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@ prune news
prune tasks
prune tests
prune tools

recursive-exclude .zuul.d *
recursive-exclude .zuul.playbooks *
1 change: 1 addition & 0 deletions news/9103.trivial.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add CI configuration for `Opendev <https://opendev.org>`__ `Zuul <https://zuul-ci.org/>`__ testing
1 change: 1 addition & 0 deletions tools/requirements/tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ mock
pretend
pytest
pytest-cov
pytest-html
pytest-rerunfailures
pytest-timeout
pytest-xdist
Expand Down