Merge "Remove process-test-results"
This commit is contained in:
commit
1d50e386cf
@ -1,35 +0,0 @@
|
|||||||
Process test results
|
|
||||||
|
|
||||||
Take a testr / stestr repo as input. Produce subunit from the latest
|
|
||||||
run and the html report using subunit2html.
|
|
||||||
|
|
||||||
**Role Variables**
|
|
||||||
|
|
||||||
.. zuul:rolevar:: test_results_dir
|
|
||||||
:default: None
|
|
||||||
|
|
||||||
The folder where the [s]testr repo lives.
|
|
||||||
|
|
||||||
.. zuul:rolevar:: tox_envdir
|
|
||||||
:default: venv
|
|
||||||
|
|
||||||
The name of the virtual environemnt created by tox to run tests.
|
|
||||||
This may be different from the name of the tox environment.
|
|
||||||
|
|
||||||
.. zuul:rolevar:: stage_dir
|
|
||||||
:default: {{ ansible_user_dir }}
|
|
||||||
|
|
||||||
Folder into which the output files will be written. Assumption is that
|
|
||||||
the user that runs this role has read access to test results and write
|
|
||||||
access to tempest_work_dir.
|
|
||||||
|
|
||||||
.. zuul:rolevar:: subunit2html
|
|
||||||
:default: /usr/os-testr-env/bin/subunit2html
|
|
||||||
|
|
||||||
The full path to subunit2html. This utility is part of os-testr,
|
|
||||||
and it's usually baked into test images, hence the default value.
|
|
||||||
|
|
||||||
.. zuul:rolevar:: test_results_stage_name
|
|
||||||
:default: test_results
|
|
||||||
|
|
||||||
The name of the subunit and html files generated.
|
|
@ -1,4 +0,0 @@
|
|||||||
tox_envdir: venv
|
|
||||||
stage_dir: "{{ ansible_user_dir }}"
|
|
||||||
subunit2html: /usr/os-testr-env/bin/subunit2html
|
|
||||||
test_results_stage_name: test_results
|
|
@ -1,49 +0,0 @@
|
|||||||
# NOTE(andreaf) There could be more than one repo in the test folder.
|
|
||||||
# Since that's unlikely we don't provide a variable to select the
|
|
||||||
# test runner and we pick the first hit.
|
|
||||||
- name: Discover stestr repo
|
|
||||||
stat:
|
|
||||||
path: "{{ test_results_dir }}/.stestr"
|
|
||||||
register: stestr_repo
|
|
||||||
|
|
||||||
- name: Discover testr repo
|
|
||||||
stat:
|
|
||||||
path: "{{ test_results_dir }}/.testrepository"
|
|
||||||
register: testr_repo
|
|
||||||
when: not stestr_repo.stat.exists
|
|
||||||
|
|
||||||
- name: Use stestr test runner
|
|
||||||
set_fact:
|
|
||||||
test_runner: ".tox/{{ tox_envdir }}/bin/stestr"
|
|
||||||
when: stestr_repo.stat.exists
|
|
||||||
|
|
||||||
- name: Use legacy testr test runner
|
|
||||||
set_fact:
|
|
||||||
test_runner: ".tox/{{ tox_envdir }}/bin/testr"
|
|
||||||
when: not stestr_repo.stat.exists and testr_repo.stat.exists
|
|
||||||
|
|
||||||
- name: Check if the venv has been created
|
|
||||||
stat:
|
|
||||||
path: "{{ test_results_dir }}/.tox/{{ tox_envdir }}"
|
|
||||||
register: run_venv
|
|
||||||
|
|
||||||
- name: Make sure test results are world readable
|
|
||||||
file:
|
|
||||||
path: "{{ test_results_dir }}"
|
|
||||||
mode: "a+rX"
|
|
||||||
recurse: true
|
|
||||||
become: true
|
|
||||||
|
|
||||||
- name: Create a subunit file from the last run
|
|
||||||
shell: "{{ test_runner }} last --subunit > {{ stage_dir }}/{{ test_results_stage_name }}.subunit"
|
|
||||||
args:
|
|
||||||
chdir: "{{ test_results_dir }}"
|
|
||||||
when: run_venv.stat.exists and test_runner is defined
|
|
||||||
register: subunit_report
|
|
||||||
|
|
||||||
- name: Generate the html report for the last run
|
|
||||||
command: "{{ subunit2html }} ./{{ test_results_stage_name}}.subunit {{ test_results_stage_name }}.html"
|
|
||||||
args:
|
|
||||||
chdir: "{{ stage_dir }}"
|
|
||||||
when: run_venv.stat.exists and test_runner is defined
|
|
||||||
register: html_report
|
|
Loading…
Reference in New Issue
Block a user