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:
Matthew Treinish 2013-10-03 15:20:09 +00:00 committed by Gerrit Code Review
parent 7228e1149f
commit 12fdf4bda5
2 changed files with 13 additions and 10 deletions

View File

@ -20,8 +20,6 @@ import subprocess
import tempfile
import testtools
from tempest.test import attr
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/__init__.py', self.init_file)
@attr(type='smoke')
def test_pretty_tox(self):
# Copy wrapper script and requirements:
pretty_tox = os.path.join(self.directory, 'pretty_tox.sh')
@ -62,7 +59,6 @@ class TestWrappers(testtools.TestCase):
shell=True, stdout=DEVNULL, stderr=DEVNULL)
self.assertEqual(exit_code, 0)
@attr(type='smoke')
def test_pretty_tox_fails(self):
# Copy wrapper script and requirements:
pretty_tox = os.path.join(self.directory, 'pretty_tox.sh')
@ -78,7 +74,6 @@ class TestWrappers(testtools.TestCase):
stdout=DEVNULL, stderr=DEVNULL)
self.assertEqual(exit_code, 1)
@attr(type='smoke')
def test_pretty_tox_serial(self):
# Copy wrapper script and requirements:
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)
self.assertEqual(exit_code, 0)
@attr(type='smoke')
def test_pretty_tox_serial_fails(self):
# Copy wrapper script and requirements:
pretty_tox = os.path.join(self.directory, 'pretty_tox_serial.sh')

17
tox.ini
View File

@ -10,6 +10,15 @@ setenv = VIRTUAL_ENV={envdir}
LC_ALL=C
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]
sitepackages = True
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:
# See the testrepostiory bug: https://bugs.launchpad.net/testrepository/+bug/1208610
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]
sitepackages = True
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]
sitepackages = True
@ -52,7 +61,7 @@ setenv = VIRTUAL_ENV={envdir}
NOSE_OPENSTACK_STDOUT=1
TEMPEST_PY26_NOSE_COMPAT=1
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]
setenv = VIRTUAL_ENV={envdir}
@ -78,7 +87,7 @@ commands =
sitepackages = True
commands =
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}
[testenv:stress]