Comply with Python PTI

as described in
https://governance.openstack.org/tc/reference/pti/python.html
projects should use 'stestr' as unit tests runner.

This patch moves unit and coverage tests to use stestr as test runner
instead of nose.

Change-Id: I8508caa6ea08c5c98b67f34be7f61417df2d7c1e
This commit is contained in:
Pavlo Shchelokovskyy 2018-06-13 16:39:41 +00:00
parent 06f40b8beb
commit 32c5ad3b06
5 changed files with 18 additions and 18 deletions

1
.gitignore vendored
View File

@ -15,6 +15,7 @@ venv
.*.swp
.DS_Store
.testrepository
.stestr/*
versioninfo
var/*
ChangeLog

4
.stestr.conf Normal file
View File

@ -0,0 +1,4 @@
[DEFAULT]
test_path=${OS_TEST_PATH:-./tests/}
top_dir=./
group_regex=([^\.]+\.)+

View File

@ -33,9 +33,6 @@ msgpack-python==0.4.0
munch==2.1.0
netaddr==0.7.18
netifaces==0.10.4
nose==1.3.7
nose-exclude==0.3.0
openstack.nose-plugin==0.7
openstackdocstheme==1.18.1
openstacksdk==0.11.2
os-client-config==1.28.0
@ -62,7 +59,7 @@ pytz==2013.6
PyYAML==3.12
reno==2.5.0
requests==2.14.2
requests-mock==1.1.0
requests-mock==1.2.0
requestsexceptions==1.2.0
rfc3986==0.3.1
simplejson==3.5.1
@ -70,9 +67,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
termcolor==1.1.0
testrepository==0.0.18
testtools==2.2.0
traceback2==1.4.0
unittest2==1.1.0

View File

@ -7,13 +7,10 @@ hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0
# Unit testing
fixtures>=3.0.0 # Apache-2.0/BSD
mock>=2.0.0 # BSD
testrepository>=0.0.18 # Apache-2.0/BSD
testtools>=2.2.0 # MIT
# Test runner
nose>=1.3.7 # LGPL
nose-exclude>=0.3.0 # LGPL
openstack.nose-plugin>=0.7 # Apache-2.0
stestr>=1.0.0 # Apache-2.0
# Metrics and style
coverage!=4.4,>=4.0 # Apache-2.0

19
tox.ini
View File

@ -8,19 +8,15 @@ usedevelop = True
# Customize pip command, add -U to force updates.
install_command = pip install {opts} {packages}
setenv = VIRTUAL_ENV={envdir}
NOSE_WITH_OPENSTACK=1
NOSE_OPENSTACK_COLOR=1
NOSE_OPENSTACK_RED=0.05
NOSE_OPENSTACK_YELLOW=0.025
NOSE_OPENSTACK_SHOW_ELAPSED=1
NOSE_OPENSTACK_STDOUT=1
OS_STDOUT_CAPTURE=1
OS_STDERR_CAPTURE=1
OS_TEST_TIMEOUT=60
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 = find . -type f -name "*.pyc" -delete
nosetests {posargs}
stestr run {posargs}
whitelist_externals = find
[tox:jenkins]
@ -31,7 +27,12 @@ commands = flake8
[testenv:cover]
setenv = {[testenv]setenv}
NOSE_WITH_COVERAGE=1
PYTHON=coverage run --source zaqarclient --parallel-mode
commands =
stestr -q run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
[testenv:venv]
commands = {posargs}