Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5-Boxiang
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
Hamza
erp5-Boxiang
Commits
817335fc
Commit
817335fc
authored
Oct 03, 2016
by
Sebastien Robin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_test_result: avoid relaunching test on an already tested revision
parent
f7050220
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
11 deletions
+47
-11
bt5/erp5_test_result/TestTemplateItem/portal_components/test.erp5.testTaskDistribution.py
...eItem/portal_components/test.erp5.testTaskDistribution.py
+32
-0
product/ERP5/Tool/TaskDistributionTool.py
product/ERP5/Tool/TaskDistributionTool.py
+15
-11
No files found.
bt5/erp5_test_result/TestTemplateItem/portal_components/test.erp5.testTaskDistribution.py
View file @
817335fc
...
...
@@ -333,6 +333,38 @@ class TestTaskDistribution(ERP5TypeTestCase):
self
.
assertEqual
((
test_result_path
,
revision
),
result
)
next_line_url
,
next_test
=
self
.
tool
.
startUnitTest
(
test_result_path
)
def
test_05b_createTestResultDoesNotReexecuteRevision
(
self
):
"""
Make sure to no retest former revision. This scenario must work
- testnode call createTestResult with revision r0=b. Test is executed
- By hand is created test with revision r0=a (to make testnode checking old
revision). Test is executed
- if testnode ask again for r0=b, no test must be created
- if testnode ask for r0=c, then usual test is created/executed
"""
# launch test r0=b
test_result_path
,
revision
=
self
.
_createTestResult
(
revision
=
"r0=b"
,
test_list
=
[
"testFoo"
])
line_url
,
test
=
self
.
tool
.
startUnitTest
(
test_result_path
)
status_dict
=
{}
self
.
tool
.
stopUnitTest
(
line_url
,
status_dict
)
test_result
=
self
.
getPortalObject
().
unrestrictedTraverse
(
test_result_path
)
self
.
assertEqual
(
"stopped"
,
test_result
.
getSimulationState
())
# launch test r0=a
test_result_path
,
revision
=
self
.
_createTestResult
(
revision
=
"r0=a"
,
test_list
=
[
"testFoo"
])
line_url
,
test
=
self
.
tool
.
startUnitTest
(
test_result_path
)
self
.
tool
.
stopUnitTest
(
line_url
,
status_dict
)
test_result
=
self
.
getPortalObject
().
unrestrictedTraverse
(
test_result_path
)
self
.
assertEqual
(
"stopped"
,
test_result
.
getSimulationState
())
# Make sure we do not relaunch test with revision r0=b
result
=
self
.
_createTestResult
(
revision
=
"r0=b"
,
test_list
=
[
"testFoo"
])
self
.
assertEqual
(
None
,
result
)
# launch test r0=c
test_result_path
,
revision
=
self
.
_createTestResult
(
revision
=
"r0=c"
,
test_list
=
[
"testFoo"
])
line_url
,
test
=
self
.
tool
.
startUnitTest
(
test_result_path
)
self
.
tool
.
stopUnitTest
(
line_url
,
status_dict
)
test_result
=
self
.
getPortalObject
().
unrestrictedTraverse
(
test_result_path
)
self
.
assertEqual
(
"stopped"
,
test_result
.
getSimulationState
())
def
test_06_startStopUnitTest
(
self
):
"""
We will check methods startUnitTest/stopUnitTest of task distribution tool
...
...
product/ERP5/Tool/TaskDistributionTool.py
View file @
817335fc
...
...
@@ -125,12 +125,12 @@ class TaskDistributionTool(BaseTool):
else
:
# backward compatibility
int_index
,
reference
=
revision
result_list
=
portal
.
test_result_module
.
searchFolder
(
portal_type
=
"Test Result"
,
title
=
SimpleQuery
(
comparison_operator
=
'='
,
title
=
test_title
),
sort_on
=
((
"creation_date"
,
"descending"
),
),
query
=
NegatedQuery
(
SimpleQuery
(
simulation_state
=
"cancelled"
)),
limit
=
1
)
catalog_kw
=
{
'portal_type'
:
'Test Result'
,
'title'
:
SimpleQuery
(
comparison_operator
=
'='
,
title
=
test_title
)
,
'sort_on'
:
((
"creation_date"
,
"descending"
),
),
'query'
:
NegatedQuery
(
SimpleQuery
(
simulation_state
=
"cancelled"
)
),
'limit'
:
1
}
result_list
=
portal
.
test_result_module
.
searchFolder
(
**
catalog_kw
)
if
result_list
:
test_result
=
result_list
[
0
].
getObject
()
if
test_result
is
not
None
:
...
...
@@ -154,11 +154,15 @@ class TaskDistributionTool(BaseTool):
return
return
test_result
.
getRelativeUrl
(),
last_revision
if
last_state
in
(
'stopped'
,
'public_stopped'
):
if
not
allow_restart
:
if
reference_list_string
is
not
None
:
if
reference_list_string
==
test_result
.
getReference
()
\
and
not
allow_restart
:
if
reference_list_string
==
test_result
.
getReference
():
return
if
portal
.
test_result_module
.
searchFolder
(
reference
=
SimpleQuery
(
comparison_operator
=
'='
,
reference
=
reference_list_string
),
**
catalog_kw
):
return
elif
last_revision
==
int_index
and
not
allow_restart
:
if
last_revision
==
int_index
:
return
test_result
=
portal
.
test_result_module
.
newContent
(
portal_type
=
'Test Result'
,
...
...
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