Enable ARA cross-repo testing

When executing tests in OpenStack-CI, this patch
enables the use of 'Depends-On: <change-id>' 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 venvs. That work will be
submitted in subsequent patches.

Change-Id: I7bc665bc7f8dd1759f521622e7607c089696a546
This commit is contained in:
Jesse Pretorius 2017-05-04 15:47:41 +01:00
parent de2ee7ccc5
commit fb5b3612a3
2 changed files with 21 additions and 7 deletions

View File

@ -58,10 +58,21 @@
{%- set filtered_role_list = [] %}
{%- for role in roles %}
{%- if (role.src | match(".*git.openstack.org.*")) and (not role.name | match("os_previous_.*")) %}
{%- 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: '{{ lookup("env", "WORKING_DIR") }}/tests/common'
- name: 'openstack/openstack-ansible-(?!tests)(.*)'
dest: '{{ homedir }}/.ansible/roles/\1'
- name: 'openstack/(?!openstack-ansible)(.*)'
dest: '{{ homedir }}/git/openstack/\1'
dest: "{{ homedir }}/.ansible/clonemap.yml"
when:
- _zuul_cloner_check.rc == 0
@ -94,8 +107,8 @@
-m {{ homedir }}/.ansible/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

View File

@ -30,6 +30,7 @@ set -e
## Vars ----------------------------------------------------------------------
export TESTING_HOME=${TESTING_HOME:-$HOME}
export WORKING_DIR=${WORKING_DIR:-$(pwd)}
export ROLE_NAME=${ROLE_NAME:-''}
@ -66,10 +67,10 @@ function setup_ara {
[[ -L "${ANSIBLE_PLUGIN_DIR}/callback/ara" ]] && return 0
# Install ARA from source if running in ARA gate, otherwise install from PyPi
if [[ -e /usr/zuul-env/bin/zuul-cloner && "${ZUUL_PROJECT}" == "openstack/ara" ]]; then
/usr/zuul-env/bin/zuul-cloner --workspace /tmp --cache-dir /opt/git \
git://git.openstack.org openstack/ara
pip install /tmp/openstack/ara
if [[ -d "${TESTING_HOME}/git/openstack/ara" ]]; then
pip install "${TESTING_HOME}/git/openstack/ara"
elif [[ "${ZUUL_PROJECT}" == "openstack/ara" ]]; then
pip install "${WORKING_DIR}"
else
pip install ara
fi