From a2c6f0dc9bb3404a6241ab66623771269eb26f8b Mon Sep 17 00:00:00 2001 From: Paul Belanger Date: Fri, 13 Apr 2018 15:25:26 -0400 Subject: [PATCH] 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 --- .zuul.yaml | 44 ++++++++++++++++++++++--- tests/playbooks/pre.yaml | 8 +++++ tests/{test.yaml => playbooks/run.yaml} | 3 +- 3 files changed, 50 insertions(+), 5 deletions(-) create mode 100644 tests/playbooks/pre.yaml rename tests/{test.yaml => playbooks/run.yaml} (92%) diff --git a/.zuul.yaml b/.zuul.yaml index cb2a91d..9258869 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -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 diff --git a/tests/playbooks/pre.yaml b/tests/playbooks/pre.yaml new file mode 100644 index 0000000..a33abbc --- /dev/null +++ b/tests/playbooks/pre.yaml @@ -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 diff --git a/tests/test.yaml b/tests/playbooks/run.yaml similarity index 92% rename from tests/test.yaml rename to tests/playbooks/run.yaml index f1a7b14..ad31488 100644 --- a/tests/test.yaml +++ b/tests/playbooks/run.yaml @@ -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'