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: