Browse Source

Migrate from testr to stestr

* Replace .testr.conf by .stestr.conf for migration and update
  .gitignore, test-requirements.txt and lower-constraints.txt
  files accordingly
* Use py3 as the default runtime for tox and 3.18.0 as the
  minversion for tox
* Add a new job, openstack-cover-jobs, to run the coverage in Zuul

Change-Id: If6fa3f2f861d5eb6787743edcc6333e5aacef7d0
changes/88/797888/5
Anand Bhat 1 year ago
parent
commit
27c426a76f
  1. 2
      .gitignore
  2. 3
      .stestr.conf
  3. 7
      .testr.conf
  4. 1
      .zuul.yaml
  5. 2
      lower-constraints.txt
  6. 2
      test-requirements.txt
  7. 19
      tox.ini

2
.gitignore vendored

@ -11,6 +11,6 @@ eggs
AUTHORS
ChangeLog
.testrepository/
.stestr/
cover/
.coverage

3
.stestr.conf

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

7
.testr.conf

@ -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 $DISCOVER_DIRECTORY $LISTOPT $IDOPTION
test_id_option=--load-list $IDFILE
test_list_option=--list

1
.zuul.yaml

@ -4,3 +4,4 @@
- openstack-lower-constraints-jobs
- openstack-python3-xena-jobs
- release-notes-jobs-python3
- openstack-cover-jobs

2
lower-constraints.txt

@ -36,8 +36,8 @@ PyYAML==3.12
requests==2.14.2
requestsexceptions==1.2.0
rfc3986==0.3.1
stestr==2.0.0
stevedore==1.20.0
testrepository==0.0.18
testtools==2.2.0
traceback2==1.4.0
unittest2==1.1.0

2
test-requirements.txt

@ -9,6 +9,6 @@ pyflakes>=2.1.1
oslotest>=3.2.0 # Apache-2.0
fixtures>=3.0.0 # Apache-2.0/BSD
testrepository>=0.0.18 # Apache-2.0/BSD
stestr>=2.0.0 # Apache-2.0
testtools>=2.2.0 # MIT
coverage!=4.4,>=4.0 # Apache-2.0

19
tox.ini

@ -1,6 +1,6 @@
[tox]
minversion = 3.1.1
envlist = py36,py38,pep8
minversion = 3.18.0
envlist = py3,pep8
ignore_basepython_conflict = True
[testenv]
@ -12,8 +12,7 @@ deps =
-r{toxinidir}/requirements.txt
setenv = VIRTUAL_ENV={envdir}
DISCOVER_DIRECTORY=blazarclient/tests
commands =
python setup.py testr --slowest --testr-args="{posargs}"
commands = stestr run --slowest '{posargs}'
[testenv:pep8]
commands = flake8
@ -37,8 +36,18 @@ deps =
commands = {posargs}
[testenv:cover]
allowlist_externals = find
setenv =
{[testenv]setenv}
PYTHON=coverage run --source blazarclient --parallel-mode
commands =
python setup.py testr --coverage --testr-args='{posargs}'
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:lower-constraints]
deps =

Loading…
Cancel
Save