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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
francois
erp5
Commits
366b0144
Commit
366b0144
authored
Jun 11, 2013
by
Benjamin Blanc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve testERP5testnode, still not working
parent
d1d0c449
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
12 deletions
+21
-12
erp5/tests/testERP5TestNode.py
erp5/tests/testERP5TestNode.py
+12
-2
erp5/util/testnode/testnode.py
erp5/util/testnode/testnode.py
+9
-10
No files found.
erp5/tests/testERP5TestNode.py
View file @
366b0144
...
@@ -460,6 +460,8 @@ branch = foo
...
@@ -460,6 +460,8 @@ branch = foo
def
test_11_run
(
self
,
my_type_test
=
'UnitTest'
):
def
test_11_run
(
self
,
my_type_test
=
'UnitTest'
):
def
doNothing
(
self
,
*
args
,
**
kw
):
def
doNothing
(
self
,
*
args
,
**
kw
):
pass
pass
def
patch_getTestType
(
self
):
return
my_type_test
test_self
=
self
test_self
=
self
test_result_path_root
=
os
.
path
.
join
(
test_self
.
_temp_dir
,
'test/results'
)
test_result_path_root
=
os
.
path
.
join
(
test_self
.
_temp_dir
,
'test/results'
)
os
.
makedirs
(
test_result_path_root
)
os
.
makedirs
(
test_result_path_root
)
...
@@ -514,8 +516,10 @@ branch = foo
...
@@ -514,8 +516,10 @@ branch = foo
# Patch
# Patch
original_startTestSuite
=
TaskDistributor
.
startTestSuite
original_startTestSuite
=
TaskDistributor
.
startTestSuite
original_subscribeNode
=
TaskDistributor
.
subscribeNode
original_subscribeNode
=
TaskDistributor
.
subscribeNode
original_getTestType
=
TaskDistributor
.
getTestType
TaskDistributor
.
startTestSuite
=
patch_startTestSuite
TaskDistributor
.
startTestSuite
=
patch_startTestSuite
TaskDistributor
.
subscribeNode
=
doNothing
TaskDistributor
.
subscribeNode
=
doNothing
TaskDistributor
.
getTestType
=
patch_getTestType
original_createTestResult
=
TaskDistributionTool
.
createTestResult
original_createTestResult
=
TaskDistributionTool
.
createTestResult
TaskDistributionTool
.
createTestResult
=
patch_createTestResult
TaskDistributionTool
.
createTestResult
=
patch_createTestResult
# TestNode
# TestNode
...
@@ -527,13 +531,14 @@ branch = foo
...
@@ -527,13 +531,14 @@ branch = foo
RunnerClass
.
runTestSuite
=
doNothing
RunnerClass
.
runTestSuite
=
doNothing
SlapOSControler
.
initializeSlapOSControler
=
doNothing
SlapOSControler
.
initializeSlapOSControler
=
doNothing
# Inside test_node a runner is created using new UnitTestRunner methods
# Inside test_node a runner is created using new UnitTestRunner methods
test_node
.
run
(
my_type_test
)
test_node
.
run
()
self
.
assertEquals
(
5
,
counter
)
self
.
assertEquals
(
5
,
counter
)
time
.
sleep
=
original_sleep
time
.
sleep
=
original_sleep
# 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
TaskDistributionTool
.
subscribeNode
=
original_subscribeNode
TaskDistributionTool
.
getTestType
=
original_getTestType
RunnerClass
.
_prepareSlapOS
=
original_prepareSlapOS
RunnerClass
.
_prepareSlapOS
=
original_prepareSlapOS
RunnerClass
.
runTestSuite
=
original_runTestSuite
RunnerClass
.
runTestSuite
=
original_runTestSuite
...
@@ -577,6 +582,8 @@ branch = foo
...
@@ -577,6 +582,8 @@ branch = foo
def
test_15_suite_log_directory
(
self
,
my_type_test
=
'UnitTest'
):
def
test_15_suite_log_directory
(
self
,
my_type_test
=
'UnitTest'
):
def
doNothing
(
self
,
*
args
,
**
kw
):
def
doNothing
(
self
,
*
args
,
**
kw
):
pass
pass
def
patch_getTestType
(
self
):
return
my_type_test
test_self
=
self
test_self
=
self
test_result_path_root
=
os
.
path
.
join
(
test_self
.
_temp_dir
,
'test/results'
)
test_result_path_root
=
os
.
path
.
join
(
test_self
.
_temp_dir
,
'test/results'
)
os
.
makedirs
(
test_result_path_root
)
os
.
makedirs
(
test_result_path_root
)
...
@@ -624,8 +631,10 @@ branch = foo
...
@@ -624,8 +631,10 @@ branch = foo
self
.
generateTestRepositoryList
()
self
.
generateTestRepositoryList
()
original_startTestSuite
=
TaskDistributor
.
startTestSuite
original_startTestSuite
=
TaskDistributor
.
startTestSuite
original_subscribeNode
=
TaskDistributor
.
subscribeNode
original_subscribeNode
=
TaskDistributor
.
subscribeNode
original_getTestType
=
TaskDistributor
.
getTestType
TaskDistributor
.
startTestSuite
=
patch_startTestSuite
TaskDistributor
.
startTestSuite
=
patch_startTestSuite
TaskDistributor
.
subscribeNode
=
doNothing
TaskDistributor
.
subscribeNode
=
doNothing
TaskDistributor
.
getTestType
=
patch_getTestType
original_createTestResult
=
TaskDistributionTool
.
createTestResult
original_createTestResult
=
TaskDistributionTool
.
createTestResult
TaskDistributionTool
.
createTestResult
=
patch_createTestResult
TaskDistributionTool
.
createTestResult
=
patch_createTestResult
test_node
=
self
.
getTestNode
()
test_node
=
self
.
getTestNode
()
...
@@ -635,7 +644,7 @@ branch = foo
...
@@ -635,7 +644,7 @@ branch = foo
original_runTestSuite
=
RunnerClass
.
runTestSuite
original_runTestSuite
=
RunnerClass
.
runTestSuite
RunnerClass
.
runTestSuite
=
doNothing
RunnerClass
.
runTestSuite
=
doNothing
SlapOSControler
.
initializeSlapOSControler
=
doNothing
SlapOSControler
.
initializeSlapOSControler
=
doNothing
test_node
.
run
(
my_type_test
)
test_node
.
run
()
self
.
assertEquals
(
counter
,
3
)
self
.
assertEquals
(
counter
,
3
)
checkTestSuite
(
test_node
)
checkTestSuite
(
test_node
)
time
.
sleep
=
original_sleep
time
.
sleep
=
original_sleep
...
@@ -643,6 +652,7 @@ branch = foo
...
@@ -643,6 +652,7 @@ branch = foo
TaskDistributor
.
startTestSuite
=
original_startTestSuite
TaskDistributor
.
startTestSuite
=
original_startTestSuite
TaskDistributionTool
.
createTestResult
=
original_createTestResult
TaskDistributionTool
.
createTestResult
=
original_createTestResult
TaskDistributionTool
.
subscribeNode
=
original_subscribeNode
TaskDistributionTool
.
subscribeNode
=
original_subscribeNode
TaskDistributionTool
.
getTestType
=
original_getTestType
RunnerClass
.
_prepareSlapOS
=
original_prepareSlapOS
RunnerClass
.
_prepareSlapOS
=
original_prepareSlapOS
RunnerClass
.
runTestSuite
=
original_runTestSuite
RunnerClass
.
runTestSuite
=
original_runTestSuite
...
...
erp5/util/testnode/testnode.py
View file @
366b0144
...
@@ -304,7 +304,7 @@ branch = %(branch)s
...
@@ -304,7 +304,7 @@ branch = %(branch)s
self
.
_cleanupLog
()
self
.
_cleanupLog
()
self
.
_cleanupTemporaryFiles
()
self
.
_cleanupTemporaryFiles
()
def
run
(
self
,
my_type_test
=
None
):
def
run
(
self
):
## BLOCK OK
## BLOCK OK
log
=
self
.
log
log
=
self
.
log
...
@@ -338,7 +338,6 @@ branch = %(branch)s
...
@@ -338,7 +338,6 @@ branch = %(branch)s
(
test_suite_data
,))
(
test_suite_data
,))
##/BLOCK OK
##/BLOCK OK
if
my_type_test
==
None
:
# TODO : implement this method for each distributor
# TODO : implement this method for each distributor
# into nexedi/master-erp5..
# into nexedi/master-erp5..
# (just UnitTestDistributor should be sufficient)
# (just UnitTestDistributor should be sufficient)
...
...
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