From 37e78b692cfc49d6d30204fe8470e77de697c747 Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Wed, 3 May 2017 17:29:03 +0100 Subject: [PATCH] Enable ARA cross-repo testing When executing tests in OpenStack-CI, this patch enables the use of 'Depends-On: ' in the commit message to execute the test using a patch that is still in review for the openstack/ara repository. This patch also lays the ground for similar testing to be done with other openstack repositories, but that will no work just yet as it will take quite a bit more machinery to make the cloned repositories be used to build the repo. That work will be submitted in a subsequent patch. Change-Id: Id946883fa14cd692fb7c6a0f24865b0239b7250c --- scripts/gate-check-commit.sh | 8 +++++++- tests/get-ansible-role-requirements.yml | 19 ++++++++++++++++--- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/scripts/gate-check-commit.sh b/scripts/gate-check-commit.sh index 38b1fa812f..5cb181bd4c 100755 --- a/scripts/gate-check-commit.sh +++ b/scripts/gate-check-commit.sh @@ -103,7 +103,13 @@ source "$(dirname "${0}")/bootstrap-ansible.sh" # Install ARA and add it to the callback path provided by bootstrap-ansible.sh/openstack-ansible.rc # This is added *here* instead of bootstrap-ansible so it's used for CI purposes only. -/opt/ansible-runtime/bin/pip install ara +if [[ -d "/tmp/openstack/ara" ]]; then + # This installs from a git checkout + /opt/ansible-runtime/bin/pip install /tmp/openstack/ara +else + # This installs from pypi + /opt/ansible-runtime/bin/pip install ara +fi export ANSIBLE_CALLBACK_PLUGINS="/etc/ansible/roles/plugins/callback:/opt/ansible-runtime/lib/python2.7/site-packages/ara/plugins/callbacks" # Log some data about the instance and the rest of the system diff --git a/tests/get-ansible-role-requirements.yml b/tests/get-ansible-role-requirements.yml index e75ac89e23..ab9bee557f 100644 --- a/tests/get-ansible-role-requirements.yml +++ b/tests/get-ansible-role-requirements.yml @@ -53,10 +53,21 @@ {%- set filtered_role_list = [] %} {%- for role in roles %} {%- if role.src | match(".*git.openstack.org.*") %} - {%- set _ = filtered_role_list.append(role) %} + {%- set role_src_cleaned = role.src | regex_replace('https://git.openstack.org/', '') %} + {%- set _ = filtered_role_list.append(role_src_cleaned) %} {%- endif %} {%- endfor %} {{- filtered_role_list -}} + openstack_repo_list: > + {%- set filtered_repo_list = [] %} + {%- set repo_list = lookup('env', 'ZUUL_CHANGES').split('^') %} + {%- for repo in repo_list %} + {%- set repo_cleaned = repo | regex_replace(':.*$', '') %} + {%- if not repo_cleaned | match("^openstack/openstack-ansible.*") %} + {%- set _ = filtered_repo_list.append(repo_cleaned) %} + {%- endif %} + {%- endfor %} + {{- filtered_repo_list -}} when: - _zuul_cloner_check.rc == 0 @@ -84,6 +95,8 @@ dest: '{{ role_path_default }}/openstack-ansible-security' - name: 'openstack/openstack-ansible-(?!security)(.*)' dest: '{{ role_path_default }}/\1' + - name: 'openstack/(?!openstack-ansible)(.*)' + dest: '/tmp/openstack/\1' dest: "/tmp/zuul-clonemap.yml" when: - _zuul_cloner_check.rc == 0 @@ -94,8 +107,8 @@ -m /tmp/zuul-clonemap.yml \ --cache-dir /opt/git \ git://git.openstack.org \ - {% for role in zuul_roles %} - {{ role.src | regex_replace('https://git.openstack.org/', '') }} \ + {% for repo in zuul_roles + openstack_repo_list %} + {{ repo }} \ {% endfor %} when: - _zuul_cloner_check.rc == 0