Bump minimum os-testr requirement to 1.0.0

This commit bumps the os-testr version to use 1.0.0. 1.0.0 changes the
internals to use stestr instead of subprocessing testr. A bunch of
incorrect imports in the tests were updated as a well, relying on
relative import paths is finicky at the best of times so to make the
tests work this just points to the path based on the root of the package
instead.

Change-Id: I2aed3f6a9adeac2b7dbe58ee12c0a1485278d56f
This commit is contained in:
Matthew Treinish 2017-09-15 17:12:03 -04:00
parent acce431b30
commit f7556744bb
No known key found for this signature in database
GPG Key ID: FD12A0F214C9E177
9 changed files with 21 additions and 15 deletions

1
.gitignore vendored
View File

@ -32,6 +32,7 @@ pip-log.txt
nosetests.xml
.coverage
.tox
.stestr/
.testrepository
.venv

2
.stestr.conf Normal file
View File

@ -0,0 +1,2 @@
[DEFAULT]
test_path=./storyboard/tests

View File

@ -19,9 +19,9 @@ import stat
from oslo_config import cfg
import mock_smtp as mock
from storyboard.plugin.email.base import EmailPluginBase
from storyboard.tests import base
from storyboard.tests import mock_smtp as mock
CONF = cfg.CONF

View File

@ -28,7 +28,7 @@ class TestEmailFactory(base.TestCase):
factory = EmailFactory('test@example.org',
'test_subject.txt',
'test.txt',
'plugin.email')
'storyboard.tests.plugin.email')
msg = factory.build('test_recipient@example.org',
test_parameter='value')
@ -60,7 +60,7 @@ class TestEmailFactory(base.TestCase):
factory = EmailFactory('test@example.org',
'test_subject.txt',
'test.txt',
'plugin.email')
'storyboard.tests.plugin.email')
custom_headers = {
'X-Custom-Header': 'test-header-value'
}
@ -85,7 +85,7 @@ class TestEmailFactory(base.TestCase):
factory = EmailFactory('test@example.org',
'test_subject.txt',
'test.txt',
'plugin.email')
'storyboard.tests.plugin.email')
msg = factory.build('test_recipient@example.org',
test_parameter='value')
self.assertEqual('value', msg.get('Subject'))
@ -94,7 +94,7 @@ class TestEmailFactory(base.TestCase):
factory = EmailFactory('test@example.org',
'test_long_subject.txt',
'test.txt',
'plugin.email')
'storyboard.tests.plugin.email')
msg = factory.build('test_recipient@example.org',
test_parameter='value')
self.assertEqual(78, len(msg.get('Subject')))
@ -104,7 +104,7 @@ class TestEmailFactory(base.TestCase):
factory = EmailFactory('test@example.org',
'test_subject_newline.txt',
'test.txt',
'plugin.email')
'storyboard.tests.plugin.email')
msg = factory.build('test_recipient@example.org',
test_parameter='value')
self.assertEqual('with newline', msg.get('Subject'))
@ -117,7 +117,7 @@ class TestEmailFactory(base.TestCase):
factory = EmailFactory('test@example.org',
'test_subject.txt',
'test.txt',
'plugin.email')
'storyboard.tests.plugin.email')
factory.add_text_template('test.html', 'html')
msg = factory.build('test_recipient@example.org',
@ -147,7 +147,7 @@ class TestEmailFactory(base.TestCase):
EmailFactory('test@example.org',
'invalid_subject.txt',
'invalid.txt',
'plugin.email')
'storyboard.tests.plugin.email')
self.assertFalse(True)
except TemplateNotFound:
self.assertFalse(False)
@ -156,7 +156,7 @@ class TestEmailFactory(base.TestCase):
factory = EmailFactory('test@example.org',
'test_subject.txt',
'test.txt',
'plugin.email')
'storyboard.tests.plugin.email')
factory.add_text_template('invalid.html', 'html')
self.assertFalse(True)
except TemplateNotFound:

View File

@ -14,9 +14,9 @@
from oslo_config import cfg
import mock_smtp as mock
from storyboard.plugin.email.smtp_client import get_smtp_client
from storyboard.tests import base
from storyboard.tests import mock_smtp as mock
CONF = cfg.CONF

View File

@ -22,8 +22,9 @@ class TestSchedulerBasePlugin(base.TestCase):
def test_plugin_name(self):
plugin = TestPlugin(dict())
self.assertEqual("plugin.scheduler.test_base:TestPlugin",
plugin.get_name())
self.assertEqual(
"storyboard.tests.plugin.scheduler.test_base:TestPlugin",
plugin.get_name())
class TestPlugin(SchedulerPluginBase):

View File

@ -20,11 +20,10 @@ from apscheduler.triggers.interval import IntervalTrigger
from oslo_config import cfg
from stevedore.extension import Extension
from plugin.scheduler.mock_plugin import MockPlugin
from storyboard.plugin.base import StoryboardPluginLoader
import storyboard.plugin.scheduler as scheduler
import storyboard.tests.base as base
from storyboard.tests.plugin.scheduler.mock_plugin import MockPlugin
CONF = cfg.CONF

View File

@ -6,7 +6,7 @@ mock>=1.0
python-subunit
oslo.sphinx
oslotest>=1.2.0
os-testr==0.8.2
os-testr>=1.0.0
testrepository>=0.0.18
testscenarios>=0.4,<0.5
testtools>=0.9.34

View File

@ -8,6 +8,9 @@ usedevelop = True
install_command = pip install -U {opts} {packages}
setenv =
VIRTUAL_ENV={envdir}
OS_STDERR_CAPTURE=1
OS_STDOUT_CAPTURE=1
OS_TEST_TIMEOUT=60
passenv = OS_TEST_TIMEOUT
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt