tripleo-quickstart-extras/roles/validate-tempest/tasks/stackviz.yml
Arx Cruz 3dab05c257 Fix tempest html generation file
In the latest version of tempest, the testr was replaced by
stestr, and so, the path where these results were stored changed
as well from .testrepository to .stestr. This patch verify which
directory was generated, and execute the subunit2html in the
proper directory.

Change-Id: Ic5a04781f830597a2c5fe9516a704ff5a9b5ff24
Closes-Bug: #1729403
2017-11-07 19:00:16 +01:00

62 lines
1.6 KiB
YAML

---
- name: Check for .stestr directory
stat:
path: "{{ working_dir }}/tempest/.stestr"
register: testr_dir
- name: Define testr facts
set_fact:
testr_command: testr
testr_dir: .testrepository
when: not testr_dir.stat.exists
- name: Define stestr facts
set_fact:
testr_command: stestr
testr_dir: .stestr
when: testr_dir.stat.exists
- name: Cloning stackviz from openstack
git:
repo: git://git.openstack.org/openstack/stackviz
dest: "{{ working_dir }}/stackviz"
version: master
- name: Copying stackviz static files
synchronize:
src: stackviz/
dest: "{{ working_dir }}/stackviz_static"
use_ssh_args: true
- name: Install pip
easy_install:
name: pip
state: present
become: true
- name: Install stackviz
pip:
name: "."
chdir: "{{ working_dir }}/stackviz"
become: true
- name: Check if dstats file exists
stat: path=/var/log/extra/dstat-csv.log
register: dstat_result
- name: Set dstat fact
set_fact:
tempest_dstat_opt: '--dstat /var/log/extra/dstat-csv.log'
when: dstat_result.stat.exists
- name: Collecting data from tempest
shell: >
{% if tempest_format == 'venv' %}source {{ working_dir }}/tempest_git/.venv/bin/activate; {% endif %}
{{ testr_command }} last --subunit | subunit-1to2 | stackviz-export {{ tempest_dstat_opt | default('') }} --env --stdin {{ working_dir }}/stackviz_static/data
args:
chdir: "{{ working_dir }}/tempest"
- name: Moving stackviz to /var/log/extra
shell: mv {{ working_dir }}/stackviz_static/ /var/log/extra/stackviz
become: true