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
1
Issues
1
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
Roque
erp5
Commits
d0d81795
Commit
d0d81795
authored
Jun 11, 2013
by
Benjamin Blanc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Patch testERP5testnode
parent
de127a95
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
0 deletions
+38
-0
erp5/tests/testERP5TestNode.py
erp5/tests/testERP5TestNode.py
+6
-0
product/ERP5/Document/ERP5ProjectUnitTestDistributor.py
product/ERP5/Document/ERP5ProjectUnitTestDistributor.py
+32
-0
No files found.
erp5/tests/testERP5TestNode.py
View file @
d0d81795
...
@@ -513,7 +513,9 @@ branch = foo
...
@@ -513,7 +513,9 @@ branch = foo
RunnerClass
=
self
.
returnGoodClassRunner
(
my_type_test
)
RunnerClass
=
self
.
returnGoodClassRunner
(
my_type_test
)
# Patch
# Patch
original_startTestSuite
=
TaskDistributor
.
startTestSuite
original_startTestSuite
=
TaskDistributor
.
startTestSuite
original_subscribeNode
=
TaskDistributor
.
subscribeNode
TaskDistributor
.
startTestSuite
=
patch_startTestSuite
TaskDistributor
.
startTestSuite
=
patch_startTestSuite
TaskDistributor
.
subscribeNode
=
doNothing
original_createTestResult
=
TaskDistributionTool
.
createTestResult
original_createTestResult
=
TaskDistributionTool
.
createTestResult
TaskDistributionTool
.
createTestResult
=
patch_createTestResult
TaskDistributionTool
.
createTestResult
=
patch_createTestResult
# TestNode
# TestNode
...
@@ -531,6 +533,7 @@ branch = foo
...
@@ -531,6 +533,7 @@ branch = foo
# Restore old class methods
# Restore old class methods
TaskDistributor
.
startTestSuite
=
original_startTestSuite
TaskDistributor
.
startTestSuite
=
original_startTestSuite
TaskDistributionTool
.
createTestResult
=
original_createTestResult
TaskDistributionTool
.
createTestResult
=
original_createTestResult
TaskDistributionTool
.
subscribeNode
=
original_subscribeNode
RunnerClass
.
_prepareSlapOS
=
original_prepareSlapOS
RunnerClass
.
_prepareSlapOS
=
original_prepareSlapOS
RunnerClass
.
runTestSuite
=
original_runTestSuite
RunnerClass
.
runTestSuite
=
original_runTestSuite
...
@@ -620,7 +623,9 @@ branch = foo
...
@@ -620,7 +623,9 @@ branch = foo
time
.
sleep
=
doNothing
time
.
sleep
=
doNothing
self
.
generateTestRepositoryList
()
self
.
generateTestRepositoryList
()
original_startTestSuite
=
TaskDistributor
.
startTestSuite
original_startTestSuite
=
TaskDistributor
.
startTestSuite
original_subscribeNode
=
TaskDistributor
.
subscribeNode
TaskDistributor
.
startTestSuite
=
patch_startTestSuite
TaskDistributor
.
startTestSuite
=
patch_startTestSuite
TaskDistributor
.
subscribeNode
=
patch_subscribeNode
original_createTestResult
=
TaskDistributionTool
.
createTestResult
original_createTestResult
=
TaskDistributionTool
.
createTestResult
TaskDistributionTool
.
createTestResult
=
patch_createTestResult
TaskDistributionTool
.
createTestResult
=
patch_createTestResult
test_node
=
self
.
getTestNode
()
test_node
=
self
.
getTestNode
()
...
@@ -637,6 +642,7 @@ branch = foo
...
@@ -637,6 +642,7 @@ branch = foo
# Restore old class methods
# Restore old class methods
TaskDistributor
.
startTestSuite
=
original_startTestSuite
TaskDistributor
.
startTestSuite
=
original_startTestSuite
TaskDistributionTool
.
createTestResult
=
original_createTestResult
TaskDistributionTool
.
createTestResult
=
original_createTestResult
TaskDistributionTool
.
subscribeNode
=
original_subscribeNode
RunnerClass
.
_prepareSlapOS
=
original_prepareSlapOS
RunnerClass
.
_prepareSlapOS
=
original_prepareSlapOS
RunnerClass
.
runTestSuite
=
original_runTestSuite
RunnerClass
.
runTestSuite
=
original_runTestSuite
...
...
product/ERP5/Document/ERP5ProjectUnitTestDistributor.py
View file @
d0d81795
...
@@ -190,6 +190,38 @@ class ERP5ProjectUnitTestDistributor(XMLObject):
...
@@ -190,6 +190,38 @@ class ERP5ProjectUnitTestDistributor(XMLObject):
"task_distribution"
,
"default_memcached_plugin"
)
"task_distribution"
,
"default_memcached_plugin"
)
return
memcached_dict
return
memcached_dict
security
.
declarePublic
(
"subscribeNode"
)
def
subscribeNode
(
self
,
title
,
computer_guid
,
batch_mode
=
0
):
"""
subscribeNode doc
"""
test_node_module
=
self
.
_getTestNodeModule
()
portal
=
self
.
getPortalObject
()
tag
=
"%s_%s"
%
(
self
.
getRelativeUrl
(),
title
)
if
portal
.
portal_activities
.
countMessageWithTag
(
tag
)
==
0
:
test_node_list
=
test_node_module
.
searchFolder
(
portal_type
=
"Test Node"
,
title
=
title
)
assert
len
(
test_node_list
)
in
(
0
,
1
),
"Unable to find testnode : %s"
%
title
test_node
=
None
if
len
(
test_node_list
)
==
1
:
test_node
=
test_node_list
[
0
].
getObject
()
if
test_node
.
getValidationState
()
!=
'validated'
:
try
:
test_node
.
validate
()
except
e
:
LOG
(
'Test Node Validate'
,
ERROR
,
'%s'
%
e
)
if
test_node
is
None
:
test_node
=
test_node_module
.
newContent
(
portal_type
=
"Test Node"
,
title
=
title
,
computer_guid
=
computer_guid
,
specialise
=
self
.
getRelativeUrl
(),
activate_kw
=
{
'tag'
:
tag
})
self
.
activate
(
after_tag
=
tag
).
optimizeConfiguration
()
test_node
.
setPingDate
()
return
test_node
return
None
security
.
declarePublic
(
"startTestSuite"
)
security
.
declarePublic
(
"startTestSuite"
)
def
startTestSuite
(
self
,
title
,
batch_mode
=
0
):
def
startTestSuite
(
self
,
title
,
batch_mode
=
0
):
"""
"""
...
...
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