Support single test

Support to run single test, e.g.
tox -epy27 -- -n senlin.tests.unit.profiles.test_nova_server
Change-Id: I1bc36a624b7cfced3aba721bfeeb780c3b5e3214
This commit is contained in:
lvdongbing 2015-11-24 02:03:39 -05:00
parent eb3da2de8f
commit 846f8175dd
2 changed files with 7 additions and 3 deletions

View File

@ -1,6 +1,6 @@
[DEFAULT]
test_command=
PYTHON=$(echo ${PYTHON:-python} | sed 's/--source senlin//g')
${PYTHON} -m subunit.run discover -s . $LISTOPT $IDOPTION
${PYTHON} -m subunit.run discover ${OS_TEST_PATH:-./senlin/tests} -t . $LISTOPT $IDOPTION
test_id_option=--load-list $IDFILE
test_list_option=--list

View File

@ -9,6 +9,7 @@ skipsdist = True
# random hash seed successfully.
setenv = VIRTUAL_ENV={envdir}
PYTHONHASHSEED=0
OS_TEST_PATH=senlin/tests/unit
deps = -r{toxinidir}/test-requirements.txt
@ -16,16 +17,19 @@ usedevelop = True
install_command = pip install {opts} {packages}
commands =
find . -type f -name "*.pyc" -delete
ostestr --slowest --regex '^((?!tests\.functional).)+$' {posargs}
ostestr --slowest {posargs}
whitelist_externals = bash
find
[testenv:functional]
setenv = VIRTUAL_ENV={envdir}
PYTHONHASHSEED=0
OS_TEST_PATH=senlin/tests/functional
passenv = OS_USERNAME OS_PASSWORD OS_TENANT_NAME OS_USER_DOMAIN_NAME OS_PROJECT_DOMAIN_NAME OS_REGION_NAME OS_AUTH_URL
commands =
find . -type f -name "*.pyc" -delete
ostestr --slowest --concurrency 1 --regex '^(.*?tests\.functional)' {posargs}
ostestr --slowest --concurrency 1 {posargs}
[testenv:pep8]
commands =