Merge "Flip ensure-tox to tox v4 by default"

This commit is contained in:
Zuul 2022-12-23 00:09:49 +00:00 committed by Gerrit Code Review
commit 880bcb34ff
5 changed files with 18 additions and 8 deletions

View File

@ -6,13 +6,12 @@ virtual environment for the current user.
**Role Variables**
.. zuul:rolevar:: ensure_tox_version
:default: '<4'
:default: ''
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
`<4` to install the latest v3 release. We have started this value
at `<4` for maximum compatibility, but expect it to change to ''
in the future when tox v4 is better understood.
`<4` to install the latest v3 release. The default is '' which
installs latest.
.. zuul:rolevar:: tox_prefer_python2
:default: False

View File

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

View File

@ -56,14 +56,14 @@
post_tasks:
- name: Check for artifact on the test instance
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
failed_when: not _test_artifact.stat.exists
when: zuul_use_fetch_output
- name: Check for artifact on the executor
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
register: _executor_artifact
failed_when: not _executor_artifact.stat.exists

View File

@ -76,12 +76,22 @@
register: ALL_status
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
include_role:
name: tox
vars:
zuul_work_dir: "{{ zuul.project.src_dir }}/test-playbooks/python/"
# Make sure the tox_config_file option works
tox_config_file: test-playbooks/python
tox_config_file: foo.ini
tox_envlist: 'foo'
# Make sure we test with verbose output even if the default changes
tox_extra_args: '-vv'

View File

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