Skip to content

Commit 02a9395

Browse files
committed
Migrate from testr to stest and adjust Python supported versions
1 parent ce55113 commit 02a9395

File tree

5 files changed

+57
-15
lines changed

5 files changed

+57
-15
lines changed

.stestr.conf

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[DEFAULT]
2+
test_path=./deepaas/tests/
3+
top_dir=./

.testr.conf

-7
This file was deleted.

setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ classifier =
1717
Programming Language :: Python :: 2
1818
Programming Language :: Python :: 2.7
1919
Programming Language :: Python :: 3
20-
Programming Language :: Python :: 3.4
20+
Programming Language :: Python :: 3.5
2121
Programming Language :: Python :: 3.6
2222

2323
[files]

test-requirements.txt

+5-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@ hacking<0.10,>=0.9.2
55

66
bandit>=1.1.0 # Apache-2.0
77

8-
coverage>=3.6
8+
# Remove once we rely on coverage 4.3+
9+
#
10+
# https://bitbucket.org/ned/coveragepy/issues/519/
11+
coverage!=4.4,>=4.0 # Apache-2.0
912

1013
fixtures>=1.3.1
1114
python-subunit>=0.0.18
12-
testrepository>=0.0.18
15+
stestr>=1.0.0 # Apache-2.0
1316
testtools>=1.4.0
1417

1518
mock>=1.2

tox.ini

+48-5
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,68 @@
11
[tox]
22
minversion = 1.6
3-
envlist = py36,py34,py27,pep8
3+
envlist = py{35,36,27},pep8
44
skipsdist = True
55

66
[testenv]
77
usedevelop = True
8+
basepython = python3
9+
whitelist_externals =
10+
find
811
install_command = pip install -U {opts} {packages}
912
setenv =
1013
VIRTUAL_ENV={envdir}
14+
LC_ALL=en_US.utf-8
15+
OS_STDOUT_CAPTURE=1
16+
OS_STDERR_CAPTURE=1
17+
OS_TEST_TIMEOUT=160
1118
deps = -r{toxinidir}/requirements.txt
1219
-r{toxinidir}/test-requirements.txt
13-
commands = python setup.py testr --slowest --testr-args='{posargs}'
20+
commands =
21+
find . -type f -name "*.pyc" -delete
1422

1523
[testenv:venv]
1624
commands = {posargs}
1725

1826
[testenv:cover]
19-
commands = python setup.py testr --coverage --testr-args='{posargs}'
27+
# TODO(stephenfin): Remove the PYTHON hack below in favour of a [coverage]
28+
# section once we rely on coverage 4.3+
29+
#
30+
# https://bitbucket.org/ned/coveragepy/issues/519/
31+
envdir = {toxworkdir}/shared
32+
setenv =
33+
{[testenv]setenv}
34+
PYTHON=coverage run --source deepaas --parallel-mode
35+
commands =
36+
{[testenv]commands}
37+
coverage erase
38+
stestr run {posargs}
39+
coverage combine
40+
coverage html -d cover
41+
coverage xml -o cover/coverage.xml
42+
coverage report
43+
44+
[testenv:py27]
45+
# TODO(efried): Remove this once https://github.com/tox-dev/tox/issues/425 is fixed.
46+
basepython = python2.7
47+
commands =
48+
{[testenv]commands}
49+
stestr run {posargs}
50+
51+
[testenv:py35]
52+
# TODO(efried): Remove this once https://github.com/tox-dev/tox/issues/425 is fixed.
53+
basepython = python3.5
54+
commands =
55+
{[testenv]commands}
56+
stestr run {posargs}
57+
58+
[testenv:py36]
59+
# TODO(efried): Remove this once https://github.com/tox-dev/tox/issues/425 is fixed.
60+
basepython = python3.6
61+
commands =
62+
{[testenv:py35]commands}
2063

2164
[testenv:pep8]
65+
envdir = {toxworkdir}/shared
2266
commands =
2367
flake8
2468
# Run security linter
@@ -27,8 +71,7 @@ commands =
2771
bandit -r deepaas -x tests -s B110,B410
2872

2973
[testenv:bandit]
30-
# NOTE(browne): This is required for the integration test job of the bandit
31-
# project. Please do not remove.
74+
envdir = {toxworkdir}/shared
3275
commands = bandit -r deepaas -x tests -s B110,B410
3376

3477
[flake8]

0 commit comments

Comments
 (0)