From 86a89fc21a55477e3f1ed053ef0c7b51888b5c5f Mon Sep 17 00:00:00 2001 From: Vu Cong Tuan Date: Thu, 5 Jul 2018 09:36:37 +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: I2ee7c8a4f5cd91e77ddeccc84354dedf6e7e9196 --- .gitignore | 2 +- .stestr.conf | 3 +++ .testr.conf | 4 ---- test-requirements.txt | 2 +- tox.ini | 10 ++++++++-- 5 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 .stestr.conf delete mode 100644 .testr.conf diff --git a/.gitignore b/.gitignore index 2682e2a6a..c823c249c 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,6 @@ doc/source/api/ *.egg .autogenerated .coverage -.testrepository/ +.stestr/ .tox/ .idea diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 000000000..3dbded523 --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,3 @@ +[DEFAULT] +test_path=./stackalytics/tests +top_dir=./ diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index 6f96a86e9..000000000 --- a/.testr.conf +++ /dev/null @@ -1,4 +0,0 @@ -[DEFAULT] -test_command=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 ${PYTHON:-python} -m subunit.run discover -t ./ ./stackalytics/tests $LISTOPT $IDOPTION -test_id_option=--load-list $IDFILE -test_list_option=--list diff --git a/test-requirements.txt b/test-requirements.txt index 0a075aac5..5e215068a 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -10,5 +10,5 @@ mock>=2.0 # BSD python-subunit>=0.0.18 # Apache-2.0/BSD sphinx>=1.5.1 # BSD sphinxcontrib-httpdomain # BSD -testrepository>=0.0.18 # Apache-2.0/BSD +stestr>=2.0.0 # Apache-2.0 testtools>=1.4.0 # MIT diff --git a/tox.ini b/tox.ini index ac2880b2e..95cbd8e4c 100644 --- a/tox.ini +++ b/tox.ini @@ -9,7 +9,7 @@ install_command = pip install -U {opts} {packages} setenv = VIRTUAL_ENV={envdir} deps = -r{toxinidir}/test-requirements.txt -commands = python setup.py test --slowest --testr-args='{posargs}' +commands = stestr run --slowest {posargs} [testenv:pep8] commands = flake8 @@ -18,7 +18,13 @@ commands = flake8 commands = {posargs} [testenv:cover] -commands = python setup.py testr --coverage --testr-args='{posargs}' +setenv = + PYTHON=coverage run --source $project --parallel-mode +commands = + stestr run '{posargs}' + coverage combine + coverage html -d cover + coverage xml -o cover/coverage.xml [testenv:genconfig] commands =