Fix error detection in horizon test suite

Also, simplify tox environment by reducing repeated definition of the same
test command across all of the "test suite" environments.

Change-Id: Icbe7558b973dcd1ef50c85cdefc02e165b5bdc7c
Closes-Bug: 1620430
This commit is contained in:
Richard Jones 2016-09-06 11:20:44 +10:00
parent b26a988fd9
commit 63ddedf69d
1 changed files with 7 additions and 15 deletions

22
tox.ini
View File

@ -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 =