pass the fine input to subunit2junitxml

Since python-subunut 1.2, subunit2junitxml expects an input file in the
SubUnit format 2:

  Subunit’s bundled tools accept only version 2 and only emit version 2,
  but the new filters subunit-1to2 and subunit-2to1 can be used to
  interoperate with older third party libraries.

Without any prelimiar conversion, the result will just be an empty XML
file. RHEL ships python-subunit 1.0 so we cannot just unconditionally
use the format 2 input.

Change-Id: Iab98fca8815b38283fdde44605de296d77c46b4f
This commit is contained in:
Gonéri Le Bouder
2018-03-09 14:57:39 -05:00
parent f13fe3e774
commit 2d1d9d0aad

View File

@@ -15,12 +15,22 @@
| head -1) {{ working_dir }}/tempest/tempest.html \
2>&1 >> {{ tempest_log_file }}
- name: Generate XML results file
- name: Test the subunit version
shell: |
{% if tempest_format == 'venv' %}source {{ working_dir }}/tempest_git/.venv/bin/activate; {% endif %}
subunit2junitxml $(find {{ working_dir }}/tempest/{{ testr_dir }} -name [0-9] \
| head -1) --output-to {{ working_dir }}/tempest/tempest.xml \
2>&1 >> {{ tempest_log_file }}
python -c 'import subunit; import sys; exit(int(subunit.__version__[0] <= 1 and subunit.__version__[1] <= 1))'
register: need_subunit1to2
failed_when: False
- name: Generate XML results file
shell: >
{% if tempest_format == 'venv' %}source {{ working_dir }}/tempest_git/.venv/bin/activate; {% endif %}
subunit2junitxml
{% if need_subunit1to2.rc == 0 %}
{{ working_dir }}/tempest/testrepository.subunit
{% else %}
$(find {{ working_dir }}/tempest/{{ testr_dir }} -name [0-9] | head -1)
{% endif %} --output-to {{ working_dir }}/tempest/tempest.xml 2>&1 >> {{ tempest_log_file }}
- name: Fetch HTML results
fetch: