Add -constraints for CI jobs
This adds the constraints factor to the base section and duplicates the sections required for CI with -constraints as tox does not currently support factors in sections. Work towards enabling factor support in sections is currently stalled, as such we will need to duplicate sections adding -constraints to facilitate running sections with the constrained install_command. Implements Blueprint: Requirements-Management Change-Id: I7afd52517750b82dcac94b8aae68dc0e94d00e54
This commit is contained in:
33
tox.ini
33
tox.ini
@@ -9,7 +9,9 @@ envlist = py27,pep8
|
|||||||
setenv = VIRTUAL_ENV={envdir}
|
setenv = VIRTUAL_ENV={envdir}
|
||||||
PYTHONHASHSEED=0
|
PYTHONHASHSEED=0
|
||||||
usedevelop = True
|
usedevelop = True
|
||||||
install_command = pip install {opts} {packages}
|
install_command =
|
||||||
|
constraints: {[testenv:common-constraints]install_command}
|
||||||
|
pip install {opts} {packages}
|
||||||
|
|
||||||
deps = -r{toxinidir}/requirements.txt
|
deps = -r{toxinidir}/requirements.txt
|
||||||
-r{toxinidir}/test-requirements.txt
|
-r{toxinidir}/test-requirements.txt
|
||||||
@@ -26,10 +28,17 @@ passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
|
|||||||
[tox:jenkins]
|
[tox:jenkins]
|
||||||
downloadcache = ~/cache/pip
|
downloadcache = ~/cache/pip
|
||||||
|
|
||||||
|
[testenv:common-constraints]
|
||||||
|
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
|
||||||
|
|
||||||
[testenv:py34]
|
[testenv:py34]
|
||||||
commands =
|
commands =
|
||||||
ostestr --whitelist_file=tests-py3.txt
|
ostestr --whitelist_file=tests-py3.txt
|
||||||
|
|
||||||
|
[testenv:py34-constraints]
|
||||||
|
install_command = {[testenv:common-constraints]install_command}
|
||||||
|
commands = {[testenv:py34]commands}
|
||||||
|
|
||||||
[testenv:pep8]
|
[testenv:pep8]
|
||||||
commands =
|
commands =
|
||||||
flake8 {posargs} . cinder/common
|
flake8 {posargs} . cinder/common
|
||||||
@@ -38,6 +47,15 @@ commands =
|
|||||||
{toxinidir}/tools/config/check_uptodate.sh
|
{toxinidir}/tools/config/check_uptodate.sh
|
||||||
{toxinidir}/tools/check_exec.py {toxinidir}/cinder
|
{toxinidir}/tools/check_exec.py {toxinidir}/cinder
|
||||||
|
|
||||||
|
[testenv:pep8-constraints]
|
||||||
|
install_command = {[testenv:common-constraints]install_command}
|
||||||
|
commands =
|
||||||
|
flake8 {posargs} . cinder/common
|
||||||
|
# Check that .po and .pot files are valid:
|
||||||
|
bash -c "find cinder -type f -regex '.*\.pot?' -print0|xargs -0 -n 1 msgfmt --check-format -o /dev/null"
|
||||||
|
{toxinidir}/tools/config/check_uptodate.sh
|
||||||
|
{toxinidir}/tools/check_exec.py {toxinidir}/cinder
|
||||||
|
|
||||||
[testenv:fast8]
|
[testenv:fast8]
|
||||||
# Use same environment directory as pep8 env to save space and install time
|
# Use same environment directory as pep8 env to save space and install time
|
||||||
envdir = {toxworkdir}/pep8
|
envdir = {toxworkdir}/pep8
|
||||||
@@ -49,6 +67,11 @@ deps = -r{toxinidir}/requirements.txt
|
|||||||
pylint==0.26.0
|
pylint==0.26.0
|
||||||
commands = bash tools/lintstack.sh
|
commands = bash tools/lintstack.sh
|
||||||
|
|
||||||
|
[testenv:pylint-constraints]
|
||||||
|
install_command = {[testenv:common-constraints]install_command}
|
||||||
|
deps = {[testenv:pylint]deps}
|
||||||
|
commands = {[testenv:pylint]commands}
|
||||||
|
|
||||||
[testenv:cover]
|
[testenv:cover]
|
||||||
# Also do not run test_coverage_ext tests while gathering coverage as those
|
# Also do not run test_coverage_ext tests while gathering coverage as those
|
||||||
# tests conflict with coverage.
|
# tests conflict with coverage.
|
||||||
@@ -56,6 +79,10 @@ commands =
|
|||||||
python setup.py testr --coverage \
|
python setup.py testr --coverage \
|
||||||
--testr-args='^(?!.*test.*coverage).*$'
|
--testr-args='^(?!.*test.*coverage).*$'
|
||||||
|
|
||||||
|
[testenv:cover-constraints]
|
||||||
|
install_command = {[testenv:common-constraints]install_command}
|
||||||
|
commands = {[testenv:cover]commands}
|
||||||
|
|
||||||
[testenv:genconfig]
|
[testenv:genconfig]
|
||||||
sitepackages = False
|
sitepackages = False
|
||||||
envdir = {toxworkdir}/venv
|
envdir = {toxworkdir}/venv
|
||||||
@@ -64,6 +91,10 @@ commands = {toxinidir}/tools/config/generate_sample.sh from_tox
|
|||||||
[testenv:venv]
|
[testenv:venv]
|
||||||
commands = {posargs}
|
commands = {posargs}
|
||||||
|
|
||||||
|
[testenv:venv-constraints]
|
||||||
|
install_command = {[testenv:common-constraints]install_command}
|
||||||
|
commands = {posargs}
|
||||||
|
|
||||||
[testenv:docs]
|
[testenv:docs]
|
||||||
commands = python setup.py build_sphinx
|
commands = python setup.py build_sphinx
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user