Revert "Revert "Switch to stestr""
This reverts commit e56801f2e8a04f08813125b05a4ff8c983beddbd. Change-Id: Icbea5ddd744d1fa65a397fb613731315687f9803
This commit is contained in:
parent
12a4b7f1d2
commit
ef23bd4862
7
.coveragerc
Normal file
7
.coveragerc
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
[run]
|
||||||
|
branch = True
|
||||||
|
source = zuul
|
||||||
|
omit = tests/*
|
||||||
|
|
||||||
|
[report]
|
||||||
|
ignore_errors = True
|
3
.stestr.conf
Normal file
3
.stestr.conf
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
[DEFAULT]
|
||||||
|
test_path=tests/unit
|
||||||
|
top_dir=./
|
@ -1,4 +0,0 @@
|
|||||||
[DEFAULT]
|
|
||||||
test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} OS_LOG_CAPTURE=${OS_LOG_CAPTURE:-1} OS_LOG_DEFAULTS=${OS_LOG_DEFAULTS:-""} ${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./tests/unit} $LISTOPT $IDOPTION
|
|
||||||
test_id_option=--load-list $IDFILE
|
|
||||||
test_list_option=--list
|
|
18
TESTING.rst
18
TESTING.rst
@ -50,6 +50,7 @@ Run The Tests
|
|||||||
*Navigate to the project's root directory and execute*::
|
*Navigate to the project's root directory and execute*::
|
||||||
|
|
||||||
tox
|
tox
|
||||||
|
|
||||||
Note: completing this command may take a long time (depends on system resources)
|
Note: completing this command may take a long time (depends on system resources)
|
||||||
also, you might not see any output until tox is complete.
|
also, you might not see any output until tox is complete.
|
||||||
|
|
||||||
@ -79,21 +80,20 @@ To run individual tests with tox::
|
|||||||
|
|
||||||
tox -e <env> -- path.to.module.Class.test
|
tox -e <env> -- path.to.module.Class.test
|
||||||
|
|
||||||
For example, to *run the basic Zuul test*::
|
For example, to *run a single Zuul test*::
|
||||||
|
|
||||||
tox -e py35 -- tests.unit.test_scheduler.TestScheduler.test_jobs_executed
|
tox -e py35 -- tests.unit.test_scheduler.TestScheduler.test_jobs_executed
|
||||||
|
|
||||||
To *run one test in the foreground* (after previously having run tox
|
To *run one test in the foreground* (after previously having run tox
|
||||||
to set up the virtualenv)::
|
to set up the virtualenv)::
|
||||||
|
|
||||||
. .tox/py35/bin/activate
|
.tox/py35/bin/stestr run -t tests.unit.test_scheduler.TestScheduler.test_jobs_executed
|
||||||
python -m testtools.run tests.unit.test_scheduler.TestScheduler.test_jobs_executed
|
|
||||||
|
|
||||||
List Failing Tests
|
List Failing Tests
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
.tox/py35/bin/activate
|
.tox/py35/bin/activate
|
||||||
testr failing --list
|
stestr failing --list
|
||||||
|
|
||||||
Hanging Tests
|
Hanging Tests
|
||||||
-------------
|
-------------
|
||||||
@ -102,7 +102,7 @@ The following will run each test in turn and print the name of the
|
|||||||
test as it is run::
|
test as it is run::
|
||||||
|
|
||||||
. .tox/py35/bin/activate
|
. .tox/py35/bin/activate
|
||||||
testr run --subunit | subunit2pyunit
|
stestr run
|
||||||
|
|
||||||
You can compare the output of that to::
|
You can compare the output of that to::
|
||||||
|
|
||||||
@ -111,10 +111,4 @@ You can compare the output of that to::
|
|||||||
Need More Info?
|
Need More Info?
|
||||||
---------------
|
---------------
|
||||||
|
|
||||||
More information about testr: https://wiki.openstack.org/wiki/Testr
|
More information about stestr: http://stestr.readthedocs.io/en/latest/
|
||||||
|
|
||||||
More information about nose: https://nose.readthedocs.org/en/latest/
|
|
||||||
|
|
||||||
|
|
||||||
More information about testing OpenStack code can be found here:
|
|
||||||
https://wiki.openstack.org/wiki/Testing
|
|
||||||
|
@ -4,8 +4,7 @@ coverage>=3.6
|
|||||||
sphinx>=1.5.1,<1.6
|
sphinx>=1.5.1,<1.6
|
||||||
sphinxcontrib-blockdiag>=1.1.0
|
sphinxcontrib-blockdiag>=1.1.0
|
||||||
fixtures>=0.3.14
|
fixtures>=0.3.14
|
||||||
python-subunit
|
stestr>=1.0.0 # Apache-2.0
|
||||||
testrepository>=0.0.17
|
|
||||||
testtools>=0.9.32
|
testtools>=0.9.32
|
||||||
sphinxcontrib-programoutput
|
sphinxcontrib-programoutput
|
||||||
sphinx-autodoc-typehints
|
sphinx-autodoc-typehints
|
||||||
|
23
tox.ini
23
tox.ini
@ -7,14 +7,18 @@ envlist = pep8,py35
|
|||||||
basepython = python3
|
basepython = python3
|
||||||
setenv = VIRTUAL_ENV={envdir}
|
setenv = VIRTUAL_ENV={envdir}
|
||||||
OS_TEST_TIMEOUT=150
|
OS_TEST_TIMEOUT=150
|
||||||
|
OS_STDOUT_CAPTURE={env:OS_STDOUT_CAPTURE:1}
|
||||||
|
OS_STDERR_CAPTURE={env:OS_STDERR_CAPTURE:1}
|
||||||
|
OS_LOG_CAPTURE={env:OS_LOG_CAPTURE:1}
|
||||||
|
OS_LOG_DEFAULTS={env:OS_LOG_DEFAULTS:""}
|
||||||
passenv = ZUUL_TEST_ROOT OS_STDOUT_CAPTURE OS_STDERR_CAPTURE OS_LOG_CAPTURE OS_LOG_DEFAULTS NODEPOOL_ZK_HOST
|
passenv = ZUUL_TEST_ROOT OS_STDOUT_CAPTURE OS_STDERR_CAPTURE OS_LOG_CAPTURE OS_LOG_DEFAULTS NODEPOOL_ZK_HOST
|
||||||
usedevelop = True
|
usedevelop = True
|
||||||
install_command = pip install {opts} {packages}
|
install_command = pip install {opts} {packages}
|
||||||
whitelist_externals = bash
|
whitelist_externals = bash
|
||||||
deps = -r{toxinidir}/requirements.txt
|
deps = -r{toxinidir}/requirements.txt
|
||||||
-r{toxinidir}/test-requirements.txt
|
-r{toxinidir}/test-requirements.txt
|
||||||
commands =
|
commands = stestr run {posargs}
|
||||||
python setup.py test --slowest --testr-args='{posargs}'
|
stestr slowest
|
||||||
|
|
||||||
[nodeenv]
|
[nodeenv]
|
||||||
install_command = bash tools/pip.sh {opts} {packages}
|
install_command = bash tools/pip.sh {opts} {packages}
|
||||||
@ -43,8 +47,13 @@ commands =
|
|||||||
|
|
||||||
[testenv:cover]
|
[testenv:cover]
|
||||||
install_command = {[nodeenv]install_command}
|
install_command = {[nodeenv]install_command}
|
||||||
|
setenv =
|
||||||
|
{[testenv]setenv}
|
||||||
commands =
|
commands =
|
||||||
python setup.py test --coverage
|
stestr run {posargs}
|
||||||
|
coverage combine
|
||||||
|
coverage html -d cover
|
||||||
|
coverage xml -o cover/coverage.xml
|
||||||
|
|
||||||
[testenv:docs]
|
[testenv:docs]
|
||||||
commands =
|
commands =
|
||||||
@ -54,17 +63,13 @@ commands =
|
|||||||
commands = {posargs}
|
commands = {posargs}
|
||||||
|
|
||||||
[testenv:nodepool]
|
[testenv:nodepool]
|
||||||
setenv =
|
|
||||||
OS_TEST_PATH = ./tests/nodepool
|
|
||||||
install_command = {[nodeenv]install_command}
|
install_command = {[nodeenv]install_command}
|
||||||
commands = python setup.py test --slowest --testr-args='--concurrency=1 {posargs}'
|
commands = stestr run --concurrency=1 --test-path ./tests/nodepool {posargs}
|
||||||
|
|
||||||
[testenv:remote]
|
[testenv:remote]
|
||||||
setenv =
|
commands = stestr run --concurrency=1 --test-path ./tests/remote {posargs}
|
||||||
OS_TEST_PATH = ./tests/remote
|
|
||||||
passenv = ZUUL_TEST_ROOT OS_STDOUT_CAPTURE OS_STDERR_CAPTURE OS_LOG_CAPTURE OS_LOG_DEFAULTS ZUUL_REMOTE_IPV4 ZUUL_SSH_KEY NODEPOOL_ZK_HOST
|
passenv = ZUUL_TEST_ROOT OS_STDOUT_CAPTURE OS_STDERR_CAPTURE OS_LOG_CAPTURE OS_LOG_DEFAULTS ZUUL_REMOTE_IPV4 ZUUL_SSH_KEY NODEPOOL_ZK_HOST
|
||||||
install_command = {[nodeenv]install_command}
|
install_command = {[nodeenv]install_command}
|
||||||
commands = python setup.py test --slowest --testr-args='--concurrency=1 {posargs}'
|
|
||||||
|
|
||||||
[flake8]
|
[flake8]
|
||||||
# These are ignored intentionally in openstack-infra projects;
|
# These are ignored intentionally in openstack-infra projects;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user