test: Allow to run a specific test

Previously heat-dashboard unit/integration tests always run
the whole set of tests and there is no way to run a specific test.
{posargs} mechanism of tox would help us.

Change-Id: Ia37a2586a9207180c5f3ed85141b2916468f18b8
This commit is contained in:
Akihiro Motoki 2022-02-16 19:47:59 +09:00
parent 458e9b0519
commit 1fd73b753e

View File

@ -19,7 +19,7 @@ deps = -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/up
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands =
python manage.py test heat_dashboard.test --settings=heat_dashboard.test.settings --exclude-tag integration
python manage.py test {posargs:heat_dashboard.test} --settings=heat_dashboard.test.settings --exclude-tag integration
[testenv:integration]
# Run integration tests only
@ -29,7 +29,7 @@ setenv =
INTEGRATION_TESTS=1
SELENIUM_HEADLESS=1
HORIZON_INTEGRATION_TESTS_CONFIG_FILE=heat_dashboard/test/integration/horizon.conf
commands = python manage.py test heat_dashboard.test.integration --settings=heat_dashboard.test.settings --tag integration
commands = python manage.py test {posargs:heat_dashboard.test.integration} --settings=heat_dashboard.test.settings --tag integration
[testenv:pep8]
commands = flake8 {posargs}
@ -40,7 +40,7 @@ commands = {posargs}
[testenv:cover]
commands =
coverage erase
coverage run --source=heat_dashboard {toxinidir}/manage.py test heat_dashboard.test.tests --settings=heat_dashboard.test.settings {posargs}
coverage run --source=heat_dashboard {toxinidir}/manage.py test {posargs:heat_dashboard.test.tests} --settings=heat_dashboard.test.settings
coverage xml
coverage html