Merge "Generate junit.xml file for testinfra"

This commit is contained in:
Zuul 2018-08-30 17:58:39 +00:00 committed by Gerrit Code Review
commit 768df606b0
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