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:
Matt Thompson 2018-03-22 23:44:39 -04:00 committed by Jesse Pretorius (odyssey4me)
parent c30a3f0e26
commit f8404f5eeb
2 changed files with 17 additions and 11 deletions

View File

@ -29,9 +29,14 @@
always:
- 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: |
. {{ tempest_venv_bin }}/activate
testr last --subunit > {{ tempest_log_dir }}/testrepository.subunit
stestr last --subunit > {{ tempest_log_dir }}/testrepository.subunit
args:
chdir: "{{ tempest_venv_bin | dirname }}/workspace"
executable: /bin/bash
@ -57,7 +62,7 @@
- name: Generate html subunit results
shell: |
. {{ 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:
chdir: "{{ tempest_venv_bin | dirname }}/workspace"
executable: /bin/bash

View File

@ -31,19 +31,20 @@
tags:
- skip_ansible_lint
- name: List the contents of the tempest_result_path folder
find:
paths: "{{ tempest_log_dir }}"
- name: Stat the tempest subunit result files
stat:
path: "{{ tempest_log_dir }}/{{ item }}"
with_items:
- "stestr_results.html"
- "tempest_results.xml"
- "testrepository.subunit"
register: _results_list
- name: Check whether the expected subunit result files are present
assert:
that: "item in _results_list.files | map(attribute='path') | map('basename') | list"
msg: "{{ item }} must be present in {{ tempest_log_dir }}"
with_items:
- "testr_results.html"
- "tempest_results.xml"
- "testrepository.subunit"
that: item.stat.exists and item.stat.size != 0
msg: "{{ item.item }} must be present in {{ tempest_log_dir }} and not empty"
with_items: "{{ _results_list.results }}"
vars_files:
- common/test-vars.yml