Commit bb106904 authored by Vincent Pelletier's avatar Vincent Pelletier

Document mysql_db_count property.

That property can be used to request more databases in a given suite.
This removes the need of fetching an hardcoded number of connection strings
at an hardcoded position in mysql_db_list, which in turns fixes a python
mistake ("string + list").
parent ee7eafb4
...@@ -83,6 +83,13 @@ class Persistent(object): ...@@ -83,6 +83,13 @@ class Persistent(object):
self._db.truncate() self._db.truncate()
class TestSuite(object): class TestSuite(object):
"""
Subclasses may redefine the following properties:
mysql_db_count (integer, >=1)
Maximum number of SQL databases connection strings needed by any tests ran
in this suite. Tests will get mysql_db_count - 1 connection strings in
extra_sql_connection_string_list environment variable.
"""
mysql_db_count = 1 mysql_db_count = 1
allow_restart = False allow_restart = False
...@@ -208,8 +215,7 @@ class ERP5TypeTestSuite(TestSuite): ...@@ -208,8 +215,7 @@ class ERP5TypeTestSuite(TestSuite):
runUnitTest = os.environ.get('RUN_UNIT_TEST', runUnitTest = os.environ.get('RUN_UNIT_TEST',
'runUnitTest') 'runUnitTest')
args = tuple(shlex.split(runUnitTest)) \ args = tuple(shlex.split(runUnitTest)) \
+ ('--verbose', '--erp5_sql_connection_string=' + mysql_db_list[0], + ('--verbose', '--erp5_sql_connection_string=' + mysql_db_list[0]) \
'--extra_sql_connection_string_list='+mysql_db_list[-4:]) \
+ args + args
status_dict = self.spawn(*args, **kw) status_dict = self.spawn(*args, **kw)
except SubprocessError, e: except SubprocessError, e:
......
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