From ea03aeedf2f840945853b9986e7ba7f52360bb46 Mon Sep 17 00:00:00 2001 From: Martin Kopec Date: Mon, 4 Dec 2017 14:57:53 +0000 Subject: [PATCH] Switch to use stestr for unit tests The patch: * replaces .testr.conf by .stestr.conf * removes os-testr requirement * adds stestr requirement * edits tox.ini file so that only stestr is used * removes .testrepository from .gitignore Change-Id: I14dae1cc58e3b5e2b3157df0803c3a15e9b55102 --- .gitignore | 1 - .stestr.conf | 3 +++ .testr.conf | 7 ------- requirements.txt | 2 +- tox.ini | 8 +++++--- 5 files changed, 9 insertions(+), 12 deletions(-) create mode 100644 .stestr.conf delete mode 100644 .testr.conf diff --git a/.gitignore b/.gitignore index 35311cc7..e4374666 100644 --- a/.gitignore +++ b/.gitignore @@ -27,7 +27,6 @@ cover/ !.coveragerc .tox nosetests.xml -.testrepository .venv .stestr diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 00000000..9d282ff9 --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,3 @@ +[DEFAULT] +test_path=./config_tempest/tests +top_dir=./ diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index 6d83b3c4..00000000 --- a/.testr.conf +++ /dev/null @@ -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 ./ . $LISTOPT $IDOPTION -test_id_option=--load-list $IDFILE -test_list_option=--list diff --git a/requirements.txt b/requirements.txt index f0724399..e7439a54 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,6 +5,6 @@ pbr>=1.8 # Apache-2.0 tempest>=14.0.0 # Apache-2.0 requests>=2.10.0,!=2.12.2 # Apache-2.0 -os-testr>=0.8.0 # Apache-2.0 +stestr>=1.1.0 # Apache-2.0 os-client-config>=1.26.0 # Apache-2.0 oslo_config>=3.23.0 # Apache-2.0 diff --git a/tox.ini b/tox.ini index aa77299e..8c487b3d 100644 --- a/tox.ini +++ b/tox.ini @@ -7,7 +7,6 @@ skipsdist = True usedevelop = True install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages} setenv = - OS_TEST_PATH=./config_tempest/tests VIRTUAL_ENV={envdir} PYTHONWARNINGS=default::DeprecationWarning whitelist_externals = * @@ -16,7 +15,7 @@ deps = -r{toxinidir}/test-requirements.txt commands = find . -type f -name "*.pyc" -delete - ostestr {posargs} + stestr --test-path ./config_tempest/tests run {posargs} [testenv:pep8] commands = flake8 {posargs} @@ -25,7 +24,10 @@ commands = flake8 {posargs} commands = {posargs} [testenv:cover] -commands = python setup.py testr --coverage --testr-args='{posargs}' +commands = + coverage erase + find . -type f -name "*.pyc" -delete + stestr --test-path ./config_tempest/tests run {posargs} [testenv:docs] commands = python setup.py build_sphinx