Switch from testrepository to stestr

Adopts use of newer stestr for running the test suite.

Passing TERM is needed or stestr will ignore the --color option when
run under tox.

Change-Id: Id2d4ce36cdfedd5a847e0428854753d2cf4140ee
This commit is contained in:
Sorin Sbarnea 2019-01-04 16:07:07 +00:00 committed by Stephen Finucane
parent e535d4467e
commit 514958d3f3
5 changed files with 7 additions and 12 deletions

1
.gitignore vendored
View File

@ -13,3 +13,4 @@ ChangeLog
*.egg-info *.egg-info
*.pyc *.pyc
doc/build doc/build
.stestr

3
.stestr.conf Normal file
View File

@ -0,0 +1,3 @@
[DEFAULT]
test_path=./git_review/tests
top_dir=./

View File

@ -1,8 +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 ./ ./git_review/tests $LISTOPT $IDOPTION
test_id_option=--load-list $IDFILE
test_list_option=--list

View File

@ -1,5 +1,5 @@
hacking>=0.10.0,<0.11 hacking>=0.10.0,<0.11
mock mock
fixtures>=0.3.14 fixtures>=0.3.14
testrepository>=0.0.18 stestr>=2.2.0
testtools>=0.9.34 testtools>=0.9.34

View File

@ -12,12 +12,11 @@ passenv =
JAVA_HOME JAVA_HOME
# uncomment to allow custom java options to be added # uncomment to allow custom java options to be added
# _JAVA_OPTIONS # _JAVA_OPTIONS
TERM
commands = commands =
python -m git_review.tests.check_test_id_hashes discover --list python -m git_review.tests.check_test_id_hashes discover --list
python -m git_review.tests.prepare python -m git_review.tests.prepare
python setup.py testr --slowest --testr-args='--concurrency=2 {posargs}' stestr run --color {posargs}
deps = deps =
-r{toxinidir}/requirements.txt -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt -r{toxinidir}/test-requirements.txt