From e866bcee9da7e2c5e6967bd350bb2fa71c636ed5 Mon Sep 17 00:00:00 2001 From: Ha Manh Dong Date: Fri, 20 Jul 2018 13:58:43 +0700 Subject: [PATCH] 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: I1f8211fd9e3a5327f8c78e548c06b06ac94eb555 --- .gitignore | 2 +- .stestr.conf | 3 +++ .testr.conf | 7 ------- test-requirements.txt | 2 +- tox.ini | 11 +++++++++-- 5 files changed, 14 insertions(+), 11 deletions(-) create mode 100644 .stestr.conf delete mode 100644 .testr.conf diff --git a/.gitignore b/.gitignore index 6ecee48d..01851ecd 100644 --- a/.gitignore +++ b/.gitignore @@ -46,7 +46,7 @@ tests/functional/.ipynb_checkpoints/ .coverage .tox nosetests.xml -.testrepository +.stestr/ .venv # Translations diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 00000000..c2b698dc --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,3 @@ +[DEFAULT] +test_path=./tests/unit +top_dir=. diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index 0ac16d87..00000000 --- a/.testr.conf +++ /dev/null @@ -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_TOP_LEVEL:-./} ${OS_TEST_PATH:-./tests/unit} $LISTOPT $IDOPTION -test_id_option=--load-list $IDFILE -test_list_option=--list diff --git a/test-requirements.txt b/test-requirements.txt index d53520c3..b663b22d 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -11,7 +11,7 @@ python-subunit>=0.0.18 sphinx>=1.6.2 # BSD openstackdocstheme>=1.11.0 # Apache-2.0 oslotest>=1.2.0 # Apache-2.0 -testrepository>=0.0.18 +stestr>=2.0.0 # Apache-2.0 testscenarios>=0.4 testtools>=0.9.36,!=1.2.0 python-swiftclient>=3.1.0 diff --git a/tox.ini b/tox.ini index 44186c67..0b82e139 100644 --- a/tox.ini +++ b/tox.ini @@ -17,7 +17,7 @@ deps = commands = find . -type f -name "*.py[c|o]" -delete find . -type d -name "__pycache__" -delete - python setup.py testr --slowest --testr-args='--concurrency 1 {posargs:tests.unit}' + stestr run --slowest --concurrency 1 {posargs:tests.unit} whitelist_externals = bash find @@ -58,7 +58,14 @@ commands = {posargs} [testenv:cover] basepython = python3 -commands = python setup.py testr --coverage --testr-args='{posargs}' +setenv = + {[testenv]setenv} + PYTHON=coverage run --source storlets --parallel-mode +commands = + stestr run {posargs} + coverage combine + coverage html -d cover + coverage xml -o cover/coverage.xml [testenv:docs] basepython = python2.7