From 55a24e730d0528964fd24f699a25998daf4b6a54 Mon Sep 17 00:00:00 2001 From: Anand Bhat Date: Fri, 28 May 2021 12:33:20 +0530 Subject: [PATCH] Replace dashes with underscore & Migrate to stestr * Setuptools v54.1.0 introduces a warning that the use of dash-separated options in 'setup.cfg' will not be supported in a future version [1]. Get ahead of the issue by replacing the dashes with underscores.Without this, we see 'UserWarning' messages. * 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 * Add a new job, openstack-cover-jobs, to run the coverage in Zuul [1] https://github.com/pypa/setuptools/commit/a2e9ae4cb Change-Id: I3169456592324425b9a9ddc4dbcf8abcf3b82135 --- .gitignore | 2 +- .stestr.conf | 3 +++ .testr.conf | 7 ------- .zuul.yaml | 1 + setup.cfg | 8 ++++---- test-requirements.txt | 2 +- tox.ini | 17 ++++++++++++++--- 7 files changed, 24 insertions(+), 16 deletions(-) create mode 100644 .stestr.conf delete mode 100644 .testr.conf diff --git a/.gitignore b/.gitignore index 8f9ea41..91ca982 100644 --- a/.gitignore +++ b/.gitignore @@ -26,7 +26,7 @@ pip-log.txt .coverage .tox nosetests.xml -.testrepository +.stestr/ .venv # Translations diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 0000000..e4803e0 --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,3 @@ +[DEFAULT] +test_path=./os_performance_tools/tests/ +top_dir=./ \ No newline at end of file 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/.zuul.yaml b/.zuul.yaml index e81beb5..059102e 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -4,3 +4,4 @@ - publish-openstack-docs-pti - openstack-python35-jobs - openstack-python3-xena-jobs + - openstack-cover-jobs diff --git a/setup.cfg b/setup.cfg index 788c22e..1828bc2 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,12 +1,12 @@ [metadata] name = os-performance-tools summary = Python scripts for use in OpenStack's QA process -description-file = +description_file = README.rst author = OpenStack -author-email = openstack-discuss@lists.openstack.org -home-page = https://docs.openstack.org/os-performance-tools/latest/ -python-requires = >=3.5 +author_email = openstack-discuss@lists.openstack.org +home_page = https://docs.openstack.org/os-performance-tools/latest/ +python_requires = >=3.5 classifier = Environment :: OpenStack Intended Audience :: Information Technology diff --git a/test-requirements.txt b/test-requirements.txt index 3463c2b..7f5f1a7 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -8,5 +8,5 @@ coverage>=3.6 python-subunit>=0.0.18 oslotest>=1.10.0 # Apache-2.0 -testrepository>=0.0.18 +stestr>=2.0.0 # Apache-2.0 testscenarios>=0.4 diff --git a/tox.ini b/tox.ini index f070fee..8d5ae58 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] minversion = 3.18.0 -envlist = py36,py38,pypy,pep8 +envlist = py3,pypy,pep8 skipsdist = True ignore_basepython_conflict = True @@ -10,7 +10,7 @@ usedevelop = True setenv = VIRTUAL_ENV={envdir} deps = -r{toxinidir}/test-requirements.txt -commands = python setup.py test --slowest --testr-args='{posargs}' +commands = stestr run --slowest {posargs} [testenv:pep8] commands = flake8 @@ -19,7 +19,18 @@ commands = flake8 commands = {posargs} [testenv:cover] -commands = python setup.py test --coverage --testr-args='{posargs}' +allowlist_externals = find +setenv = + {[testenv]setenv} + PYTHON=coverage run --source os_performance_tools --parallel-mode +commands = + coverage erase + find . -type f -name "*.pyc" -delete + stestr run {posargs} + coverage combine + coverage html -d cover + coverage xml -o cover/coverage.xml + coverage report [testenv:docs] deps =