43 lines
1.7 KiB
YAML
43 lines
1.7 KiB
YAML
---
|
|
|
|
- hosts: all
|
|
environment:
|
|
ANSIBLE_LOG_PATH: "{{ ansible_user_dir }}/zuul-output/logs/ansible-execution.log"
|
|
pre_tasks:
|
|
|
|
- name: Set project path fact
|
|
set_fact:
|
|
tripleo_ansible_project_path: "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/tripleo-ansible'].src_dir }}"
|
|
|
|
- name: Set role or plugin path fact
|
|
set_fact:
|
|
triple_ansible_testdir: "{{ tripleo_ansible_project_path }}/tripleo_ansible/roles/{{ tripleo_role_name }}"
|
|
when: tripleo_role_name is defined and tripleo_role_name
|
|
|
|
- name: Set role or plugin path fact
|
|
set_fact:
|
|
triple_ansible_testdir: "{{ tripleo_ansible_project_path }}/tripleo_ansible/ansible_plugins/tests"
|
|
when: tripleo_role_name is not defined
|
|
|
|
- name: Set action plugin path fact
|
|
set_fact:
|
|
tripleo_action_plugins_paths:
|
|
- "{{ tripleo_ansible_project_path }}/tripleo_ansible/roles.galaxy/config_template/action"
|
|
- "{{ tripleo_ansible_project_path }}/tripleo_ansible/ansible_plugins/action"
|
|
- "/usr/share/ansible/plugins/action"
|
|
tasks:
|
|
- name: Run role test job
|
|
shell: |-
|
|
. {{ ansible_user_dir }}/test-python/bin/activate
|
|
. {{ tripleo_ansible_project_path }}/ansible-test-env.rc
|
|
pytest --color=no \
|
|
--html={{ ansible_user_dir }}/zuul-output/logs/reports.html \
|
|
--self-contained-html \
|
|
--ansible-args='{{ tripleo_job_ansible_args | default('') }}' \
|
|
{{ tripleo_ansible_project_path }}/tests/test_molecule.py
|
|
args:
|
|
chdir: "{{ triple_ansible_testdir }}"
|
|
executable: /bin/bash
|
|
environment:
|
|
ANSIBLE_ACTION_PLUGINS: "{{ tripleo_action_plugins_paths | join(':') }}"
|