Skip to content

Commit

Permalink
Merge "Improve unit test times"
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins authored and openstack-gerrit committed Oct 8, 2012
2 parents 284fb8a + 9aac057 commit cd89dfa
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 9 deletions.
3 changes: 1 addition & 2 deletions quantum/db/db_base_plugin_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@


LOG = logging.getLogger(__name__)
TEST_DB = "quantum.test.db"

AGENT_OWNER_PREFIX = 'network:'

Expand Down Expand Up @@ -72,7 +71,7 @@ def __init__(self):
# must override __init__ and setup the database
# and not call into this class's __init__.
# This connection is setup as memory for the tests.
db.configure_db({'sql_connection': "sqlite:///%s" % TEST_DB,
db.configure_db({'sql_connection': "sqlite:///:memory:",
'base': models_v2.model_base.BASEV2})

def _get_tenant_id_for_create(self, context, resource):
Expand Down
2 changes: 1 addition & 1 deletion quantum/tests/etc/quantum.conf.test
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ api_paste_config = api-paste.ini.test
rpc_backend = quantum.openstack.common.rpc.impl_fake

[DATABASE]
sql_connection = 'sqlite:///quantum.test.db'
sql_connection = 'sqlite:///:memory:'
2 changes: 1 addition & 1 deletion quantum/tests/unit/cisco/test_network_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class CiscoNetworkPluginV2TestCase(test_db_plugin.QuantumDbPluginV2TestCase):

def setUp(self):
def new_init():
db.configure_db({'sql_connection': 'sqlite:///quantum.test.db',
db.configure_db({'sql_connection': 'sqlite:///:memory:',
'base': network_models_v2.model_base.BASEV2})

with mock.patch.object(network_db_v2,
Expand Down
2 changes: 1 addition & 1 deletion quantum/tests/unit/ryu/test_ryu_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

class RyuDBTest(unittest2.TestCase):
def setUp(self):
options = {"sql_connection": 'sqlite:///quantum.test.db'}
options = {"sql_connection": 'sqlite:///:memory:'}
options.update({'base': models_v2.model_base.BASEV2})
reconnect_interval = cfg.CONF.DATABASE.reconnect_interval
options.update({"reconnect_interval": reconnect_interval})
Expand Down
3 changes: 0 additions & 3 deletions quantum/tests/unit/test_db_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,6 @@ def tearDown(self):
cfg.CONF.reset()
# Restore the original attribute map
attributes.RESOURCE_ATTRIBUTE_MAP = self._attribute_map_bk
# Remove test database
if os.path.exists(db_base_plugin_v2.TEST_DB):
os.remove('quantum.test.db')

def _req(self, method, resource, data=None, fmt='json',
id=None, params=None, action=None):
Expand Down
2 changes: 1 addition & 1 deletion tools/pip-requires
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ lxml
netaddr
python-quantumclient>=2.0
pyudev
sqlalchemy>0.6.4
sqlalchemy>=0.7.8
webob==1.0.8

0 comments on commit cd89dfa

Please sign in to comment.