Switch from testrepository to stestr
This commit replaces the call to testr with stestr, and updates the output files accordingly. This is necessary because tempest has moved away from testrepository [1], which is resulting in empty files being created. Lastly, we update the functional tests to ensure the subunit results files exist and are not empty. [1] https://review.openstack.org/#/c/504345/ Change-Id: I2496fccff1f51c586e999538232a4bcf0addbee5
This commit is contained in:
committed by
Jesse Pretorius (odyssey4me)
parent
c30a3f0e26
commit
f8404f5eeb
@@ -29,9 +29,14 @@
|
|||||||
|
|
||||||
always:
|
always:
|
||||||
- name: Generate raw subunit results
|
- name: Generate raw subunit results
|
||||||
|
# Despite not using testrepository, we leave the output filename as
|
||||||
|
# testrepository.subunit as the OpenStack Health dashboard relies on
|
||||||
|
# subunit files with this particular name.
|
||||||
|
# NOTE(mattt): At present we're not placing this file in a valid location
|
||||||
|
# to be used by the OpenStack Health dashboard.
|
||||||
shell: |
|
shell: |
|
||||||
. {{ tempest_venv_bin }}/activate
|
. {{ tempest_venv_bin }}/activate
|
||||||
testr last --subunit > {{ tempest_log_dir }}/testrepository.subunit
|
stestr last --subunit > {{ tempest_log_dir }}/testrepository.subunit
|
||||||
args:
|
args:
|
||||||
chdir: "{{ tempest_venv_bin | dirname }}/workspace"
|
chdir: "{{ tempest_venv_bin | dirname }}/workspace"
|
||||||
executable: /bin/bash
|
executable: /bin/bash
|
||||||
@@ -57,7 +62,7 @@
|
|||||||
- name: Generate html subunit results
|
- name: Generate html subunit results
|
||||||
shell: |
|
shell: |
|
||||||
. {{ tempest_venv_bin }}/activate
|
. {{ tempest_venv_bin }}/activate
|
||||||
subunit2html {{ tempest_log_dir }}/testrepository.subunit {{ tempest_log_dir }}/testr_results.html
|
subunit2html {{ tempest_log_dir }}/testrepository.subunit {{ tempest_log_dir }}/stestr_results.html
|
||||||
args:
|
args:
|
||||||
chdir: "{{ tempest_venv_bin | dirname }}/workspace"
|
chdir: "{{ tempest_venv_bin | dirname }}/workspace"
|
||||||
executable: /bin/bash
|
executable: /bin/bash
|
||||||
|
|||||||
@@ -31,19 +31,20 @@
|
|||||||
tags:
|
tags:
|
||||||
- skip_ansible_lint
|
- skip_ansible_lint
|
||||||
|
|
||||||
- name: List the contents of the tempest_result_path folder
|
- name: Stat the tempest subunit result files
|
||||||
find:
|
stat:
|
||||||
paths: "{{ tempest_log_dir }}"
|
path: "{{ tempest_log_dir }}/{{ item }}"
|
||||||
|
with_items:
|
||||||
|
- "stestr_results.html"
|
||||||
|
- "tempest_results.xml"
|
||||||
|
- "testrepository.subunit"
|
||||||
register: _results_list
|
register: _results_list
|
||||||
|
|
||||||
- name: Check whether the expected subunit result files are present
|
- name: Check whether the expected subunit result files are present
|
||||||
assert:
|
assert:
|
||||||
that: "item in _results_list.files | map(attribute='path') | map('basename') | list"
|
that: item.stat.exists and item.stat.size != 0
|
||||||
msg: "{{ item }} must be present in {{ tempest_log_dir }}"
|
msg: "{{ item.item }} must be present in {{ tempest_log_dir }} and not empty"
|
||||||
with_items:
|
with_items: "{{ _results_list.results }}"
|
||||||
- "testr_results.html"
|
|
||||||
- "tempest_results.xml"
|
|
||||||
- "testrepository.subunit"
|
|
||||||
|
|
||||||
vars_files:
|
vars_files:
|
||||||
- common/test-vars.yml
|
- common/test-vars.yml
|
||||||
|
|||||||
Reference in New Issue
Block a user