Commit 01aef474 authored by Sebastien Robin's avatar Sebastien Robin

erp5_test_result: various small improvements to improve usability

parent a92a6dfd
...@@ -27,9 +27,9 @@ if query: ...@@ -27,9 +27,9 @@ if query:
revision_list = [] revision_list = []
for revision_part in revision.split(','): for revision_part in revision.split(','):
repository, commit_hash = revision_part.split('-') repository, commit_hash = revision_part.split('-')
revision_list.append('%s-%s' % (repository, commit_hash[0:8])) revision_list.append('%s-%s' % (repository, commit_hash[0:7]))
revision = ",".join(revision_list) revision = ",".join(revision_list)
test_result = {'revision': str(revision)} test_result = {'revision': str(revision) + '|' + test.getStartDate().strftime("%Y/%m/%d")}
test_result_list.append(test_result) test_result_list.append(test_result)
for prop in 'all_tests', 'failures', 'errors': for prop in 'all_tests', 'failures', 'errors':
test_result[prop] = test_result.get(prop, 0) + test.getProperty(prop, 0) test_result[prop] = test_result.get(prop, 0) + test.getProperty(prop, 0)
......
...@@ -7,7 +7,7 @@ list_method_template = "" ...@@ -7,7 +7,7 @@ list_method_template = ""
# it allows to make jio.all_docs calling a python script # it allows to make jio.all_docs calling a python script
# http://10.0.80.187:2200/erp5/web_site_module/renderjs_runner/hateoas/ERP5Document_getHateoas # http://10.0.80.187:2200/erp5/web_site_module/renderjs_runner/hateoas/ERP5Document_getHateoas
portal = context.getPortalObject() portal = context.getPortalObject()
custom_search_template_no_editable = "%(root_url)s/%(script_id)s?mode=search" + \ custom_search_template_no_editable = "%(root_url)s/hateoas/%(script_id)s?mode=search" + \
"&relative_url=%(relative_url)s" \ "&relative_url=%(relative_url)s" \
"&list_method=%(list_method)s" \ "&list_method=%(list_method)s" \
"&default_param_json=%(default_param_json)s" \ "&default_param_json=%(default_param_json)s" \
......
...@@ -11,15 +11,17 @@ test_dict = {'objective time to view object form': 'view_object', ...@@ -11,15 +11,17 @@ test_dict = {'objective time to view object form': 'view_object',
for result_line in context.objectValues(portal_type='Test Result Line'): for result_line in context.objectValues(portal_type='Test Result Line'):
test = {} test = {}
object_count = None object_count = None
for line in result_line.getProperty('stdout').splitlines(): stdout = result_line.getProperty('stdout') or ''
for k, v in test_dict.items(): if stdout:
if k in line: for line in result_line.getProperty('stdout').splitlines():
test['%' in v and v % object_count or v] = \ for k, v in test_dict.items():
float(line.split('<')[1].strip()) if k in line:
break test['%' in v and v % object_count or v] = \
else: float(line.split('<')[1].strip())
if line.startswith('nb objects ='): break
object_count = int(line.split()[-1]) else:
test_list.append(test) if line.startswith('nb objects ='):
object_count = int(line.split()[-1])
test_list.append(test)
return test_list return test_list
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>anchor</string>
<string>columns</string> <string>columns</string>
<string>portal_types</string> <string>portal_types</string>
<string>title</string> <string>title</string>
...@@ -73,6 +74,10 @@ ...@@ -73,6 +74,10 @@
<key> <string>values</string> </key> <key> <string>values</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>anchor</string> </key>
<value> <int>1</int> </value>
</item>
<item> <item>
<key> <string>columns</string> </key> <key> <string>columns</string> </key>
<value> <value>
......
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