From 60e0ea26fb6dc97724240b0e87e7bf06fc10c33c Mon Sep 17 00:00:00 2001 From: Pavlo Shchelokovskyy Date: Fri, 6 Oct 2017 07:14:27 +0000 Subject: [PATCH] Replace testr with stestr os-testr 1.0.0 now uses stestr as underlying test runner, so we should re-configure our testing setup accordingly. Change-Id: I0a8f23cf2bd934c288daf1a9fa8b672768641163 --- .gitignore | 1 + .stestr.conf | 3 +++ .testr.conf | 5 ----- tox.ini | 13 ++++++++----- 4 files changed, 12 insertions(+), 10 deletions(-) create mode 100644 .stestr.conf delete mode 100644 .testr.conf diff --git a/.gitignore b/.gitignore index 6a6b9a94f..fb118c682 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,7 @@ develop-eggs # Other *.DS_Store +.stestr .testrepository .tox .idea diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 000000000..c50970703 --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,3 @@ +[DEFAULT] +test_path=${TESTS_DIR:-./ironicclient/tests/unit} +top_dir=./ diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index 984a59737..000000000 --- a/.testr.conf +++ /dev/null @@ -1,5 +0,0 @@ -[DEFAULT] -test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} ${PYTHON:-python} -m subunit.run discover -t ./ ${TESTS_DIR:-./ironicclient/tests/unit} $LISTOPT $IDOPTION - -test_id_option=--load-list $IDFILE -test_list_option=--list diff --git a/tox.ini b/tox.ini index 6ef8cc5bb..0cbbb795e 100644 --- a/tox.ini +++ b/tox.ini @@ -7,7 +7,7 @@ skipsdist = True setenv = VIRTUAL_ENV={envdir} PYTHONDONTWRITEBYTECODE = 1 LANGUAGE=en_US - # .testr.conf uses TESTS_DIR + # .stestr.conf uses TESTS_DIR TESTS_DIR=./ironicclient/tests/unit usedevelop = True install_command = @@ -27,11 +27,14 @@ commands = doc8 doc/source CONTRIBUTING.rst README.rst [testenv:cover] -setenv = VIRTUAL_ENV={envdir} - LANGUAGE=en_US +setenv = {[testenv]setenv} + PYTHON=coverage run --source ironicclient --omit='*tests*' --parallel-mode commands = - coverage erase - python setup.py testr --coverage --testr-args='{posargs}' + coverage erase + ostestr {posargs} + coverage combine + coverage report --omit='*tests*' + coverage html -d ./cover --omit='*tests*' [testenv:venv] commands = {posargs}