diff --git a/.gitignore b/.gitignore index 008ce4d..98b3902 100644 --- a/.gitignore +++ b/.gitignore @@ -45,6 +45,7 @@ htmlcov/ .coverage .coverage.* .cache +.stestr nosetests.xml coverage.xml *,cover diff --git a/.gitreview b/.gitreview new file mode 100644 index 0000000..d0ee5d5 --- /dev/null +++ b/.gitreview @@ -0,0 +1,4 @@ +[gerrit] +host=review.openstack.org +port=29418 +project=openstack/tempest-stress.git diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 0000000..d338fee --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,3 @@ +[DEFAULT] +test_path=./tempest_stress/tests +top_dir=./ diff --git a/tempest_stress/driver.py b/tempest_stress/driver.py index 5a82fb1..b389cfb 100644 --- a/tempest_stress/driver.py +++ b/tempest_stress/driver.py @@ -21,11 +21,11 @@ from oslo_log import log as logging from oslo_utils import importutils import six from tempest import clients -from tempest.common import cred_client from tempest.common import credentials_factory as credentials from tempest.common.utils import data_utils from tempest import config from tempest import exceptions +from tempest.lib.common import cred_client from tempest.lib.common import ssh from tempest_stress import cleanup diff --git a/tempest_stress/tests/stress/test_stress.py b/tempest_stress/tests/stress/test_stress.py index 918e8af..8f24e3e 100644 --- a/tempest_stress/tests/stress/test_stress.py +++ b/tempest_stress/tests/stress/test_stress.py @@ -44,7 +44,8 @@ class StressFrameworkTest(base.TestCase): LOG.debug('error of %s:\n%s' % (cmd_str, result_err)) raise exceptions.CommandFailed(proc.returncode, cmd, - result) + result, + result_err) finally: LOG.debug('output of %s:\n%s' % (cmd_str, result)) return proc.returncode diff --git a/test-requirements.txt b/test-requirements.txt index 86c11d0..496f5a4 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -5,6 +5,7 @@ hacking<0.12,>=0.11.0 # Apache-2.0 coverage>=3.6 # Apache-2.0 +stestr>=1.0.0 # Apache-2.0 python-subunit>=0.0.18 # Apache-2.0/BSD sphinx!=1.3b1,<1.3,>=1.2.1 # BSD oslosphinx!=3.4.0,>=2.5.0 # Apache-2.0 diff --git a/tox.ini b/tox.ini index 9bccea1..7a07855 100644 --- a/tox.ini +++ b/tox.ini @@ -8,8 +8,11 @@ usedevelop = True setenv = VIRTUAL_ENV={envdir} PYTHONWARNINGS=default::DeprecationWarning + OS_STDOUT_CAPTURE=1 + OS_STDERR_CAPTURE=1 + OS_TEST_TIMEOUT=60 deps = -r{toxinidir}/test-requirements.txt -commands = python setup.py test --slowest --testr-args='{posargs}' +commands = stestr --test-path ./tempest_stress/tests run {posargs} [testenv:stress] envdir = .tox/tempest_stress @@ -25,7 +28,14 @@ commands = flake8 {posargs} commands = {posargs} [testenv:cover] -commands = python setup.py test --coverage --testr-args='{posargs}' +setenv = + VIRTUAL_ENV={envdir} + PYTHON=coverage run --source tempest_stress --parallel-mode +commands = + stestr --test-path ./tempest_stress/tests run {posargs} + coverage combine + coverage html -d cover + coverage xml -o cover/coverage.xml [testenv:docs] commands = python setup.py build_sphinx