From 30bc5d67ff96d960114245cfa785097e937e7835 Mon Sep 17 00:00:00 2001 From: Albin Vass Date: Wed, 20 May 2020 09:09:08 +0200 Subject: [PATCH] Do not interpolate values from tox --showconfig Change-Id: I8ffa7d164e0afd2a325bc5b4d76d4dc75d330739 --- roles/tox/library/tox_install_sibling_packages.py | 2 +- test-playbooks/python/tox.ini | 3 +++ test-playbooks/python/tox.yaml | 13 +++++++------ 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/roles/tox/library/tox_install_sibling_packages.py b/roles/tox/library/tox_install_sibling_packages.py index 0f89d29f2..4257939a9 100644 --- a/roles/tox/library/tox_install_sibling_packages.py +++ b/roles/tox/library/tox_install_sibling_packages.py @@ -272,7 +272,7 @@ def main(): tox_envlist = module.params.get('tox_envlist', '') tox_show_config = module.params.get('tox_show_config') - tox_config = configparser.ConfigParser() + tox_config = configparser.RawConfigParser() tox_config.read(tox_show_config) envlist = {testenv.strip() for testenv diff --git a/test-playbooks/python/tox.ini b/test-playbooks/python/tox.ini index ac5f72869..8d08fa140 100644 --- a/test-playbooks/python/tox.ini +++ b/test-playbooks/python/tox.ini @@ -10,3 +10,6 @@ commands = sh -c "echo linters >> {posargs}" [testenv:non-default] commands = sh -c "echo non-default >> {posargs}" + +[testenv:%s] +commands = sh -c "echo working" diff --git a/test-playbooks/python/tox.yaml b/test-playbooks/python/tox.yaml index 0658db446..b794c71db 100644 --- a/test-playbooks/python/tox.yaml +++ b/test-playbooks/python/tox.yaml @@ -32,9 +32,6 @@ tox_extra_args: "{{ default_tempfile.path }}" tox_install_siblings: false tox_envlist: '' - tox_environment: - ANSIBLE_ROLES_PATH: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}/roles" - ANSIBLE_LIBRARY: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}/tests/fake-ansible" - name: Make sure magic lines are present lineinfile: @@ -62,9 +59,6 @@ tox_install_siblings: false tox_extra_args: "{{ ALL_tempfile.path }}" tox_envlist: 'ALL' - tox_environment: - ANSIBLE_ROLES_PATH: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}/roles" - ANSIBLE_LIBRARY: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}/tests/fake-ansible" always: - name: Make sure magic lines are present loop: @@ -76,3 +70,10 @@ check_mode: true register: ALL_status failed_when: ALL_status is changed + + - name: Run tox with tox_envlist = %s + include_role: + name: tox + vars: + zuul_work_dir: "{{ zuul.project.src_dir }}/test-playbooks/python/" + tox_envlist: '%s'