devstack-gate/roles/test-matrix/tasks/main.yaml
Ian Wienand 89bfc2a9fb Check for virtualenv binary
The current check looks for a virtualenv package; but this isn't
portable to other platforms.  In the gate we also have installed from
upstream (to ensure latest) and the package might be on hold, etc
which might mess up the detection.

I think the KISS thing to do is to check for virtualenv and fail with
a useful message.

Change-Id: Icf15ddd18ca52885f5c4a89a7d83622a70c811d5
2018-02-06 08:09:22 +11:00

44 lines
1.2 KiB
YAML

- name: Deploy then features matrix and d-g bash functions
copy:
src: "{{ test_matrix_features }}"
dest: "{{ ansible_user_dir }}"
- name: Check for virtualenv
command: which virtualenv
changed_when: false
failed_when: false
register: virtualenv_available
- name: Ensure virtualenv is installed
fail:
msg: "Please ensure virtualenv is available!"
when:
- virtualenv_available | failed
- ansible_os_family != 'Darwin'
- name: Install PyYAML to parse the test matrix
pip:
name: PyYAML
virtualenv: "/tmp/.test_matrix_venv"
- name: Append neutron to configs for stable/ocata+
set_fact:
test_matrix_configs: "{{ test_matrix_configs }} + [ 'neutron' ]"
when:
- '"neutron" not in test_matrix_configs'
- test_matrix_branch | match("^(stable/[o-z].*|master)$")
- name: Run the test matrix
test_matrix:
features: "{{ ansible_user_dir }}/{{ test_matrix_features | basename }}"
branch: "{{ test_matrix_branch }}"
role: "{{ test_matrix_role }}"
configs: "{{ test_matrix_configs }}"
vars:
ansible_python_interpreter: "/tmp/.test_matrix_venv/bin/python"
register: test_matrix_result
- name: Set the enabled_services fact
set_fact:
enabled_services: "{{ test_matrix_result.services }}"