From 514958d3f3eb72183fe179f6b17796d0893a87de Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Fri, 4 Jan 2019 16:07:07 +0000 Subject: [PATCH] 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 --- .gitignore | 1 + .stestr.conf | 3 +++ .testr.conf | 8 -------- test-requirements.txt | 2 +- tox.ini | 5 ++--- 5 files changed, 7 insertions(+), 12 deletions(-) create mode 100644 .stestr.conf delete mode 100644 .testr.conf diff --git a/.gitignore b/.gitignore index e17b175e..0153cc18 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ ChangeLog *.egg-info *.pyc doc/build +.stestr diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 00000000..b74e7484 --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,3 @@ +[DEFAULT] +test_path=./git_review/tests +top_dir=./ diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index 75c2bceb..00000000 --- a/.testr.conf +++ /dev/null @@ -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 diff --git a/test-requirements.txt b/test-requirements.txt index 6bc3c810..028581a7 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,5 +1,5 @@ hacking>=0.10.0,<0.11 mock fixtures>=0.3.14 -testrepository>=0.0.18 +stestr>=2.2.0 testtools>=0.9.34 diff --git a/tox.ini b/tox.ini index 7c63f917..dd1450da 100644 --- a/tox.ini +++ b/tox.ini @@ -12,12 +12,11 @@ passenv = JAVA_HOME # uncomment to allow custom java options to be added # _JAVA_OPTIONS - + TERM commands = python -m git_review.tests.check_test_id_hashes discover --list python -m git_review.tests.prepare - python setup.py testr --slowest --testr-args='--concurrency=2 {posargs}' - + stestr run --color {posargs} deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt