Merge "Add role to build the stackviz report"
This commit is contained in:
commit
9bd78bcd65
@ -8,13 +8,15 @@
|
||||
- role: process-test-results
|
||||
test_results_dir: '{{ logs_root }}/tempest'
|
||||
tox_envdir: tempest
|
||||
- role: process-stackviz
|
||||
- role: stage-output
|
||||
zuul_copy_output:
|
||||
{ '{{ logs_root }}/tempest/etc/tempest.conf': 'logs',
|
||||
'{{ logs_root }}/tempest/etc/accounts.yaml': 'logs',
|
||||
'{{ logs_root }}/tempest/tempest.log': 'logs',
|
||||
'{{ stage_dir }}/{{ test_results_stage_name }}.subunit': 'logs',
|
||||
'{{ stage_dir }}/{{ test_results_stage_name }}.html': 'logs' }
|
||||
'{{ stage_dir }}/{{ test_results_stage_name }}.html': 'logs',
|
||||
'{{ stage_dir }}/stackviz': 'logs' }
|
||||
extensions_to_txt:
|
||||
- conf
|
||||
- log
|
||||
|
22
roles/process-stackviz/README.rst
Normal file
22
roles/process-stackviz/README.rst
Normal file
@ -0,0 +1,22 @@
|
||||
Generate stackviz report.
|
||||
|
||||
Generate stackviz report using subunit and dstat data, using
|
||||
the stackviz archive embedded in test images.
|
||||
|
||||
**Role Variables**
|
||||
|
||||
.. zuul:rolevar:: devstack_base_dir
|
||||
:default: /opt/stack
|
||||
|
||||
The devstack base directory.
|
||||
|
||||
.. zuul:rolevar:: stage_dir
|
||||
:default: /opt/stack/logs
|
||||
|
||||
The stage directory where the input data can be found and
|
||||
the output will be produced.
|
||||
|
||||
.. zuul:rolevar:: test_results_stage_name
|
||||
:default: test_results
|
||||
|
||||
The name of the subunit file to be used as input.
|
3
roles/process-stackviz/defaults/main.yaml
Normal file
3
roles/process-stackviz/defaults/main.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
devstack_base_dir: /opt/stack
|
||||
stage_dir: /opt/stack/
|
||||
test_results_stage_name: test_results
|
63
roles/process-stackviz/tasks/main.yaml
Normal file
63
roles/process-stackviz/tasks/main.yaml
Normal file
@ -0,0 +1,63 @@
|
||||
- name: Check if stackviz archive exists
|
||||
stat:
|
||||
path: "/opt/cache/files/stackviz-latest.tar.gz"
|
||||
register: stackviz_archive
|
||||
|
||||
- debug:
|
||||
msg: "Stackviz archive could not be found in /opt/cache/files/stackviz-latest.tar.gz"
|
||||
when: not stackviz_archive.stat.exists
|
||||
|
||||
- name: Check if subunit data exists
|
||||
stat:
|
||||
path: "{{ stage_dir }}/{{ test_results_stage_name }}.subunit"
|
||||
register: subunit_input
|
||||
|
||||
- debug:
|
||||
msg: "Subunit file could not be found at {{ stage_dir }}/{{ test_results_stage_name }}.subunit"
|
||||
when: not subunit_input.stat.exists
|
||||
|
||||
- name: Install stackviz
|
||||
pip:
|
||||
name: "file://{{ stackviz_archive.stat.path }}"
|
||||
virtualenv: /tmp/stackviz
|
||||
extra_args: -U
|
||||
when:
|
||||
- stackviz_archive.stat.exists
|
||||
- subunit_input.stat.exists
|
||||
|
||||
- name: Deploy stackviz static html+js
|
||||
command: cp -pR /tmp/stackviz/share/stackviz-html {{ stage_dir }}/stackviz
|
||||
when:
|
||||
- stackviz_archive.stat.exists
|
||||
- subunit_input.stat.exists
|
||||
|
||||
- name: Check if dstat data exists
|
||||
stat:
|
||||
path: "{{ devstack_base_dir }}/logs/dstat-csv.log"
|
||||
register: dstat_input
|
||||
when:
|
||||
- stackviz_archive.stat.exists
|
||||
- subunit_input.stat.exists
|
||||
|
||||
- name: Run stackviz with dstat
|
||||
shell: |
|
||||
cat {{ subunit_input.stat.path }} | \
|
||||
/tmp/stackviz/bin/stackviz-export \
|
||||
--dstat "{{ devstack_base_dir }}/logs/dstat-csv.log" \
|
||||
--env --stdin \
|
||||
{{ stage_dir }}/stackviz/data
|
||||
when:
|
||||
- stackviz_archive.stat.exists
|
||||
- subunit_input.stat.exists
|
||||
- dstat_input.stat.exists
|
||||
|
||||
- name: Run stackviz without dstat
|
||||
shell: |
|
||||
cat {{ subunit_input.stat.path }} | \
|
||||
/tmp/stackviz/bin/stackviz-export \
|
||||
--env --stdin \
|
||||
{{ stage_dir }}/stackviz/data
|
||||
when:
|
||||
- stackviz_archive.stat.exists
|
||||
- subunit_input.stat.exists
|
||||
- not dstat_input.stat.exists
|
Loading…
Reference in New Issue
Block a user