Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5_fork
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
Eteri
erp5_fork
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
Hide 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
def
test_11_run
(
self
,
my_type_test
=
'UnitTest'
):
def
doNothing
(
self
,
*
args
,
**
kw
):
pass
def
patch_getTestType
(
self
):
return
my_type_test
test_self
=
self
test_result_path_root
=
os
.
path
.
join
(
test_self
.
_temp_dir
,
'test/results'
)
os
.
makedirs
(
test_result_path_root
)
...
...
@@ -514,8 +516,10 @@ branch = foo
# Patch
original_startTestSuite
=
TaskDistributor
.
startTestSuite
original_subscribeNode
=
TaskDistributor
.
subscribeNode
original_getTestType
=
TaskDistributor
.
getTestType
TaskDistributor
.
startTestSuite
=
patch_startTestSuite
TaskDistributor
.
subscribeNode
=
doNothing
TaskDistributor
.
getTestType
=
patch_getTestType
original_createTestResult
=
TaskDistributionTool
.
createTestResult
TaskDistributionTool
.
createTestResult
=
patch_createTestResult
# TestNode
...
...
@@ -527,13 +531,14 @@ branch = foo
RunnerClass
.
runTestSuite
=
doNothing
SlapOSControler
.
initializeSlapOSControler
=
doNothing
# Inside test_node a runner is created using new UnitTestRunner methods
test_node
.
run
(
my_type_test
)
test_node
.
run
()
self
.
assertEquals
(
5
,
counter
)
time
.
sleep
=
original_sleep
# Restore old class methods
TaskDistributor
.
startTestSuite
=
original_startTestSuite
TaskDistributionTool
.
createTestResult
=
original_createTestResult
TaskDistributionTool
.
subscribeNode
=
original_subscribeNode
TaskDistributionTool
.
getTestType
=
original_getTestType
RunnerClass
.
_prepareSlapOS
=
original_prepareSlapOS
RunnerClass
.
runTestSuite
=
original_runTestSuite
...
...
@@ -577,6 +582,8 @@ branch = foo
def
test_15_suite_log_directory
(
self
,
my_type_test
=
'UnitTest'
):
def
doNothing
(
self
,
*
args
,
**
kw
):
pass
def
patch_getTestType
(
self
):
return
my_type_test
test_self
=
self
test_result_path_root
=
os
.
path
.
join
(
test_self
.
_temp_dir
,
'test/results'
)
os
.
makedirs
(
test_result_path_root
)
...
...
@@ -624,8 +631,10 @@ branch = foo
self
.
generateTestRepositoryList
()
original_startTestSuite
=
TaskDistributor
.
startTestSuite
original_subscribeNode
=
TaskDistributor
.
subscribeNode
original_getTestType
=
TaskDistributor
.
getTestType
TaskDistributor
.
startTestSuite
=
patch_startTestSuite
TaskDistributor
.
subscribeNode
=
doNothing
TaskDistributor
.
getTestType
=
patch_getTestType
original_createTestResult
=
TaskDistributionTool
.
createTestResult
TaskDistributionTool
.
createTestResult
=
patch_createTestResult
test_node
=
self
.
getTestNode
()
...
...
@@ -635,7 +644,7 @@ branch = foo
original_runTestSuite
=
RunnerClass
.
runTestSuite
RunnerClass
.
runTestSuite
=
doNothing
SlapOSControler
.
initializeSlapOSControler
=
doNothing
test_node
.
run
(
my_type_test
)
test_node
.
run
()
self
.
assertEquals
(
counter
,
3
)
checkTestSuite
(
test_node
)
time
.
sleep
=
original_sleep
...
...
@@ -643,6 +652,7 @@ branch = foo
TaskDistributor
.
startTestSuite
=
original_startTestSuite
TaskDistributionTool
.
createTestResult
=
original_createTestResult
TaskDistributionTool
.
subscribeNode
=
original_subscribeNode
TaskDistributionTool
.
getTestType
=
original_getTestType
RunnerClass
.
_prepareSlapOS
=
original_prepareSlapOS
RunnerClass
.
runTestSuite
=
original_runTestSuite
...
...
erp5/util/testnode/testnode.py
View file @
366b0144
...
...
@@ -304,7 +304,7 @@ branch = %(branch)s
self
.
_cleanupLog
()
self
.
_cleanupTemporaryFiles
()
def
run
(
self
,
my_type_test
=
None
):
def
run
(
self
):
## BLOCK OK
log
=
self
.
log
...
...
@@ -338,16 +338,15 @@ branch = %(branch)s
(
test_suite_data
,))
##/BLOCK OK
if
my_type_test
==
None
:
# TODO : implement this method for each distributor
# into nexedi/master-erp5..
# (just UnitTestDistributor should be sufficient)
try
:
my_type_test
=
test_suite_portal
.
getTestType
()
except
:
log
(
"testnode, error during requesting getTestType() method
\
# TODO : implement this method for each distributor
# into nexedi/master-erp5..
# (just UnitTestDistributor should be sufficient)
try
:
my_type_test
=
test_suite_portal
.
getTestType
()
except
:
log
(
"testnode, error during requesting getTestType() method
\
from the distributor."
)
raise
NotImplementedError
raise
NotImplementedError
# Select runner according to the test type
if
my_type_test
==
'UnitTest'
:
...
...
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