Switch to use stestr for unit test

According to Openstack summit session [1],
stestr is maintained project to which all Openstack projects should migrate.
So we should switch to stestr.

[1] https://etherpad.openstack.org/p/YVR-python-pti

Change-Id: I4cd261ce5cc4ac7a26fb644eb43c2848f2c26f8b
This commit is contained in:
Ha Manh Dong 2018-07-17 10:55:49 +07:00
parent 5f7c3f8018
commit 65fee4ceee
5 changed files with 12 additions and 8 deletions

5
.gitignore vendored
View File

@ -7,4 +7,7 @@ build
*.swp
*.swo
*.pyc
.testrepository
.stestr/
# Files generated by JetBrains
.idea/

3
.stestr.conf Normal file
View File

@ -0,0 +1,3 @@
[DEFAULT]
test_path=./tests
top_dir=./

View File

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

View File

@ -2,6 +2,6 @@ docutils!=0.13.1,>=0.11 # OSI-Approved Open Source, Public Domain
oslosphinx>=4.7.0 # Apache-2.0
pbr>=2.0.0,!=2.1.0 # Apache-2.0
sphinx>=1.6.2
testrepository>=0.0.18
stestr>=2.0.0 # Apache-2.0
testtools>=1.4.0 # MIT
yasfb>=0.5.1

View File

@ -8,13 +8,15 @@ skipsdist = True
[testenv]
basepython = python2.7
usedevelop = True
setenv = VIRTUAL_ENV={envdir}
setenv =
VIRTUAL_ENV={envdir}
install_command = pip install -U {opts} {packages}
deps = -r{toxinidir}/requirements.txt
whitelist_externals = find
commands =
find . -type f -name "*.py[c|o]" -delete
python setup.py testr --slowest --testr-args='{posargs}'
stestr run --no-subunit-trace {posargs}
stestr slowest
[testenv:venv]
commands = {posargs}