Migrate from testr to stestr, disable auto discovery

Tripleo-ci jobs are broken after latest release of setuptools 61.0
because of breaking changes which are not backwork compatible,
details in related bug and [1].

Users that don't set ``packages``, ``py_modules``, or `configuration`
are still likely to observe the auto-discovery behavior, which may
halt the build if the project contains multiple directories and/or
multiple Python files directly under the project root.

To disable auto discovery, one can do below in setup.py

~~~
setuptools.setup(..,packages=[],..)
~~~

or

~~~
setuptools.setup(..,py_modules=[],..)
~~~

Also, Migrate from testr to stestr - tox py38 timingout without this.

[1] https://github.com/pypa/setuptools/issues/3197

Releated-Bug: #1966382
Change-Id: I8db5e382576a820f756cc936ca0fe7ca6d0ec1d1
(cherry picked from commit 0b33e111ca)
This commit is contained in:
Sandeep Yadav 2022-03-28 15:18:20 +05:30
parent 0e1c5978df
commit 8a2012bc3e
6 changed files with 21 additions and 14 deletions

19
.gitignore vendored
View File

@ -1,15 +1,24 @@
*~
.testrepository
*.sw?
*.pyc
*.qcow2
elements/seed-stack-config/local.json
# Unit test / coverage reports
.stestr
.tox
.venv
# Packages
*.egg-info
dist
*.qcow2
build
# pbr generates these
AUTHORS
ChangeLog
elements/seed-stack-config/local.json
# Editors
*.sw?
*~
# Files created by releasenotes build
releasenotes/build

4
.stestr.conf Normal file
View File

@ -0,0 +1,4 @@
[DEFAULT]
test_path=./tests/
top_dir=./

View File

@ -1,5 +0,0 @@
[DEFAULT]
test_command=python -m subunit.run discover . $LISTOPT $IDOPTION
test_id_option=--load-list $IDFILE
test_list_option=--list

View File

@ -19,4 +19,5 @@ import setuptools
setuptools.setup(
setup_requires=['pbr'],
py_modules=[],
pbr=True)

View File

@ -3,6 +3,6 @@ openstackdocstheme>=2.2.1 # Apache-2.0
oslotest
sphinx>=2.0.0,!=2.1.0 # BSD
testrepository>=0.0.18
stestr>=2.0.0 # Apache-2.0
reno>=3.1.0 # Apache-2.0
pyflakes>=2.2.0

View File

@ -10,9 +10,7 @@ deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/victoria}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands=
python setup.py testr --slowest --testr-args='{posargs}'
commands = stestr run --slowest {posargs}
[testenv:venv]
commands = {posargs}