Migrate from testr to stestr
* Replace .testr.conf by .stestr.conf for migration and update .gitignore and test-requirements.txt files accordingly * Use 3.18.0 as the minversion for tox * Add a new job, openstack-cover-jobs, to run the coverage in Zuul * Create cover environment in tox and make relevant changes in .gitignore and test-requirements.txt Signed-off-by: HeroicHitesh <email.hiteshkumar@gmail.com> Change-Id: I2bb0f23771e6ff1e3f775520a719514c2a3f3aa3
This commit is contained in:
parent
f26534191e
commit
4dfd64a7d2
34
.gitignore
vendored
34
.gitignore
vendored
@ -1,7 +1,33 @@
|
|||||||
heat_specs.egg-info/
|
|
||||||
doc/build/
|
|
||||||
.tox/
|
|
||||||
*.pyc
|
*.pyc
|
||||||
.testrepository
|
|
||||||
|
# Packages
|
||||||
|
*.egg*
|
||||||
|
*.egg-info
|
||||||
|
dist
|
||||||
|
build
|
||||||
|
|
||||||
|
# Unit test / coverage reports
|
||||||
|
cover/
|
||||||
|
.coverage*
|
||||||
|
!.coveragerc
|
||||||
|
.tox/
|
||||||
|
.stestr/
|
||||||
|
.venv
|
||||||
|
|
||||||
|
# Mr Developer
|
||||||
|
.project
|
||||||
|
.pydevproject
|
||||||
|
|
||||||
|
# Sphinx
|
||||||
|
doc/build/
|
||||||
|
|
||||||
|
# pbr generates these
|
||||||
AUTHORS
|
AUTHORS
|
||||||
ChangeLog
|
ChangeLog
|
||||||
|
|
||||||
|
# Editors
|
||||||
|
*.swp
|
||||||
|
*~
|
||||||
|
|
||||||
|
# Files created by releasenotes build
|
||||||
|
releasenotes/build
|
||||||
|
3
.stestr.conf
Normal file
3
.stestr.conf
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
[DEFAULT]
|
||||||
|
test_path=./tests/
|
||||||
|
top_dir=./
|
@ -1,4 +0,0 @@
|
|||||||
[DEFAULT]
|
|
||||||
test_command=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 OS_TEST_TIMEOUT=60 ${PYTHON:-python} -m subunit.run discover -t ./ . $LISTOPT $IDOPTION
|
|
||||||
test_id_option=--load-list $IDFILE
|
|
||||||
test_list_option=--list
|
|
@ -1,6 +1,7 @@
|
|||||||
- project:
|
- project:
|
||||||
templates:
|
templates:
|
||||||
- openstack-specs-jobs
|
- openstack-specs-jobs
|
||||||
|
- openstack-cover-jobs
|
||||||
check:
|
check:
|
||||||
jobs:
|
jobs:
|
||||||
- openstack-tox-py38
|
- openstack-tox-py38
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
testrepository>=0.0.18
|
coverage>=4.0 # Apache-2.0
|
||||||
|
stestr>=2.0.0 # Apache-2.0
|
||||||
testtools>=0.9.34
|
testtools>=0.9.34
|
||||||
testscenarios>=0.4
|
testscenarios>=0.4
|
||||||
|
20
tox.ini
20
tox.ini
@ -1,5 +1,5 @@
|
|||||||
[tox]
|
[tox]
|
||||||
minversion = 1.6
|
minversion = 3.18.0
|
||||||
envlist = docs,pep8
|
envlist = docs,pep8
|
||||||
skipsdist = True
|
skipsdist = True
|
||||||
|
|
||||||
@ -10,14 +10,28 @@ setenv =
|
|||||||
VIRTUAL_ENV={envdir}
|
VIRTUAL_ENV={envdir}
|
||||||
deps = -r{toxinidir}/requirements.txt
|
deps = -r{toxinidir}/requirements.txt
|
||||||
-r{toxinidir}/test-requirements.txt
|
-r{toxinidir}/test-requirements.txt
|
||||||
whitelist_externals = find
|
allowlist_externals = find
|
||||||
commands =
|
commands =
|
||||||
find . -type f -name "*.pyc" -delete
|
find . -type f -name "*.pyc" -delete
|
||||||
python setup.py testr --slowest --testr-args='{posargs}'
|
stestr run --slowest {posargs}
|
||||||
|
|
||||||
[testenv:venv]
|
[testenv:venv]
|
||||||
commands = {posargs}
|
commands = {posargs}
|
||||||
|
|
||||||
|
[testenv:cover]
|
||||||
|
basepython = python3
|
||||||
|
allowlist_externals = find
|
||||||
|
setenv =
|
||||||
|
PYTHON=coverage run --source . --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]
|
[testenv:docs]
|
||||||
commands = sphinx-build -W -a -b html doc/source doc/build/html
|
commands = sphinx-build -W -a -b html doc/source doc/build/html
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user