-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.yml
47 lines (43 loc) · 1.59 KB
/
run.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
- name: Run test suite
hosts: tester
gather_facts: no
any_errors_fatal: true
tasks:
- name: set test suite name and pattern
set_fact:
test_suite: "{{ test.tests | basename | splitext | first }}"
test_pattern: "{{ test.tests }}"
- name: install test runner
pip:
virtualenv: "{{ setup.ospdui.dir }}/.venv"
name: "{{ item }}"
version: "{{ ir_default_pip_versions[item] | default(omit) }}"
state: "{{ ir_default_pip_versions[item] is defined | ternary('present', 'latest') }}"
with_items:
- pytest
- name: switch ui widgets for 11
shell: "./osp_switcher.sh {{ test.openstack.version|int }}"
args:
chdir: "{{ setup.ospdui.dir }}/webui/ospdui/widget_containers/"
executable: /bin/bash
tags: skip_ansible_lint
when: test.openstack.version|int < 12
- name: run ospdui tests
environment:
DISPLAY: ":1"
PATH: "{{ ansible_env.PATH }}:{{ ansible_env.HOME }}/bin"
shell: |
source .venv/bin/activate
py.test -s {{ test_pattern }} \
--junit-xml={{ test_suite }}.xml
args:
chdir: "{{ setup.ospdui.dir }}"
executable: /bin/bash
ignore_errors: true
tags: skip_ansible_lint
- name: fetch resulting file
fetch:
src: "{{ setup.ospdui.dir }}/{{ test_suite }}.xml"
dest: "{{ inventory_dir }}/ospdui_results/{{ test_suite }}.xml"
flat: yes
fail_on_missing: yes