Commit 0ad8ea27 authored by Xiaowu Zhang's avatar Xiaowu Zhang Committed by Rafael Monnerat

ERP5TypeTestCase&runUnitTest: set default conversion server retry count in test

/reviewed-on nexedi/erp5!671
parent 7141fe5c
...@@ -141,6 +141,11 @@ def _getConversionServerUrl(): ...@@ -141,6 +141,11 @@ def _getConversionServerUrl():
'Using %s as conversion_server_url instead' % url, DeprecationWarning) 'Using %s as conversion_server_url instead' % url, DeprecationWarning)
return url return url
def _getConversionServerRetryCount():
""" Return retry count for Conversion Server (Cloudooo)
"""
return os.environ.get('conversion_server_retry_count', 2)
def _getVolatileMemcachedServerDict(): def _getVolatileMemcachedServerDict():
"""Returns a dict with hostname and port for volatile memcached Server """Returns a dict with hostname and port for volatile memcached Server
""" """
...@@ -952,6 +957,9 @@ class ERP5TypeCommandLineTestCase(ERP5TypeTestCaseMixin): ...@@ -952,6 +957,9 @@ class ERP5TypeCommandLineTestCase(ERP5TypeTestCaseMixin):
url = _getConversionServerUrl() url = _getConversionServerUrl()
pref = self.getDefaultSystemPreference() pref = self.getDefaultSystemPreference()
pref._setPreferredDocumentConversionServerUrl(url) pref._setPreferredDocumentConversionServerUrl(url)
# set default retry count in test for network issue
retry_count = _getConversionServerRetryCount()
pref._setPreferredDocumentConversionServerRetry(retry_count)
def _updateMemcachedConfiguration(self): def _updateMemcachedConfiguration(self):
"""Update default memcached plugin configuration """Update default memcached plugin configuration
......
...@@ -103,6 +103,8 @@ Options: ...@@ -103,6 +103,8 @@ Options:
URL used to connect to document conversion server, URL used to connect to document conversion server,
this value will stored at default preference. this value will stored at default preference.
Empty by default. Empty by default.
--conversion_server_retry_count=INTEGER
Retry Count for conversion error in case of network issue
--conversion_server_hostname=STRING --conversion_server_hostname=STRING
Hostname used to connect to conversion server (Oood), Hostname used to connect to conversion server (Oood),
this value will stored at default preference. this value will stored at default preference.
...@@ -703,6 +705,7 @@ def main(argument_list=None): ...@@ -703,6 +705,7 @@ def main(argument_list=None):
"cmf_activity_sql_connection_string=", "cmf_activity_sql_connection_string=",
"extra_sql_connection_string_list=", "extra_sql_connection_string_list=",
"conversion_server_url=", "conversion_server_url=",
"conversion_server_retry_count=",
"conversion_server_port=", "conversion_server_port=",
"conversion_server_hostname=", "conversion_server_hostname=",
"volatile_memcached_server_port=", "volatile_memcached_server_port=",
...@@ -805,6 +808,8 @@ def main(argument_list=None): ...@@ -805,6 +808,8 @@ def main(argument_list=None):
os.environ["update_business_templates"] = "1" os.environ["update_business_templates"] = "1"
elif opt == "--conversion_server_url": elif opt == "--conversion_server_url":
os.environ["conversion_server_url"] = arg os.environ["conversion_server_url"] = arg
elif opt == "--conversion_server_retry_count":
os.environ["conversion_server_retry_count"] = arg
elif opt == "--conversion_server_hostname": elif opt == "--conversion_server_hostname":
os.environ["conversion_server_hostname"] = arg os.environ["conversion_server_hostname"] = arg
elif opt == "--conversion_server_port": elif opt == "--conversion_server_port":
......
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