Switch tox env to stestr & add .gitreview file

This commit switch tox env to stestr and fix few tests.
Add the file that tells git-review where the
gerrit instance is.

Change-Id: I717c02e790d5bd22991cc6898e0b3654e083617c
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
Co-author: ghanshyam <gmann@ghanshyammann.com>
This commit is contained in:
Doug Hellmann 2018-08-31 12:31:39 +00:00 committed by ghanshyam
parent 76c2b39c2b
commit c5cd8d5a48
7 changed files with 24 additions and 4 deletions

1
.gitignore vendored
View File

@ -45,6 +45,7 @@ htmlcov/
.coverage
.coverage.*
.cache
.stestr
nosetests.xml
coverage.xml
*,cover

4
.gitreview Normal file
View File

@ -0,0 +1,4 @@
[gerrit]
host=review.openstack.org
port=29418
project=openstack/tempest-stress.git

3
.stestr.conf Normal file
View File

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

View File

@ -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

View File

@ -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

View File

@ -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

14
tox.ini
View File

@ -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