31a470245b
Update the alternate tox.ini files in test-playbooks/python to trigger configuration we saw expose a bug in the siblings lib's showconfig parser when a tox.requires value resulted in pip activity. Update its minversion to the earliest tox which provides the tox.requires configuration option, for clarity. While we're there, switch to using tox_config_file instead of overriding zuul_work_dir since that's now an option for this role and was previously not exercised in the test job. Change-Id: I521580da978903cd116c872447b1c028c470e63d
88 lines
2.6 KiB
YAML
88 lines
2.6 KiB
YAML
- hosts: all
|
|
roles:
|
|
- ensure-tox
|
|
tasks:
|
|
- name: Run bindep
|
|
include_role:
|
|
name: bindep
|
|
- name: Run tox with constraints
|
|
include_role:
|
|
name: tox
|
|
vars:
|
|
tox_envlist: docs
|
|
tox_constraints_file: '{{ zuul.project.src_dir }}/zuul-tests.d/test-constraints.txt'
|
|
# Make sure we test with verbose output even if the default changes
|
|
tox_extra_args: '-vv'
|
|
|
|
- name: Run tox with multiple testenvs
|
|
include_role:
|
|
name: tox
|
|
vars:
|
|
tox_envlist: docs,linters
|
|
tox_environment:
|
|
ANSIBLE_ROLES_PATH: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}/roles"
|
|
# Make sure we test with verbose output even if the default changes
|
|
tox_extra_args: '-vv'
|
|
|
|
- name: Create tempfile to verify testenvs ran
|
|
tempfile:
|
|
register: default_tempfile
|
|
|
|
- block:
|
|
- name: Run tox with empty envlist
|
|
include_role:
|
|
name: tox
|
|
vars:
|
|
zuul_work_dir: "{{ zuul.project.src_dir }}/test-playbooks/python/"
|
|
tox_extra_args: "{{ default_tempfile.path }}"
|
|
tox_install_siblings: false
|
|
tox_envlist: ''
|
|
|
|
- name: Make sure magic lines are present
|
|
lineinfile:
|
|
path: "{{ default_tempfile.path }}"
|
|
line: linters
|
|
check_mode: true
|
|
register: default_status
|
|
failed_when: default_status is changed
|
|
always:
|
|
- name: Remove tempfile
|
|
file:
|
|
state: absent
|
|
path: "{{ default_tempfile.path }}"
|
|
|
|
- block:
|
|
- name: Create tempfile to verify testenvs ran
|
|
tempfile:
|
|
register: ALL_tempfile
|
|
|
|
- name: Run tox with ALL
|
|
include_role:
|
|
name: tox
|
|
vars:
|
|
zuul_work_dir: "{{ zuul.project.src_dir }}/test-playbooks/python/"
|
|
tox_install_siblings: false
|
|
tox_extra_args: "{{ ALL_tempfile.path }}"
|
|
tox_envlist: 'ALL'
|
|
always:
|
|
- name: Make sure magic lines are present
|
|
loop:
|
|
- linters
|
|
- non-default
|
|
lineinfile:
|
|
path: "{{ ALL_tempfile.path }}"
|
|
line: "{{ item }}"
|
|
check_mode: true
|
|
register: ALL_status
|
|
failed_when: ALL_status is changed
|
|
|
|
- name: Run tox with tox_envlist = %s
|
|
include_role:
|
|
name: tox
|
|
vars:
|
|
# Make sure the tox_config_file option works
|
|
tox_config_file: test-playbooks/python
|
|
tox_envlist: '%s'
|
|
# Make sure we test with verbose output even if the default changes
|
|
tox_extra_args: '-vv'
|