zuul-jobs/roles/tox/tasks/siblings.yaml
Albin Vass e0b27f7e59 tox: empty envlist should behave like tox -e ALL
Also we can parse the output from --showconfig to se which
testenvs we should act upon when installing siblings.

Change-Id: I438035c92d62102c80db9bed81e9f290e4c941b2
2020-05-22 20:40:45 +02:00

40 lines
1.2 KiB
YAML

# Install sibling with tox so we can replace them later
- name: Run tox without tests
command: >-
{{ tox_executable }}
--notest
{% if tox_envlist is defined and tox_envlist %}
-e{{ tox_envlist }}
{% endif %}
args:
chdir: "{{ zuul_work_dir }}"
environment: "{{ tox_environment|combine(tox_constraints_env|default({})) }}"
# This is needed since python < 3.2 can't parse ini files from strings
- name: Create a tempfile to save tox showconfig
tempfile:
register: _tox_show_config_tempfile
- name: Get tox envlist config
shell: >-
{{ tox_executable }}
--showconfig
{% if tox_envlist is defined and tox_envlist %}
-e{{ tox_envlist }}
{% endif %}
> {{ _tox_show_config_tempfile.path }}
args:
chdir: "{{ zuul_work_dir }}"
- name: Install any sibling python packages
tox_install_sibling_packages:
tox_show_config: "{{ _tox_show_config_tempfile.path }}"
tox_constraints_file: "{{ tox_constraints_file | default(omit) }}"
project_dir: "{{ zuul_work_dir }}"
projects: "{{ zuul.projects.values() | selectattr('required') | list }}"
- name: Remove tempfile
file:
state: absent
path: "{{ _tox_show_config_tempfile.path }}"