Split out unit tests as separate tox jobs
This commit removes the tempest unit tests from the same tox job as the tempest runs. It creates a separate py26, py27, and py33 tox job for running the unit tests. Change-Id: I9efea4cfa42f770c34869c0b0931b0ed0b51c177
This commit is contained in:
parent
7228e1149f
commit
12fdf4bda5
@ -20,8 +20,6 @@ import subprocess
|
|||||||
import tempfile
|
import tempfile
|
||||||
import testtools
|
import testtools
|
||||||
|
|
||||||
from tempest.test import attr
|
|
||||||
|
|
||||||
DEVNULL = open(os.devnull, 'wb')
|
DEVNULL = open(os.devnull, 'wb')
|
||||||
|
|
||||||
|
|
||||||
@ -46,7 +44,6 @@ class TestWrappers(testtools.TestCase):
|
|||||||
shutil.copy('tempest/tests/files/setup.cfg', self.setup_cfg_file)
|
shutil.copy('tempest/tests/files/setup.cfg', self.setup_cfg_file)
|
||||||
shutil.copy('tempest/tests/files/__init__.py', self.init_file)
|
shutil.copy('tempest/tests/files/__init__.py', self.init_file)
|
||||||
|
|
||||||
@attr(type='smoke')
|
|
||||||
def test_pretty_tox(self):
|
def test_pretty_tox(self):
|
||||||
# Copy wrapper script and requirements:
|
# Copy wrapper script and requirements:
|
||||||
pretty_tox = os.path.join(self.directory, 'pretty_tox.sh')
|
pretty_tox = os.path.join(self.directory, 'pretty_tox.sh')
|
||||||
@ -62,7 +59,6 @@ class TestWrappers(testtools.TestCase):
|
|||||||
shell=True, stdout=DEVNULL, stderr=DEVNULL)
|
shell=True, stdout=DEVNULL, stderr=DEVNULL)
|
||||||
self.assertEqual(exit_code, 0)
|
self.assertEqual(exit_code, 0)
|
||||||
|
|
||||||
@attr(type='smoke')
|
|
||||||
def test_pretty_tox_fails(self):
|
def test_pretty_tox_fails(self):
|
||||||
# Copy wrapper script and requirements:
|
# Copy wrapper script and requirements:
|
||||||
pretty_tox = os.path.join(self.directory, 'pretty_tox.sh')
|
pretty_tox = os.path.join(self.directory, 'pretty_tox.sh')
|
||||||
@ -78,7 +74,6 @@ class TestWrappers(testtools.TestCase):
|
|||||||
stdout=DEVNULL, stderr=DEVNULL)
|
stdout=DEVNULL, stderr=DEVNULL)
|
||||||
self.assertEqual(exit_code, 1)
|
self.assertEqual(exit_code, 1)
|
||||||
|
|
||||||
@attr(type='smoke')
|
|
||||||
def test_pretty_tox_serial(self):
|
def test_pretty_tox_serial(self):
|
||||||
# Copy wrapper script and requirements:
|
# Copy wrapper script and requirements:
|
||||||
pretty_tox = os.path.join(self.directory, 'pretty_tox_serial.sh')
|
pretty_tox = os.path.join(self.directory, 'pretty_tox_serial.sh')
|
||||||
@ -90,7 +85,6 @@ class TestWrappers(testtools.TestCase):
|
|||||||
shell=True, stdout=DEVNULL, stderr=DEVNULL)
|
shell=True, stdout=DEVNULL, stderr=DEVNULL)
|
||||||
self.assertEqual(exit_code, 0)
|
self.assertEqual(exit_code, 0)
|
||||||
|
|
||||||
@attr(type='smoke')
|
|
||||||
def test_pretty_tox_serial_fails(self):
|
def test_pretty_tox_serial_fails(self):
|
||||||
# Copy wrapper script and requirements:
|
# Copy wrapper script and requirements:
|
||||||
pretty_tox = os.path.join(self.directory, 'pretty_tox_serial.sh')
|
pretty_tox = os.path.join(self.directory, 'pretty_tox_serial.sh')
|
||||||
|
17
tox.ini
17
tox.ini
@ -10,6 +10,15 @@ setenv = VIRTUAL_ENV={envdir}
|
|||||||
LC_ALL=C
|
LC_ALL=C
|
||||||
usedevelop = True
|
usedevelop = True
|
||||||
|
|
||||||
|
[testenv:py26]
|
||||||
|
commands = python setup.py test --slowest --testr-arg='tempest\.tests {posargs}'
|
||||||
|
|
||||||
|
[testenv:py33]
|
||||||
|
commands = python setup.py test --slowest --testr-arg='tempest\.tests {posargs}'
|
||||||
|
|
||||||
|
[testenv:py27]
|
||||||
|
commands = python setup.py test --slowest --testr-arg='tempest\.tests {posargs}'
|
||||||
|
|
||||||
[testenv:all]
|
[testenv:all]
|
||||||
sitepackages = True
|
sitepackages = True
|
||||||
setenv = VIRTUAL_ENV={envdir}
|
setenv = VIRTUAL_ENV={envdir}
|
||||||
@ -21,12 +30,12 @@ sitepackages = True
|
|||||||
# The regex below is used to select which tests to run and exclude the slow tag:
|
# The regex below is used to select which tests to run and exclude the slow tag:
|
||||||
# See the testrepostiory bug: https://bugs.launchpad.net/testrepository/+bug/1208610
|
# See the testrepostiory bug: https://bugs.launchpad.net/testrepository/+bug/1208610
|
||||||
commands =
|
commands =
|
||||||
sh tools/pretty_tox.sh '(?!.*\[.*\bslow\b.*\])(^tempest\.(api|scenario|thirdparty|cli|tests)) {posargs}'
|
sh tools/pretty_tox.sh '(?!.*\[.*\bslow\b.*\])(^tempest\.(api|scenario|thirdparty|cli)) {posargs}'
|
||||||
|
|
||||||
[testenv:testr-full]
|
[testenv:testr-full]
|
||||||
sitepackages = True
|
sitepackages = True
|
||||||
commands =
|
commands =
|
||||||
sh tools/pretty_tox.sh '(?!.*\[.*\bslow\b.*\])(^tempest\.(api|scenario|thirdparty|cli|tests)) {posargs}'
|
sh tools/pretty_tox.sh '(?!.*\[.*\bslow\b.*\])(^tempest\.(api|scenario|thirdparty|cli)) {posargs}'
|
||||||
|
|
||||||
[testenv:heat-slow]
|
[testenv:heat-slow]
|
||||||
sitepackages = True
|
sitepackages = True
|
||||||
@ -52,7 +61,7 @@ setenv = VIRTUAL_ENV={envdir}
|
|||||||
NOSE_OPENSTACK_STDOUT=1
|
NOSE_OPENSTACK_STDOUT=1
|
||||||
TEMPEST_PY26_NOSE_COMPAT=1
|
TEMPEST_PY26_NOSE_COMPAT=1
|
||||||
commands =
|
commands =
|
||||||
nosetests --logging-format '%(asctime)-15s %(message)s' --with-xunit -sv --xunit-file=nosetests-full.xml tempest/api tempest/scenario tempest/thirdparty tempest/cli tempest/tests {posargs}
|
nosetests --logging-format '%(asctime)-15s %(message)s' --with-xunit -sv --xunit-file=nosetests-full.xml tempest/api tempest/scenario tempest/thirdparty tempest/cli {posargs}
|
||||||
|
|
||||||
[testenv:py26-smoke]
|
[testenv:py26-smoke]
|
||||||
setenv = VIRTUAL_ENV={envdir}
|
setenv = VIRTUAL_ENV={envdir}
|
||||||
@ -78,7 +87,7 @@ commands =
|
|||||||
sitepackages = True
|
sitepackages = True
|
||||||
commands =
|
commands =
|
||||||
python -m tools/tempest_coverage -c start --combine
|
python -m tools/tempest_coverage -c start --combine
|
||||||
sh tools/pretty_tox.sh '(?!.*\[.*\bslow\b.*\])(^tempest\.(api|scenario|thirdparty|cli|tests))'
|
sh tools/pretty_tox.sh '(?!.*\[.*\bslow\b.*\])(^tempest\.(api|scenario|thirdparty|cli))'
|
||||||
python -m tools/tempest_coverage -c report --html {posargs}
|
python -m tools/tempest_coverage -c report --html {posargs}
|
||||||
|
|
||||||
[testenv:stress]
|
[testenv:stress]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user