From: Jenkins Date: Thu, 13 Mar 2014 22:50:26 +0000 (+0000) Subject: Merge "Use debug level logging during unit tests" X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=4c396f8d45b988940f3fc6a51735c7dabb01ae0d;p=openstack-build%2Fcinder-build.git Merge "Use debug level logging during unit tests" --- 4c396f8d45b988940f3fc6a51735c7dabb01ae0d diff --cc cinder/test.py index 2c846c6e8,dbd45ec7d..7ba8e4942 --- a/cinder/test.py +++ b/cinder/test.py @@@ -27,9 -28,9 +27,10 @@@ import tempfil import uuid import fixtures + import logging import mox from oslo.config import cfg +from oslo.messaging import conffixture as messaging_conffixture import stubout import testtools from testtools import matchers @@@ -37,12 -38,11 +38,12 @@@ from cinder.common import config # noqa Need to register global_opts from cinder.db import migration from cinder.openstack.common.db.sqlalchemy import session - from cinder.openstack.common import log as logging + from cinder.openstack.common import log as oslo_logging from cinder.openstack.common import timeutils +from cinder import rpc from cinder import service from cinder.tests import conf_fixture - +from cinder.tests import fake_notifier test_opts = [ cfg.StrOpt('sqlite_clean_db', @@@ -129,19 -129,9 +130,20 @@@ class TestCase(testtools.TestCase) stderr = self.useFixture(fixtures.StringStream('stderr')).stream self.useFixture(fixtures.MonkeyPatch('sys.stderr', stderr)) - self.log_fixture = self.useFixture(fixtures.FakeLogger()) + self.log_fixture = self.useFixture(fixtures.FakeLogger( + level=logging.DEBUG)) + rpc.add_extra_exmods("cinder.tests") + self.addCleanup(rpc.clear_extra_exmods) + self.addCleanup(rpc.cleanup) + + fs = '%(levelname)s [%(name)s] %(message)s' + self.messaging_conf = messaging_conffixture.ConfFixture(CONF) + self.messaging_conf.transport_driver = 'fake' + self.messaging_conf.response_timeout = 15 + self.useFixture(self.messaging_conf) + rpc.init(CONF) + conf_fixture.set_defaults(CONF) CONF([], default_config_files=[])