Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
erp5
Commits
30066147
Commit
30066147
authored
Jul 01, 2014
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test_result: Rewrite TestResultLine_viewResultHistory
so that test result line does not need to be indexable
parent
2a5f469b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
147 additions
and
13 deletions
+147
-13
bt5/erp5_test_result/SkinTemplateItem/portal_skins/erp5_test_result/TestResultLine_countResultHistoryList.xml
...rp5_test_result/TestResultLine_countResultHistoryList.xml
+76
-0
bt5/erp5_test_result/SkinTemplateItem/portal_skins/erp5_test_result/TestResultLine_getResultHistoryList.xml
.../erp5_test_result/TestResultLine_getResultHistoryList.xml
+28
-6
bt5/erp5_test_result/SkinTemplateItem/portal_skins/erp5_test_result/TestResultLine_viewResultHistory/listbox.xml
..._test_result/TestResultLine_viewResultHistory/listbox.xml
+43
-7
No files found.
bt5/erp5_test_result/SkinTemplateItem/portal_skins/erp5_test_result/TestResultLine_countResultHistoryList.xml
0 → 100644
View file @
30066147
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_body
</string>
</key>
<value>
<string>
"""Count all previous test result line for the same test, same\n
test suite, but for older revisions.\n
"""\n
\n
test_result = context.getParentValue()\n
query_params = {\'portal_type\': \'Test Result\',\n
\'title\': dict(query=test_result.getTitle(), key=\'ExactMatch\'),\n
\'simulation_state\': (\'stopped\', \'public_stopped\', \'failed\'),\n
}\n
return context.portal_catalog.countResults(**query_params)\n
</string>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
**kw
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
TestResultLine_countResultHistoryList
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_test_result/SkinTemplateItem/portal_skins/erp5_test_result/TestResultLine_getResultHistoryList.xml
View file @
30066147
...
...
@@ -58,19 +58,41 @@ Note that creation_date is used, but it could be nicer to use\n
the start date. However for now it is more convenient from a\n
catalog point of view\n
"""\n
\n
test_result = context.getParentValue()\n
\n
query_params = {\'creation_date\' : dict(query=context.getCreationDate(), range=\'ngt\'),\n
\'portal_type\':
context.getPortalType()
,\n
\'
title\': dict(query=context.getTitle(), key=\'ExactMatch\')
,\n
\'
parent_
title\': dict(query=test_result.getTitle(), key=\'ExactMatch\'),\n
\'simulation_state\':
\'stopped\'
,\n
\'portal_type\':
\'Test Result\'
,\n
\'
limit\': limit
,\n
\'title\': dict(query=test_result.getTitle(), key=\'ExactMatch\'),\n
\'simulation_state\':
(\'stopped\', \'public_stopped\', \'failed\')
,\n
\'sort_on\': ((\'creation_date\', \'descending\'),),}\n
return context.portal_catalog(**query_params)\n
\n
result_list = []\n
expected_id = context.getId()\n
expected_title = context.getTitle()\n
for tr in context.portal_catalog(**query_params):\n
tr = tr.getObject()\n
# Optimisation: the test result line probably have the same id in the previous\n
# test result.\n
line = getattr(tr, expected_id, None)\n
if line is not None and line.getTitle() == expected_title \\\n
and line.getSimulationState() in (\'stopped\', \'public_stopped\', \'failed\'):\n
result_list.append(line)\n
else:\n
for line in tr.contentValues(portal_type=\'Test Result Line\'):\n
if line.getTitle() == context.getTitle() \\\n
and line.getSimulationState() in (\'stopped\', \'public_stopped\', \'failed\'):\n
result_list.append(line)\n
# next time, the test result line will likely have the same id as this one.\n
expected_id = line.getId()\n
\n
return result_list\n
</string>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
**kw
</string>
</value>
<value>
<string>
limit,
**kw
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
...
...
bt5/erp5_test_result/SkinTemplateItem/portal_skins/erp5_test_result/TestResultLine_viewResultHistory/listbox.xml
View file @
30066147
...
...
@@ -394,12 +394,18 @@
</item>
<item>
<key>
<string>
count_method
</string>
</key>
<value>
<string></string>
</value>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
css_class
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
default_display_style
</string>
</key>
<value>
<string>
table
</string>
</value>
</item>
<item>
<key>
<string>
default_params
</string>
</key>
<value>
...
...
@@ -410,6 +416,12 @@
<key>
<string>
description
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
display_style_list
</string>
</key>
<value>
<list/>
</value>
</item>
<item>
<key>
<string>
domain_root_list
</string>
</key>
<value>
...
...
@@ -449,6 +461,10 @@
<list/>
</value>
</item>
<item>
<key>
<string>
global_search_column
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
hidden
</string>
</key>
<value>
<int>
0
</int>
</value>
...
...
@@ -459,7 +475,7 @@
</item>
<item>
<key>
<string>
lines
</string>
</key>
<value>
<int>
20
</int>
</value>
<value>
<int>
15
</int>
</value>
</item>
<item>
<key>
<string>
list_action
</string>
</key>
...
...
@@ -468,7 +484,7 @@
<item>
<key>
<string>
list_method
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
I
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
</value>
</item>
<item>
...
...
@@ -477,6 +493,10 @@
<list/>
</value>
</item>
<item>
<key>
<string>
page_navigation_template
</string>
</key>
<value>
<string>
ListBox_viewSliderPageNavigationRenderer
</string>
</value>
</item>
<item>
<key>
<string>
page_template
</string>
</key>
<value>
<string></string>
</value>
...
...
@@ -541,6 +561,12 @@
<key>
<string>
stat_method
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
style_columns
</string>
</key>
<value>
<list/>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
listbox
</string>
</value>
...
...
@@ -565,10 +591,20 @@
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<tuple>
<global
name=
"Method"
module=
"Products.Formulator.MethodField"
/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
method_name
</string>
</key>
<value>
<string>
TestResultLine_countResultHistoryList
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"Method"
module=
"Products.Formulator.MethodField"
/>
</pickle>
<pickle>
<dictionary>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment