Generate junit.xml file for testinfra

And collect it on post, it is helpful to see the results.

Change-Id: I0dbecf57bf9182168eb6f99cdf88329fcdeb1bdc
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2018-08-28 13:09:53 -04:00
parent 9958b253f3
commit 20286235b6
3 changed files with 16 additions and 1 deletions

View File

@ -146,6 +146,7 @@
ansible_python_interpreter: python2
pre-run: playbooks/zuul/run-base-pre.yaml
run: playbooks/zuul/run-base.yaml
post-run: playbooks/zuul/run-base-post.yaml
files:
- .zuul.yaml
- playbooks/.*

View File

@ -0,0 +1,14 @@
- hosts: bridge.openstack.org
tasks:
- name: Register junit.xml file
stat:
path: "{{ zuul.project.src_dir }}/junit.xml"
register: _junit
- name: Collect testinfra logs
synchronize:
dest: "{{ zuul.executor.log_root }}"
mode: pull
src: "{{ zuul.project.src_dir }}/junit.xml"
verify_host: true
when: _junit.stat.exists|bool

View File

@ -32,7 +32,7 @@ deps = -r{toxinidir}/doc/requirements.txt
commands = sphinx-build -W -E -b html doc/source doc/build/html
[testenv:testinfra]
commands = py.test -n 5 --connection=ansible --ansible-inventory=/etc/ansible/hosts/inventory.yaml --hosts=all -v {posargs}
commands = py.test -n 5 --junit-xml junit.xml --connection=ansible --ansible-inventory=/etc/ansible/hosts/inventory.yaml --hosts=all -v {posargs}
[flake8]
show-source = True