From eaa81ffdfc89ac983007cfe6b1bb94296f87647c Mon Sep 17 00:00:00 2001 From: Vu Cong Tuan Date: Tue, 10 Jul 2018 17:17:00 +0700 Subject: [PATCH] Switch to stestr According to Openstack summit session [1], stestr is maintained project to which all Openstack projects should migrate. Let's switch to stestr as other projects have already moved to it. [1] https://etherpad.openstack.org/p/YVR-python-pti Change-Id: Ieca57f7c2e6b2ff5c95f8643985ad760c71e0fc3 --- .gitignore | 3 +-- .stestr.conf | 4 ++++ .testr.conf | 4 ---- lower-constraints.txt | 2 +- test-requirements.txt | 2 +- tox.ini | 10 ++++++++-- 6 files changed, 15 insertions(+), 10 deletions(-) create mode 100644 .stestr.conf delete mode 100644 .testr.conf diff --git a/.gitignore b/.gitignore index 1c31b32..49b9a5f 100644 --- a/.gitignore +++ b/.gitignore @@ -13,7 +13,6 @@ coverage.xml cover/* covhtml pep8.txt -nosetests.xml doc/build .DS_Store doc/source/api @@ -24,5 +23,5 @@ build/ dist/ .project .pydevproject -.testrepository/ +.stestr/ *.db diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 0000000..cd90df0 --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,4 @@ +[DEFAULT] +test_path=./ldappool/tests +top_dir=./ + diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index 07b4075..0000000 --- a/.testr.conf +++ /dev/null @@ -1,4 +0,0 @@ -[DEFAULT] -test_command=${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./ldappool/tests} $LISTOPT $IDOPTION -test_id_option=--load-list $IDFILE -test_list_option=--list \ No newline at end of file diff --git a/lower-constraints.txt b/lower-constraints.txt index 30657f0..8e56cc3 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -28,7 +28,7 @@ six==1.10.0 snowballstemmer==1.2.1 Sphinx==1.6.2 sphinxcontrib-websupport==1.0.1 -testrepository==0.0.18 +stestr==2.0.0 testresources==2.0.0 testtools==2.2.0 traceback2==1.4.0 diff --git a/test-requirements.txt b/test-requirements.txt index a4ab1fd..90c65df 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -10,6 +10,6 @@ coverage!=4.4,>=4.0 # Apache-2.0 fixtures>=3.0.0 # Apache-2.0/BSD sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD openstackdocstheme>=1.18.1 # Apache-2.0 -testrepository>=0.0.18 # Apache-2.0/BSD +stestr>=2.0.0 # Apache-2.0 testresources>=2.0.0 # Apache-2.0/BSD testtools>=2.2.0 # MIT diff --git a/tox.ini b/tox.ini index 916708f..c73ea49 100644 --- a/tox.ini +++ b/tox.ini @@ -15,7 +15,7 @@ deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands = find . -type f -name "*.pyc" -delete - python setup.py testr --slowest --testr-args='{posargs}' + stestr run --slowest {posargs} whitelist_externals = find [testenv:pep8] @@ -26,7 +26,13 @@ commands = commands = {posargs} [testenv:cover] -commands = python setup.py testr --coverage --testr-args='{posargs}' +setenv = + PYTHON=coverage run --source ldappool --parallel-mode +commands = + stestr run '{posargs}' + coverage combine + coverage html -d cover + coverage xml -o cover/coverage.xml [flake8] # D100: Missing docstring in public module