diff --git a/tox.ini b/tox.ini index a892010886..bf55ae32ff 100644 --- a/tox.ini +++ b/tox.ini @@ -16,15 +16,18 @@ setenv = deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt - -[testenv:py27] whitelist_externals = bash commands = + # Try to detect whether a limited test suite is being specified and if so + # direct the testing to that suite's project; otherwise run the full suite + # in both horizon and openstack_dashboard "projects". 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}; \ + EXIT_STATUS=0; \ + {envpython} {toxinidir}/manage.py test horizon --settings=horizon.test.settings {posargs} || EXIT_STATUS=$?; \ + {envpython} {toxinidir}/manage.py test openstack_dashboard --settings=openstack_dashboard.test.settings --exclude-dir=openstack_dashboard/test/integration_tests {posargs} || EXIT_STATUS=$?; \ + exit $EXIT_STATUS; \ else \ {envpython} {toxinidir}/manage.py test {posargs} --settings=$project.test.settings --exclude-dir=openstack_dashboard/test/integration_tests; \ fi' @@ -41,16 +44,6 @@ basepython = python3.4 setenv = {[testenv]setenv} PYTHONUNBUFFERED=1 -whitelist_externals = - bash -commands = - 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 @@ -64,7 +57,6 @@ commands = {[testenv:extractmessages_check]commands} flake8 - [testenv:extractmessages] usedevelop = True setenv =