Commit 7b54a6b3 authored by Julien Muchembled's avatar Julien Muchembled

tests: ignore NEO_TESTS_ADAPTER in tests requiring a SQL database

Although some tests of testStorage and testPack don't need a SQL database,
this patch applies to the whole class for simplicity's sake.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2723 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent e41dbfef
......@@ -218,10 +218,12 @@ class NEOCluster(object):
db_user='neo', db_password='neo',
db_super_user=DB_ADMIN, db_super_password=DB_PASSWD,
cleanup_on_delete=False, temp_dir=None, clear_databases=True,
adapter=os.getenv('NEO_TESTS_ADAPTER', 'MySQL'),
adapter=os.getenv('NEO_TESTS_ADAPTER'),
verbose=True,
address_type=ADDRESS_TYPE,
):
if not adapter:
adapter = 'MySQL'
self.zodb_storage_list = []
self.cleanup_on_delete = cleanup_on_delete
self.verbose = verbose
......
......@@ -84,7 +84,7 @@ class ClusterTests(NEOFunctionalTest):
class PObject(Persistent):
pass
self.neo = NEOCluster(['test_neo1'], replicas=0,
temp_dir=self.getTempDirectory())
temp_dir=self.getTempDirectory(), adapter='MySQL')
neoctl = self.neo.getNEOCTL()
self.neo.start()
db, conn = self.neo.getZODBConnection()
......
......@@ -58,6 +58,7 @@ class StorageTests(NEOFunctionalTest):
partitions=partitions, replicas=replicas,
temp_dir=self.getTempDirectory(),
clear_databases=True,
adapter='MySQL',
)
# too many pending storage nodes requested
assert pending_number <= storage_number
......
......@@ -23,7 +23,7 @@ import neo.lib
class ZODBTestCase(NEOFunctionalTest):
def setUp(self):
def setUp(self, cluster_kw={}):
NEOFunctionalTest.setUp(self)
masters = int(os.environ.get('NEO_TEST_ZODB_MASTERS', 1))
storages = int(os.environ.get('NEO_TEST_ZODB_STORAGES', 1))
......@@ -35,7 +35,7 @@ class ZODBTestCase(NEOFunctionalTest):
replicas=replicas,
master_node_count=masters,
temp_dir=self.getTempDirectory(),
)
**cluster_kw)
self.neo.start()
self._storage = self.neo.getZODBStorage()
......
......@@ -29,7 +29,9 @@ from neo.tests.zodb import ZODBTestCase
class PackableTests(ZODBTestCase, StorageTestBase,
PackableStorageWithOptionalGC, PackableUndoStorage):
pass
def setUp(self):
super(PackableTests, self).setUp(cluster_kw={'adapter': 'MySQL'})
if __name__ == "__main__":
suite = unittest.makeSuite(PackableTests, 'check')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment