Browse Source

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: Iee13deb54056e1c81d3732cb51a61c68481607fa
changes/26/583126/4
Ha Manh Dong 3 years ago
parent
commit
42379399a2
  1. 2
      .gitignore
  2. 3
      .stestr.conf
  3. 4
      .testr.conf
  4. 2
      test-requirements.txt
  5. 11
      tox.ini

2
.gitignore

@ -8,7 +8,7 @@ build
cover
htmlcov
.secret_key_store
.testrepository
.stestr/
.venv
dist
*.egg

3
.stestr.conf

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

4
.testr.conf

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

2
test-requirements.txt

@ -9,7 +9,7 @@ python-subunit>=0.0.18
sphinx>=1.6.2 # BSD
openstackdocstheme>=1.11.0 # Apache-2.0
oslotest>=1.10.0 # Apache-2.0
testrepository>=0.0.18
stestr>=2.0.0 # Apache-2.0
testscenarios>=0.4
testtools>=1.4.0
reno>=1.8.0 # Apache2

11
tox.ini

@ -10,7 +10,7 @@ setenv =
VIRTUAL_ENV={envdir}
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands = python setup.py testr --slowest --testr-args='{posargs}'
commands = stestr run --slowest {posargs}
[testenv:pep8]
commands = flake8
@ -19,7 +19,14 @@ commands = flake8
commands = {posargs}
[testenv:cover]
commands = python setup.py testr --coverage --testr-args='{posargs}'
setenv =
{[testenv]setenv}
PYTHON=coverage run --source cloudkittydashboard --parallel-mode
commands =
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
[testenv:docs]
commands = python setup.py build_sphinx

Loading…
Cancel
Save