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: I9a52c912ef5ad19fe24e9294f573a2770436d5e3
This commit is contained in:
Vu Cong Tuan 2018-07-12 16:08:44 +07:00
parent 2d15d91bbb
commit a90ede0d6c
8 changed files with 20 additions and 22 deletions

2
.gitignore vendored
View File

@ -29,7 +29,7 @@ develop-eggs/
doc/source/api
#Testing framework
.testrepository
.stestr/
.coverage
*,cover
cover

4
.stestr.conf Normal file
View File

@ -0,0 +1,4 @@
[DEFAULT]
test_path=${OS_TEST_PATH:-./muranoclient/tests/unit}
top_dir=./

View File

@ -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_TEST_PATH:-./muranoclient/tests/unit} $LISTOPT $IDOPTION
test_id_option=--load-list $IDFILE
test_list_option=--list

View File

@ -85,10 +85,9 @@ six==1.10.0
snowballstemmer==1.2.1
Sphinx==1.6.5
sphinxcontrib-websupport==1.0.1
stestr==1.0.0
stevedore==1.20.0
tempest==17.1.0
testrepository==0.0.18
stestr==2.0.0
testscenarios==0.4
testtools==2.2.0
traceback2==1.4.0

View File

@ -8,7 +8,7 @@ fixtures>=3.0.0 # Apache-2.0/BSD
mock>=2.0.0 # BSD
requests-mock>=1.1.0 # Apache-2.0
tempest>=17.1.0 # Apache-2.0
testrepository>=0.0.18 # Apache-2.0/BSD
stestr>=2.0.0 # Apache-2.0
testscenarios>=0.4 # Apache-2.0/BSD
testtools>=2.2.0 # MIT
oslotest>=3.2.0 # Apache-2.0

View File

@ -28,7 +28,11 @@ uncommitted=$(git status --porcelain | grep -v "^??")
git checkout HEAD^
baseline_report=$(mktemp -t muranoclient_coverageXXXXXXX)
find . -type f -name "*.pyc" -delete && python setup.py testr --coverage --testr-args="$*"
find . -type f -name "*.pyc" -delete
stestr run '{posargs}'
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage report > $baseline_report
baseline_missing=$(awk 'END { print $3 }' $baseline_report)
@ -38,7 +42,11 @@ git checkout -
# Generate and save coverage report
current_report=$(mktemp -t muranoclient_coverageXXXXXXX)
find . -type f -name "*.pyc" -delete && python setup.py testr --coverage --testr-args="$*"
find . -type f -name "*.pyc" -delete
stestr run '{posargs}'
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage report > $current_report
current_missing=$(awk 'END { print $3 }' $current_report)
@ -76,4 +84,4 @@ else
fi
rm $baseline_report $current_report
exit $exit_code
exit $exit_code

View File

@ -1,6 +0,0 @@
#!/usr/bin/env bash
set -o pipefail
TESTRARGS=$1
python setup.py testr --slowest --testr-args="--subunit $TESTRARGS" | subunit-trace -f

View File

@ -14,7 +14,7 @@ deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands = bash tools/pretty_tox.sh '{posargs}'
commands = stestr run {posargs}
[testenv:pep8]
basepython = python3
@ -35,7 +35,7 @@ passenv = OS_* MURANO_PACKAGES_SERVICE
[testenv:uitests]
basepython = python3
commands = python setup.py testr --slowest --testr-args="--concurrency 1 {posargs}"
commands = stestr run --slowest --concurrency 1 {posargs}
[testenv:cover]
basepython = python3