From 20d234bc370056184a0885e6e6f735db056668a2 Mon Sep 17 00:00:00 2001 From: Anand Bhat Date: Fri, 25 Jun 2021 16:50:54 +0530 Subject: [PATCH] Migrate from testr to stestr * Replace .testr.conf by .stestr.conf for migration and update .gitignore and test-requirements.txt file accordingly * Use py3 as the default runtime for tox and 3.18.0 as the minversion for tox, replace whitelist_externals by allowlist_externals Change-Id: I7747c4ce8d95ce94e0750a3f964f0264fe491fce --- .gitignore | 1 - .stestr.conf | 3 +++ .testr.conf | 4 ---- test-requirements.txt | 2 +- tox.ini | 17 ++++++++++++----- 5 files changed, 16 insertions(+), 11 deletions(-) create mode 100644 .stestr.conf delete mode 100644 .testr.conf diff --git a/.gitignore b/.gitignore index 3aa62ec..1274b2c 100644 --- a/.gitignore +++ b/.gitignore @@ -16,7 +16,6 @@ doc/build adjutantclient/versioninfo *.egg-info *.log -.testrepository .pypirc env/ *~ diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 0000000..9e8581a --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,3 @@ +[DEFAULT] +test_path=./adjutantclient/tests/ +top_dir=./ \ No newline at end of file diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index 7a2b3df..0000000 --- a/.testr.conf +++ /dev/null @@ -1,4 +0,0 @@ -[DEFAULT] -test_command=${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./adjutantclient/tests} $LISTOPT $IDOPTION -test_id_option=--load-list $IDFILE -test_list_option=--list diff --git a/test-requirements.txt b/test-requirements.txt index 42c9cc1..fe3f111 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -8,7 +8,7 @@ discover # BSD fixtures>=3.0.0 # Apache-2.0/BSD requests-mock>=0.7.0 # Apache-2.0 os-client-config>=1.13.1 # Apache-2.0 -testrepository>=0.0.18 # Apache-2.0/BSD +stestr>=2.0.0 # Apache-2.0 testscenarios>=0.4 # Apache-2.0/BSD testtools>=1.4.0 # MIT tempest>=11.0.0 # Apache-2.0 diff --git a/tox.ini b/tox.ini index 5623d31..487e839 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] -minversion = 3.1 -envlist = py38 +minversion = 3.18.0 +envlist = py3 skipsdist = True ignore_basepython_conflict = True @@ -15,18 +15,25 @@ deps = -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt -commands = ostestr {posargs} +commands = stestr run --slowest {posargs} -whitelist_externals = find +allowlist_externals = find [testenv:pep8] commands = flake8 [testenv:cover] +allowlist_externals = find +setenv = + {[testenv]setenv} + PYTHON=coverage run --source adjutantclient --parallel-mode commands = coverage erase find . -type f -name "*.pyc" -delete - python setup.py testr --coverage --testr-args='{posargs}' + stestr run {posargs} + coverage combine + coverage html -d cover + coverage xml -o cover/coverage.xml coverage report [testenv:venv]