From a80691a49c8ee76fcac2125ab6fe0cf7e06a42c2 Mon Sep 17 00:00:00 2001 From: David Moreau-Simard Date: Tue, 17 Oct 2017 23:11:50 -0400 Subject: [PATCH] Add integration tests for use-cached-repos Change-Id: I7da4db4ddd058b507754178177344b99363025ac --- tests/base.yaml | 1 + tests/use-cached-repos.yaml | 24 ++++++++++++++++++++++++ zuul.d/jobs.yaml | 6 ++++++ 3 files changed, 31 insertions(+) create mode 100644 tests/use-cached-repos.yaml diff --git a/tests/base.yaml b/tests/base.yaml index fbd46166..abaf2429 100644 --- a/tests/base.yaml +++ b/tests/base.yaml @@ -6,6 +6,7 @@ # Note: set-zuul-log-path-fact is tested by emit-job-header.yaml - include: emit-job-header.yaml - include: configure-unbound.yaml +- include: use-cached-repos.yaml - include: mirror-info.yaml - include: configure-mirrors.yaml - include: fetch-zuul-cloner.yaml diff --git a/tests/use-cached-repos.yaml b/tests/use-cached-repos.yaml new file mode 100644 index 00000000..adfffe73 --- /dev/null +++ b/tests/use-cached-repos.yaml @@ -0,0 +1,24 @@ +- name: Test the use-cached-repos role + hosts: all + roles: + - role: use-cached-repos + post_tasks: + # openstack-infra/project-config is in 'required-projects'. + # openstack-infra/opentack-zuul-jobs is also implicitly in 'projects'. + # We're checking them explicitly rather than with_items on zuul.projects + # in case there is a regression which would take an item out. + - name: Check that openstack-infra/project-config was prepared + stat: + path: "{{ ansible_user_dir }}/src/git.openstack.org/openstack-infra/project-config" + register: project_config + + - name: Check that openstack-infra/openstack-zuul-jobs was prepared + stat: + path: "{{ ansible_user_dir }}/src/git.openstack.org/openstack-infra/openstack-zuul-jobs" + register: ozj_config + + - name: Validate that required projects have been prepared + assert: + that: + - project_config.stat.exists + - ozj_config.stat.exists diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index 34d03abe..1b63a4a0 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -9,6 +9,8 @@ Runs roles that are included by default in the 'base' job in order to prevent regressions. parent: base-minimal + required-projects: + - openstack-infra/project-config roles: - zuul: openstack-infra/zuul-jobs run: tests/base @@ -19,6 +21,7 @@ - ^roles/fetch-zuul-cloner/.* - ^roles/mirror-info/.* - ^roles/set-zuul-log-path-fact/.* + - ^roles/use-cached-repos/.* - ^tests/.* - job: @@ -57,6 +60,8 @@ Runs roles that are included by default in the 'multinode' job in order to prevent regressions. parent: base-minimal + required-projects: + - openstack-infra/project-config roles: - zuul: openstack-infra/zuul-jobs run: tests/multinode @@ -67,6 +72,7 @@ - ^roles/fetch-zuul-cloner/.* - ^roles/mirror-info/.* - ^roles/set-zuul-log-path-fact/.* + - ^roles/use-cached-repos/.* - ^roles/multi-node-bridge/.* - ^roles/multi-node-firewall/.* - ^roles/multi-node-hosts-file/.*