diff --git a/.zuul.yaml b/.zuul.yaml index 47ad8dd226..1c1d74b08b 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -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/.* diff --git a/playbooks/zuul/run-base-post.yaml b/playbooks/zuul/run-base-post.yaml new file mode 100644 index 0000000000..2e89d46582 --- /dev/null +++ b/playbooks/zuul/run-base-post.yaml @@ -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 diff --git a/tox.ini b/tox.ini index 1dcdd09b79..bfbfe6773c 100644 --- a/tox.ini +++ b/tox.ini @@ -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