Refactor jobs to support pip / git installation testing

Because we want users to support both pip / git install methods,
refactor testing to support the testing of that.

Change-Id: I518b5e39921bde0aa68a40c30e2390afc0d886db
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2018-04-13 15:25:26 -04:00
parent d0e17e1265
commit a2c6f0dc9b
No known key found for this signature in database
GPG Key ID: 611A80832067AF38
3 changed files with 50 additions and 5 deletions

View File

@ -1,11 +1,17 @@
- job:
name: ansible-role-shade
run: tests/test.yaml
required-projects:
- name: openstack-infra/shade
name: ansible-role-shade-base
pre-run: tests/playbooks/pre.yaml
run: tests/playbooks/run.yaml
roles:
- zuul: openstack/ansible-role-shade
# Testing for nodepool_install_method: pip
- job:
name: ansible-role-shade
parent: ansible-role-shade-base
vars:
shade_install_method: pip
- job:
name: ansible-role-shade-fedora-27
parent: ansible-role-shade
@ -21,6 +27,31 @@
parent: ansible-role-shade
nodeset: ubuntu-xenial
# Testing for nodepool_install_method: git
- job:
name: ansible-role-shade-src
parent: ansible-role-shade-base
required-projects:
- name: openstack-infra/shade
vars:
shade_git_update: false
shade_install_method: git
- job:
name: ansible-role-shade-src-fedora-27
parent: ansible-role-shade-src
nodeset: fedora-27
- job:
name: ansible-role-shade-src-ubuntu-bionic
parent: ansible-role-shade-src
nodeset: ubuntu-bionic
- job:
name: ansible-role-shade-src-ubuntu-xenial
parent: ansible-role-shade-src
nodeset: ubuntu-xenial
- project:
templates:
- windmill-jobs-fedora-27
@ -31,9 +62,14 @@
- ansible-role-shade-fedora-27
- ansible-role-shade-ubuntu-bionic
- ansible-role-shade-ubuntu-xenial
- ansible-role-shade-src-fedora-27
- ansible-role-shade-src-ubuntu-bionic
- ansible-role-shade-src-ubuntu-xenial
- tox-linters
gate:
jobs:
- ansible-role-shade-fedora-27
- ansible-role-shade-ubuntu-xenial
- ansible-role-shade-src-fedora-27
- ansible-role-shade-src-ubuntu-xenial
- tox-linters

8
tests/playbooks/pre.yaml Normal file
View File

@ -0,0 +1,8 @@
- hosts: all
tasks:
- name: Disable extra wheels mirror
become: yes
lineinfile:
dest: /etc/pip.conf
regexp: ^extra-index-url
state: absent

View File

@ -14,7 +14,6 @@
---
- hosts: all
vars:
shade_git_update: false
rolename: ansible-role-shade
roles:
@ -25,9 +24,11 @@
stat:
path: /home/zuul/src/git.openstack.org/openstack-infra/shade
register: shade_git_dest_stat
when: shade_install_method == 'git'
- name: Assert shade_git_dest tests.
assert:
that:
- shade_git_dest_stat.stat.exists
- shade_git_dest_stat.stat.isdir
when: shade_install_method == 'git'