From b4a0a06b66452ac2f135080961016c0bb8026982 Mon Sep 17 00:00:00 2001 From: Pavlo Shchelokovskyy Date: Tue, 19 Sep 2017 13:45:51 +0000 Subject: [PATCH] Add stestr-specific files os-testr>=1.0 uses stestr as test runner instead of testrepository. This patch adds appropriate config and git ignore options for stestr. Change-Id: I3aefd97312bb9e5985e601dd192913247046d6e4 --- .gitignore | 1 + .stestr.conf | 3 +++ .testr.conf | 7 ------- test-requirements.txt | 1 - tox.ini | 12 ++++++++++-- 5 files changed, 14 insertions(+), 10 deletions(-) create mode 100644 .stestr.conf delete mode 100644 .testr.conf diff --git a/.gitignore b/.gitignore index 0808bf9..0441911 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,7 @@ cover .tox nosetests.xml .testrepository +.stestr .venv # Translations diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 0000000..7923822 --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,3 @@ +[DEFAULT] +test_path=. +top_dir=./ diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index 6d83b3c..0000000 --- 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/test-requirements.txt b/test-requirements.txt index 40f3d66..6eca9cb 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -11,7 +11,6 @@ python-subunit>=0.0.18 # Apache-2.0/BSD sphinx>=1.6.2 # BSD oslosphinx>=4.7.0 # Apache-2.0 oslotest>=1.10.0 # Apache-2.0 -testrepository>=0.0.18 # Apache-2.0/BSD testscenarios>=0.4 # Apache-2.0/BSD testtools>=1.4.0 # MIT os-testr>=0.8.0 # Apache-2.0 diff --git a/tox.ini b/tox.ini index 15714b1..9d06022 100644 --- a/tox.ini +++ b/tox.ini @@ -26,10 +26,18 @@ commands = commands = {posargs} [testenv:cover] +setenv = VIRTUAL_ENV={envdir} + PYTHONDONTWRITEBYTECODE = 1 + LANGUAGE=en_US + LC_ALL=en_US.UTF-8 + TESTS_DIR=./ironic_staging_drivers/tests/unit/ + PYTHON=coverage run --source ironic_staging_drivers --omit='*tests*' --parallel-mode commands = coverage erase - python setup.py test --coverage --omit '*test*' --coverage-package-name ironic_staging_drivers --testr-args='{posargs}' - coverage report --omit='*test*' + ostestr {posargs} + coverage combine + coverage report --omit='*tests*' + coverage html -d ./cover --omit='*tests*' [testenv:docs] commands = python setup.py build_sphinx