16eb6f1f3b
Some tox users, such as dib-utils "tox -e functional" tests, don't actually install a venv but just shell out to some commands. Unfortunately, I'm not sure how to tell the difference between intentionally missing logs like this, and what might be an unintentional failure. ignore_missing will allow this to run. Change-Id: Iaa85a8326e746604966a9c1bb4cc85f44e92299b
46 lines
1.2 KiB
YAML
46 lines
1.2 KiB
YAML
- name: Set tox log path for multiple nodes
|
|
set_fact:
|
|
log_path: "{{ zuul.executor.log_root }}/{{ inventory_hostname }}/tox"
|
|
when: groups['all'] | length > 1
|
|
|
|
- name: Set tox log path for single node
|
|
set_fact:
|
|
log_path: "{{ zuul.executor.log_root }}/tox"
|
|
when: log_path is not defined
|
|
|
|
- name: Ensure local tox dir
|
|
file:
|
|
path: "{{ log_path }}"
|
|
state: directory
|
|
delegate_to: localhost
|
|
|
|
- name: Set envlist fact
|
|
set_fact:
|
|
envlist: "{{ tox_envlist.split(',') }}"
|
|
when: tox_envlist is defined
|
|
|
|
- name: Find all environments
|
|
command: tox -l
|
|
args:
|
|
chdir: "{{ zuul_work_dir }}"
|
|
register: tox_environments
|
|
when: tox_envlist is not defined or tox_envlist == 'all'
|
|
|
|
- name: Set envlist fact
|
|
set_fact:
|
|
envlist: "{{ tox_environments.stdout_lines }}"
|
|
when: tox_envlist is not defined or tox_envlist == 'all'
|
|
|
|
- name: Collect tox logs
|
|
synchronize:
|
|
dest: "{{ log_path }}"
|
|
mode: pull
|
|
src: "{{ zuul_work_dir }}/.tox/{{ item }}/log/"
|
|
verify_host: true
|
|
rsync_opts:
|
|
- "--ignore-missing-args"
|
|
with_items: "{{ envlist }}"
|
|
# some tox runs may not create a virtualenv and thus have
|
|
# no ./tox/env directory
|
|
ignore_errors: yes
|