Use zuul tox job for running tox

Change-Id: Iff6f173fa7370947f739d0ccb9e94925fc7ee07a
This commit is contained in:
Federico Ressi 2020-04-02 08:27:11 +02:00
parent 0d9e88a6fe
commit 9c5a6ec413

View File

@ -3,53 +3,22 @@
- hosts: all
vars:
zuul_output_dir: '{{ ansible_user_dir }}/zuul-output'
zuul_work_dir: '{{ zuul.project.src_dir }}'
test_collect_dir: '{{ zuul_output_dir }}/logs'
roles:
- tobiko-common
- tobiko-ensure-bindep
- tobiko-ensure-tox
tasks:
- debug: var=unversioned_python_info
- debug: var=python_info
- block:
- name: "get missing binary dependencies"
command:
cmd: >
{{ bindep_executable | quote }} -b -f bindep.txt
chdir: '{{ zuul_work_dir }}'
register: get_missing_deps
rescue:
- name: "install missing dependencies"
become: yes
package:
name: '{{ get_missing_deps.stdout_lines }}'
- role: tobiko-ensure-python
- name: "run Tox InfraRed plugin"
command:
cmd: >
{{ tox_executable | quote }} -e infrared --
--collect-dir {{ test_collect_dir | quote }}
chdir: '{{ zuul_work_dir }}'
environment:
PYTHON: '{{ unversioned_python_executable }}'
ANSIBLE_PYTHON_INTERPRETER: '{{ unversioned_python_executable }}'
ignore_errors: yes
register: run_tox
- name: "show Tox output"
debug: var=run_tox.stdout_lines
- name: "show Tox errors"
debug: var=run_tox.stderr_lines
when: run_tox is failed
failed_when: yes
role: tox
vars:
tox_envlist: infrared
tox_extra_args:
'-- --collect-dir {{ test_collect_dir | quote }}'
tox_environment:
PYTHON: '{{ unversioned_python_executable }}'
ANSIBLE_PYTHON_INTERPRETER: '{{ unversioned_python_executable }}'
tasks:
- name: "list collected files"
command: >
ls '{{ test_collect_dir }}'