diff --git a/roles/fetch-tox-output/tasks/main.yaml b/roles/fetch-tox-output/tasks/main.yaml index c6540cd16..93dc96662 100644 --- a/roles/fetch-tox-output/tasks/main.yaml +++ b/roles/fetch-tox-output/tasks/main.yaml @@ -25,17 +25,24 @@ envlist: "{{ tox_envlist.split(',') }}" when: tox_envlist is defined -- name: Find all environments - command: tox -l +- name: Find all default environments + command: "{{ tox_executable }} -l" args: chdir: "{{ zuul_work_dir }}" register: tox_environments - when: tox_envlist is not defined or tox_envlist|lower == 'all' + when: tox_envlist is not defined + +- name: Find all default environments + command: "{{ tox_executable }} -a" + args: + chdir: "{{ zuul_work_dir }}" + register: tox_environments + when: tox_envlist == 'ALL' - name: Set envlist fact set_fact: envlist: "{{ tox_environments.stdout_lines }}" - when: tox_envlist is not defined or tox_envlist|lower == 'all' + when: tox_envlist is not defined or tox_envlist == 'ALL' - name: Copy tox logs copy: diff --git a/test-playbooks/python/fetch-tox-output.yaml b/test-playbooks/python/fetch-tox-output.yaml index 9812fb185..4e10f5a97 100644 --- a/test-playbooks/python/fetch-tox-output.yaml +++ b/test-playbooks/python/fetch-tox-output.yaml @@ -35,6 +35,8 @@ tasks: - import_role: name: fetch-tox-output + vars: + tox_envlist: "ALL" - block: - name: Undo the log_path fact set by fetch-javascript-output diff --git a/test-playbooks/tox/reinstall-tox.yaml b/test-playbooks/tox/reinstall-tox.yaml new file mode 100644 index 000000000..039125424 --- /dev/null +++ b/test-playbooks/tox/reinstall-tox.yaml @@ -0,0 +1,17 @@ +- hosts: all + name: Remove any pre-installed tox + tasks: + - name: Remove tox package with pip + shell: pip uninstall -y tox + become: true + failed_when: false + - name: Remove tox package with pip3 + shell: pip3 uninstall -y tox + become: true + failed_when: false + - name: Verify tox is not installed + command: "tox --version" + register: result + failed_when: result.rc == 0 + roles: + - ensure-tox diff --git a/zuul-tests.d/python-jobs.yaml b/zuul-tests.d/python-jobs.yaml index 5cf7ee7ae..21a118229 100644 --- a/zuul-tests.d/python-jobs.yaml +++ b/zuul-tests.d/python-jobs.yaml @@ -250,6 +250,10 @@ - roles/ensure-output-dirs/.* - roles/fetch-tox-output/.* - roles/fetch-output/.* + - roles/ensure-tox/.* + - test-playbooks/python/fetch-tox-output.yaml + - test-playbooks/tox/reinstall-tox.yaml + pre-run: test-playbooks/tox/reinstall-tox.yaml run: test-playbooks/python/fetch-tox-output.yaml vars: zuul_use_fetch_output: true