tox: Rename extra to custom

This commit is contained in:
Till Maas 2019-11-27 19:08:03 +01:00
parent 213bd36bf3
commit 6cf9124ce2
4 changed files with 48 additions and 46 deletions

53
tox.ini
View file

@ -3,7 +3,7 @@
envlist =
black, pylint, flake8,
py{26,27,36,37,38},
extra
custom
skipsdist = true
skip_missing_interpreters = true
@ -17,6 +17,7 @@ deps =
py26: pytest
[base]
system_python = /usr/bin/python3
passenv = *
setenv =
PYTHONPATH = {toxinidir}/library:{toxinidir}/module_utils
@ -24,6 +25,8 @@ setenv =
changedir = {toxinidir}/tests
covtarget = {toxinidir}/library --cov {toxinidir}/module_utils
pytesttarget = .
whitelist_externals =
bash
[testenv:py26]
envdir = {toxworkdir}/env-{env:TRAVIS_PYTHON_VERSION:2.6}
@ -197,39 +200,15 @@ commands =
{[testenv:molecule_syntax]commands}
{[testenv:molecule_test]commands}
# Here we provide a way how a role can add its custom command to be run. Such
# extra command is run at the end of each testenv run and is driven by
# environment variables. Involved environment variables are:
#
# LSR_TEXTRA_DEPS
# - contains dependency needed by commands to run smoothly; if more than
# one dependency is needed, use external file together with '-r' option
# (see PEP 508)
#
# LSR_TEXTRA_DIR
# - directory to which to cd
#
# LSR_TEXTRA_CMD
# - custom command to be run
#
# Example: `network` system role need to run `./tests/ensure_non_running_provider.py`
# to check for the existence of `*_provider.yml` playbooks. The script
# is run in Python 3.6.
#
# To make this possible, we add to `.travis/config.sh` a snippet:
#
# export LSR_TEXTRA_DEPS='PyYAML'
# export LSR_TEXTRA_DIR='tests'
# export LSR_TEXTRA_CMD='./ensure_non_running_provider.py'
#
[testenv:extra]
envdir = {toxworkdir}/env-{env:TRAVIS_PYTHON_VERSION:extra}
[testenv:custom]
envdir = {toxworkdir}/env-{env:TRAVIS_PYTHON_VERSION:custom}
deps =
{env:LSR_TEXTRA_DEPS:}
-rcustom_requirements.txt
passenv = *
changedir = {toxinidir}/{env:LSR_TEXTRA_DIR:.}
whitelist_externals =
{[base]whitelist_externals}
commands =
{env:LSR_TEXTRA_CMD:python --version}
bash {toxinidir}/.travis/custom.sh {envpython} {[base]system_python}
[pytest]
addopts = -rxs
@ -248,9 +227,9 @@ max-line-length = 88
[travis]
python =
2.6: py26,extra
2.7: py27,flake8,pylint,extra
3.5: coveralls,molecule,extra
3.6: py36,black,extra
3.7: py37,extra
3.8: py38,extra
2.6: py26,custom
2.7: py27,flake8,pylint,custom
3.5: coveralls,molecule,custom
3.6: py36,black,custom
3.7: py37,custom
3.8: py38,custom