From 5efd428d9ee2e68cd2ff7bfd7f191db066032ade Mon Sep 17 00:00:00 2001 From: Paul Belanger Date: Thu, 12 Apr 2018 10:54:10 -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: Ieef3763172fbfe07a5d0cc4c83c37a6dad30b3cd Depends-On: https://review.openstack.org/560996 Signed-off-by: Paul Belanger --- .zuul.yaml | 43 +++++++++++++++++++++++-- tests/{test.yaml => playbooks/run.yaml} | 4 +-- 2 files changed, 43 insertions(+), 4 deletions(-) rename tests/{test.yaml => playbooks/run.yaml} (98%) diff --git a/.zuul.yaml b/.zuul.yaml index 35fa990..1096ce6 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -1,11 +1,22 @@ - job: - name: ansible-role-nodepool - run: tests/test.yaml + name: ansible-role-nodepool-base + run: tests/playbooks/run.yaml post-run: tests/collect-logs.yaml required-projects: - name: openstack-infra/nodepool roles: - zuul: openstack/ansible-role-nodepool + vars: + # TODO(pabelanger): This needs to fix to defaut to this when not using + # a virtualenv. + nodepool_pip_executable: pip3 + +# Testing for nodepool_install_method: pip +- job: + name: ansible-role-nodepool + parent: ansible-role-nodepool-base + vars: + nodepool_install_method: pip - job: name: ansible-role-nodepool-fedora-27 @@ -22,6 +33,29 @@ parent: ansible-role-nodepool nodeset: ubuntu-xenial +# Testing for nodepool_install_method: git +- job: + name: ansible-role-nodepool-src + parent: ansible-role-nodepool-base + vars: + nodepool_git_update: false + nodepool_install_method: git + +- job: + name: ansible-role-nodepool-src-fedora-27 + parent: ansible-role-nodepool-src + nodeset: fedora-27 + +- job: + name: ansible-role-nodepool-src-ubuntu-bionic + parent: ansible-role-nodepool-src + nodeset: ubuntu-bionic + +- job: + name: ansible-role-nodepool-src-ubuntu-xenial + parent: ansible-role-nodepool-src + nodeset: ubuntu-xenial + - project: name: openstack/ansible-role-nodepool templates: @@ -33,9 +67,14 @@ - ansible-role-nodepool-fedora-27 - ansible-role-nodepool-ubuntu-bionic - ansible-role-nodepool-ubuntu-xenial + - ansible-role-nodepool-src-fedora-27 + - ansible-role-nodepool-src-ubuntu-bionic + - ansible-role-nodepool-src-ubuntu-xenial - tox-linters gate: jobs: - ansible-role-nodepool-fedora-27 - ansible-role-nodepool-ubuntu-xenial + - ansible-role-nodepool-src-fedora-27 + - ansible-role-nodepool-src-ubuntu-xenial - tox-linters diff --git a/tests/test.yaml b/tests/playbooks/run.yaml similarity index 98% rename from tests/test.yaml rename to tests/playbooks/run.yaml index b238886..6bfcbcd 100644 --- a/tests/test.yaml +++ b/tests/playbooks/run.yaml @@ -14,8 +14,6 @@ --- - hosts: all vars: - nodepool_git_update: false - nodepool_pip_executable: pip3 rolename: ansible-role-nodepool roles: @@ -139,12 +137,14 @@ stat: path: /home/zuul/src/git.openstack.org/openstack-infra/nodepool register: nodepool_git_dest_stat + when: nodepool_install_method == 'git' - name: Assert nodepool_git_dest tests. assert: that: - nodepool_git_dest_stat.stat.exists - nodepool_git_dest_stat.stat.isdir + when: nodepool_install_method == 'git' - name: Register /etc/systemd/system/nodepool-builder.service stat: