Migrate to stestr
With the latests changes to os-testr[0] it now expects a .stestr.conf file instead of a .testr.conf file. This change migrates the testing suite from using testr to use stestr instead. [0] http://lists.openstack.org/pipermail/openstack-dev/2017-September/122135.html Change-Id: Ie0de862f2192491fa7752af03c8c03b3ee36337a
This commit is contained in:
parent
30eb190995
commit
71e543152e
2
.gitignore
vendored
2
.gitignore
vendored
@ -30,7 +30,7 @@ keystone/tests/tmp/
|
|||||||
.project
|
.project
|
||||||
.pydevproject
|
.pydevproject
|
||||||
keystone/locale/*/LC_MESSAGES/*.mo
|
keystone/locale/*/LC_MESSAGES/*.mo
|
||||||
.testrepository/
|
.stestr/
|
||||||
*.db
|
*.db
|
||||||
# Files created by releasenotes build
|
# Files created by releasenotes build
|
||||||
releasenotes/build
|
releasenotes/build
|
||||||
|
4
.stestr.conf
Normal file
4
.stestr.conf
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
[DEFAULT]
|
||||||
|
test_path=${OS_TEST_PATH:-./keystone/tests/unit}
|
||||||
|
top_dir=./
|
||||||
|
group_regex=.*(test_cert_setup)
|
16
.testr.conf
16
.testr.conf
@ -1,16 +0,0 @@
|
|||||||
[DEFAULT]
|
|
||||||
test_command=
|
|
||||||
${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./keystone/tests/unit} $LISTOPT $IDOPTION
|
|
||||||
|
|
||||||
test_id_option=--load-list $IDFILE
|
|
||||||
test_list_option=--list
|
|
||||||
group_regex=.*(test_cert_setup)
|
|
||||||
|
|
||||||
|
|
||||||
# NOTE(morganfainberg): If single-worker mode is wanted (e.g. for live tests)
|
|
||||||
# the environment variable ``TEST_RUN_CONCURRENCY`` should be set to ``1``. If
|
|
||||||
# a non-default (1 worker per available core) concurrency is desired, set
|
|
||||||
# environment variable ``TEST_RUN_CONCURRENCY`` to the desired number of
|
|
||||||
# workers.
|
|
||||||
test_run_concurrency=echo ${TEST_RUN_CONCURRENCY:-0}
|
|
||||||
|
|
@ -56,3 +56,12 @@ callable we prefer that the call also uses keyword arg syntax. For example::
|
|||||||
|
|
||||||
This gives us the flexibility to re-order arguments and more importantly
|
This gives us the flexibility to re-order arguments and more importantly
|
||||||
to add new required arguments. It's also more explicit and easier to read.
|
to add new required arguments. It's also more explicit and easier to read.
|
||||||
|
|
||||||
|
Testing
|
||||||
|
-------
|
||||||
|
|
||||||
|
keystone uses testtools and stestr for its unittest suite and its test
|
||||||
|
runner. If you'd like to learn more in depth:
|
||||||
|
|
||||||
|
https://testtools.readthedocs.io/en/latest/
|
||||||
|
https://stestr.readthedocs.io/en/latest/
|
||||||
|
@ -28,8 +28,7 @@ os-api-ref>=1.0.0 # Apache-2.0
|
|||||||
# test wsgi apps without starting an http server
|
# test wsgi apps without starting an http server
|
||||||
WebTest>=2.0 # MIT
|
WebTest>=2.0 # MIT
|
||||||
|
|
||||||
python-subunit>=0.0.18 # Apache-2.0/BSD
|
stestr>=1.0.0 # Apache-2.0
|
||||||
testrepository>=0.0.18 # Apache-2.0/BSD
|
|
||||||
testtools>=1.4.0 # MIT
|
testtools>=1.4.0 # MIT
|
||||||
|
|
||||||
# For documentation
|
# For documentation
|
||||||
|
8
tox.ini
8
tox.ini
@ -45,9 +45,15 @@ commands = bandit -r keystone -x tests
|
|||||||
[testenv:cover]
|
[testenv:cover]
|
||||||
# Also do not run test_coverage_ext tests while gathering coverage as those
|
# Also do not run test_coverage_ext tests while gathering coverage as those
|
||||||
# tests conflict with coverage.
|
# tests conflict with coverage.
|
||||||
|
setenv =
|
||||||
|
{[testenv]setenv}
|
||||||
|
PYTHON=coverage run --source keystone --parallel-mode
|
||||||
commands =
|
commands =
|
||||||
find keystone -type f -name "*.pyc" -delete
|
find keystone -type f -name "*.pyc" -delete
|
||||||
python setup.py testr --coverage --testr-args='{posargs}'
|
stestr run {posargs}
|
||||||
|
coverage combine
|
||||||
|
coverage html -d cover
|
||||||
|
coverage xml -o cover/coverage.xml
|
||||||
|
|
||||||
[testenv:patch_cover]
|
[testenv:patch_cover]
|
||||||
commands =
|
commands =
|
||||||
|
Loading…
Reference in New Issue
Block a user