Fix junit error, add HTML report

Specifying the family stops a deprecation warning being output.

Add a HTML report and report it as an artifact as well; this is easier
to read.

Change-Id: I2bd6505c19cee2d51e9af27e9344cfe2e1110572
This commit is contained in:
Ian Wienand 2020-07-13 14:27:58 +10:00
parent 711b2493a9
commit ba45f251d1
4 changed files with 27 additions and 11 deletions

View File

@ -107,13 +107,23 @@
content: "{{ testinfra_extra_data | default('') | to_nice_yaml(indent=2) }}"
dest: '/home/zuul/testinfra_extra_data_fixture.yaml'
- name: Run testinfra to validate configuration
include_role:
name: tox
vars:
tox_envlist: testinfra
# This allows us to run from external projects (like testinfra
# itself)
tox_environment:
TESTINFRA_EXTRA_DATA: '/home/zuul/testinfra_extra_data_fixture.yaml'
zuul_work_dir: src/opendev.org/opendev/system-config
- name: Run and collect testinfra
block:
- name: Run testinfra to validate configuration
include_role:
name: tox
vars:
tox_envlist: testinfra
# This allows us to run from external projects (like testinfra
# itself)
tox_environment:
TESTINFRA_EXTRA_DATA: '/home/zuul/testinfra_extra_data_fixture.yaml'
zuul_work_dir: src/opendev.org/opendev/system-config
always:
- name: Return testinfra report artifact
zuul_return:
data:
zuul:
artifacts:
- name: testinfra results
url: "bridge.openstack.org/test-results.html"

View File

@ -12,6 +12,7 @@ mock
# testinfra 1.17.0 has a broken wheel that won't install under python3
# testinfra 3.0.0 switched the ansible backend, but broke ipv6 handling
testinfra!=1.17.0,!=3.0.0
pytest-html # MPL-2.0
# testinfra's ansible backend actually requires paramiko, but it's not
# specified. After
# https://github.com/philpep/testinfra/pull/454

View File

@ -36,7 +36,11 @@ commands = sphinx-build -W -E -b html doc/source doc/build/html
# This environment assumes a gate-hosts.yaml file has been written.
passenv =
TESTINFRA_EXTRA_DATA
commands = py.test --junit-xml junit.xml --connection=ansible --ansible-inventory=/home/zuul/src/opendev.org/opendev/system-config/inventory/base/gate-hosts.yaml -v testinfra {posargs}
commands = py.test \
--junit-xml junit.xml -o junit_family=xunit1 \
--html=test-results.html --self-contained-html \
--connection=ansible \
--ansible-inventory=/home/zuul/src/opendev.org/opendev/system-config/inventory/base/gate-hosts.yaml -v testinfra {posargs}
[flake8]
show-source = True

View File

@ -22,6 +22,7 @@
bridge.openstack.org:
host_copy_output:
'{{ zuul.project.src_dir }}/junit.xml': logs
'{{ zuul.project.src_dir }}/test-results.html': logs
'{{ zuul.project.src_dir }}/inventory/base/gate-hosts.yaml': logs
# Note: the following two jobs implement the variant-based multiple