Switch to use stestr for unit tests directly

This commit switches to use stestr command to run unit tests directly.
Recently, the latest ostestr command uses stestr instead of testr.
However, we should use stestr directly because it's simple and
straight forward. There is no reason to use ostestr for unit tests
anymore.

Modeled after Iff4abef50178bdc83b868eed4a906e22d790762b

Change-Id: Ie50cd57e87bc049c29b86fce67cc1a2061dad690
This commit is contained in:
Felipe Monteiro 2017-12-01 02:09:08 +00:00
parent 09a18338ca
commit 5fa20f7e63
4 changed files with 6 additions and 10 deletions

2
.gitignore vendored
View File

@ -59,4 +59,4 @@ ChangeLog
releasenotes/build
# Misc
.stestr/
.stestr

3
.stestr.conf Normal file
View File

@ -0,0 +1,3 @@
[DEFAULT]
test_path=./patrole_tempest_plugin/tests/unit
group_regex=([^\.]*\.)*

View File

@ -1,7 +0,0 @@
[DEFAULT]
test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-60} \
${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./patrole_tempest_plugin/tests/unit} $LISTOPT $IDOPTION
test_id_option=--load-list $IDFILE
test_list_option=--list

View File

@ -12,13 +12,13 @@ setenv =
LANGUAGE=en_US
LC_ALL=en_US.utf-8
PYTHONWARNINGS=default::DeprecationWarning
passenv = OS_STDOUT_CAPTURE OS_STDERR_CAPTURE OS_TEST_TIMEOUT OS_TEST_LOCK_PATH OS_TEST_PATH http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
passenv = OS_STDOUT_CAPTURE OS_STDERR_CAPTURE OS_TEST_TIMEOUT OS_TEST_LOCK_PATH http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
whitelist_externals = find
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands =
find . -type f -name "*.pyc" -delete
ostestr {posargs}
stestr --test-path ./patrole_tempest_plugin/tests/unit run {posargs}
[testenv:pep8]
commands = flake8 {posargs}