From 58b291b5cf85ba69af6e1b72fa53006c2db622b3 Mon Sep 17 00:00:00 2001 From: Albin Vass Date: Fri, 22 May 2020 19:33:27 +0200 Subject: [PATCH] tox: envlist bugfixes Change-Id: I17e807aa544f6fb45e82604f35c027fe1f86c2f9 --- roles/fetch-tox-output/tasks/main.yaml | 8 ++++++++ roles/tox/tasks/main.yaml | 1 + 2 files changed, 9 insertions(+) diff --git a/roles/fetch-tox-output/tasks/main.yaml b/roles/fetch-tox-output/tasks/main.yaml index 1220380cb..6204fece5 100644 --- a/roles/fetch-tox-output/tasks/main.yaml +++ b/roles/fetch-tox-output/tasks/main.yaml @@ -24,9 +24,17 @@ set_fact: envlist: "{{ tox_envlist.split(',') }}" when: tox_envlist is defined and tox_envlist != 'ALL' and tox_envlist +# tox version <= 3.13.2 throws an exception if +# tox -l is run and envlist is not set so set +# failed_when: false for any version below that +- name: Get tox version + command: "{{ tox_executable }} --version" + register: tox_version_output - name: Find all default environments command: "{{ tox_executable }} -l" + failed_when: "{{ tox_default_environments is failed and tox_version_output.stdout | regex_search('\\d+\\.\\d+\\.\\d+') is version('3.13.2', '>') }}" + args: chdir: "{{ zuul_work_dir }}" register: tox_default_environments diff --git a/roles/tox/tasks/main.yaml b/roles/tox/tasks/main.yaml index 871c03765..4e92f108e 100644 --- a/roles/tox/tasks/main.yaml +++ b/roles/tox/tasks/main.yaml @@ -61,6 +61,7 @@ - name: Return file comments to Zuul when: - tox_inline_comments + - file_comments.file_comments is defined - file_comments.file_comments delegate_to: localhost zuul_return: