
Since tox_envlist has a default value it cannot be undefined so the fail task will never run. Instead handle the case when tox_envlist is an empty string by getting the default configured envlist from tox. Also handle the casewhen tox_envlist is 'ALL'. This also updates tox_install_sibling_packages to correctly handle multiple testenvs and uses configuration supplied by 'tox --showconfig -e <envlist>' instead of guessing where the envdir and logdir are located. We also cannot run tox inside python because it gets complicated to know which tox_executable we should call during the python test cases so run these commands in ansible and pass the output to tox_install_sibling_packages. Since role params have higher precedence than set_fact we set an internal _tox_envlist fact that is a comma separated list of testenvs that should be run. Change-Id: I9e5a1b041f653cbcff7b8ed62e4a95a0a040fdd7
46 lines
1.2 KiB
ReStructuredText
46 lines
1.2 KiB
ReStructuredText
Runs tox for a project
|
|
|
|
**Role Variables**
|
|
|
|
.. zuul:rolevar:: tox_environment
|
|
|
|
Environment variables to pass in to the tox run.
|
|
|
|
.. zuul:rolevar:: tox_envlist
|
|
:default: venv
|
|
|
|
Comma separated string with test environments tox should run.
|
|
``ALL`` runs all test environments while an empty string runs
|
|
all test environments configured with ``envlist`` in tox.
|
|
|
|
Internally this will always be expanded into a comma separated
|
|
list of test environments to run.
|
|
|
|
.. zuul:rolevar:: tox_executable
|
|
:default: tox
|
|
|
|
Location of the tox executable.
|
|
|
|
.. zuul:rolevar:: tox_extra_args
|
|
:default: -vv
|
|
|
|
String of extra command line options to pass to tox.
|
|
|
|
.. zuul:rolevar:: tox_constraints_file
|
|
|
|
Path to a pip constraints file. Will be provided to tox via
|
|
``TOX_CONSTRAINTS_FILE`` (deprecated but currently still supported
|
|
name is ``UPPER_CONSTRAINTS_FILE``) environment variable if it
|
|
exists.
|
|
|
|
.. zuul:rolevar:: tox_install_siblings
|
|
:default: true
|
|
|
|
Flag controlling whether to attempt to install python packages from any
|
|
other source code repos zuul has checked out. Defaults to True.
|
|
|
|
.. zuul:rolevar:: zuul_work_dir
|
|
:default: {{ zuul.project.src_dir }}
|
|
|
|
Directory to run tox in.
|