Flip ensure-tox to tox v4 by default

The previous change added a bunch of tox v4 compatiblity, now we switch
to as our default. This should only happen after people have had
sufficient time to add tox v4 compatibility or manually pin back to <4
in their projects.

Change-Id: I16742fb933dba2162a73d532e1a9613af69021aa
This commit is contained in:
Clark Boylan 2022-12-07 14:34:51 -08:00
parent 66a8e51945
commit 13925d1965
5 changed files with 18 additions and 8 deletions

View File

@ -6,13 +6,12 @@ virtual environment for the current user.
**Role Variables** **Role Variables**
.. zuul:rolevar:: ensure_tox_version .. zuul:rolevar:: ensure_tox_version
:default: '<4' :default: ''
Version specifier to select the version of tox. For example if your Version specifier to select the version of tox. For example if your
project is not compatible with tox v4 you can set this value to project is not compatible with tox v4 you can set this value to
`<4` to install the latest v3 release. We have started this value `<4` to install the latest v3 release. The default is '' which
at `<4` for maximum compatibility, but expect it to change to '' installs latest.
in the future when tox v4 is better understood.
.. zuul:rolevar:: tox_prefer_python2 .. zuul:rolevar:: tox_prefer_python2
:default: False :default: False

View File

@ -1,5 +1,5 @@
tox_executable: tox tox_executable: tox
ensure_tox_version: '<4' ensure_tox_version: ''
tox_venv_path: '{{ ansible_user_dir }}/.local/tox' tox_venv_path: '{{ ansible_user_dir }}/.local/tox'
tox_prefer_python2: false tox_prefer_python2: false
ensure_global_symlinks: false ensure_global_symlinks: false

View File

@ -56,14 +56,14 @@
post_tasks: post_tasks:
- name: Check for artifact on the test instance - name: Check for artifact on the test instance
stat: stat:
path: "{{ ansible_user_dir }}/zuul-output/logs/tox/venv/venv-0.log" path: "{{ ansible_user_dir }}/zuul-output/logs/tox/venv/1-install_package.log"
register: _test_artifact register: _test_artifact
failed_when: not _test_artifact.stat.exists failed_when: not _test_artifact.stat.exists
when: zuul_use_fetch_output when: zuul_use_fetch_output
- name: Check for artifact on the executor - name: Check for artifact on the executor
stat: stat:
path: "{{ zuul.executor.log_root }}/tox/venv/venv-0.log" path: "{{ zuul.executor.log_root }}/tox/venv/1-install_package.log"
delegate_to: localhost delegate_to: localhost
register: _executor_artifact register: _executor_artifact
failed_when: not _executor_artifact.stat.exists failed_when: not _executor_artifact.stat.exists

View File

@ -76,12 +76,22 @@
register: ALL_status register: ALL_status
failed_when: ALL_status is changed failed_when: ALL_status is changed
- name: Move test-playbooks/python/tox.ini to test-playbooks/python/foo.ini
# Tox 4 appears to have trouble when there is a tox.ini in the current
# dir and you run it with -c pointing at another file. Work around this
# to test the use of -c by moving the tox.ini to another location
# and -c'ing against that in the next task.
command: mv tox.ini foo.ini
args:
chdir: "{{ zuul.project.src_dir }}/test-playbooks/python/"
- name: Run tox against a specific config file - name: Run tox against a specific config file
include_role: include_role:
name: tox name: tox
vars: vars:
zuul_work_dir: "{{ zuul.project.src_dir }}/test-playbooks/python/"
# Make sure the tox_config_file option works # Make sure the tox_config_file option works
tox_config_file: test-playbooks/python tox_config_file: foo.ini
tox_envlist: 'foo' tox_envlist: 'foo'
# Make sure we test with verbose output even if the default changes # Make sure we test with verbose output even if the default changes
tox_extra_args: '-vv' tox_extra_args: '-vv'

View File

@ -350,6 +350,7 @@
description: Test the tox role's sibling functionality description: Test the tox role's sibling functionality
files: files:
- roles/tox/.* - roles/tox/.*
- roles/ensure-tox/.*
- tox.ini - tox.ini
- test-playbooks/python/tox.yaml - test-playbooks/python/tox.yaml
- test-playbooks/python/tox.ini - test-playbooks/python/tox.ini