Merge "Enable tox to run the subset test cases."

This commit is contained in:
Jenkins 2016-07-21 13:52:45 +00:00 committed by Gerrit Code Review
commit d3ad1040b2

29
tox.ini
View File

@ -1,5 +1,5 @@
[tox]
envlist = pep8,py27{-horizon,-openstack_dashboard,dj18},py34,releasenotes
envlist = pep8,py27dj18,py27,py34,releasenotes
minversion = 1.6
skipsdist = True
@ -16,14 +16,18 @@ setenv =
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands =
horizon: {envpython} {toxinidir}/manage.py test horizon --settings=horizon.test.settings {posargs}
openstack_dashboard: {envpython} {toxinidir}/manage.py test openstack_dashboard --settings=openstack_dashboard.test.settings --exclude-dir=openstack_dashboard/test/integration_tests {posargs}
[testenv:py27]
whitelist_externals =
bash
commands =
{envpython} {toxinidir}/manage.py test horizon --settings=horizon.test.settings {posargs}
{envpython} {toxinidir}/manage.py test openstack_dashboard --settings=openstack_dashboard.test.settings --exclude-dir=openstack_dashboard/test/integration_tests {posargs}
bash -c 'project=`echo {posargs} | cut -d. -f1`; \
if [ -z "$project" ]; then \
{envpython} {toxinidir}/manage.py test horizon --settings=horizon.test.settings {posargs}; \
{envpython} {toxinidir}/manage.py test openstack_dashboard --settings=openstack_dashboard.test.settings --exclude-dir=openstack_dashboard/test/integration_tests {posargs}; \
else \
{envpython} {toxinidir}/manage.py test {posargs} --settings=$project.test.settings --exclude-dir=openstack_dashboard/test/integration_tests; \
fi'
# Django-1.8 is LTS
[testenv:py27dj18]
@ -37,11 +41,16 @@ basepython = python3.4
setenv =
{[testenv]setenv}
PYTHONUNBUFFERED=1
whitelist_externals =
bash
commands =
{envpython} {toxinidir}/manage.py test --settings=horizon.test.settings horizon.test.tests {posargs}
{envpython} {toxinidir}/manage.py test --settings=openstack_dashboard.test.settings \
--exclude-dir=openstack_dashboard/test/integration_tests \
openstack_dashboard {posargs}
bash -c 'project=`echo {posargs} | cut -d. -f1`; \
if [ -z "$project" ]; then \
{envpython} {toxinidir}/manage.py test horizon --settings=horizon.test.settings {posargs}; \
{envpython} {toxinidir}/manage.py test openstack_dashboard --settings=openstack_dashboard.test.settings --exclude-dir=openstack_dashboard/test/integration_tests {posargs}; \
else \
{envpython} {toxinidir}/manage.py test {posargs} --settings=$project.test.settings --exclude-dir=openstack_dashboard/test/integration_tests; \
fi'
[testenv:pep8]
usedevelop = True