tobiko/roles/tests/test_infrared_plugin.yaml
Federico Ressi dd5362b779 Add Vagrant tests for infrared plugin (CentOS 8)
Change-Id: Icd7d5634f1da91a4cedd3ccf5c752297c318ef22
2020-04-06 10:44:16 +02:00

66 lines
1.5 KiB
YAML

---
- hosts: primary
vars:
test_src_dir: /vagrant
test_collect_dir: '{{ test_src_dir }}/test_results'
roles:
- tobiko-ensure-tox
- tobiko-ensure-git
- tobiko-ensure-rsync
tasks:
- name: "remove collected files"
file:
path: '{{ test_collect_dir }}'
state: absent
- name: "set ansible_python_interpreter fact"
set_fact:
ansible_python_interpreter: >
{{ ansible_python_interpreter |
default("/usr/libexec/platform-python") }}
- name: "run Tox InfraRed plugin"
command: >
'{{ tox_executable }}' -e infrared --
--host secondary
--collect-dir '{{ test_collect_dir }}'
args:
chdir: /vagrant
ignore_errors: yes
register: run_tox
- name: "show Tox InfraRed plugin output"
debug: var=run_tox.stdout_lines
- name: "show Tox InfraRed plugin errors"
debug: var=run_tox.stderr_lines
when: run_tox is failed
failed_when: yes
- name: "list collected files"
command: >
ls '{{ test_collect_dir }}'
register: list_test_result_files
- name: "set collected files fact"
set_fact:
collected_files: '{{ list_test_result_files.stdout_lines }}'
- name: "show collected files"
debug: var=collected_files
- name: "check collected files"
assert:
that:
- item in collected_files
loop:
- tobiko.log
- tobiko.conf
- test_results.html
- test_results.subunit
- test_results.xml