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
Kasra Jamshidi
erp5
Commits
edb63e2b
Commit
edb63e2b
authored
Sep 11, 2013
by
Benjamin Blanc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testnode: tests: correct param
parent
cba9ff8d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
12 deletions
+31
-12
erp5/tests/testERP5TestNode.py
erp5/tests/testERP5TestNode.py
+19
-7
erp5/util/testnode/testnode.py
erp5/util/testnode/testnode.py
+12
-5
No files found.
erp5/tests/testERP5TestNode.py
View file @
edb63e2b
...
...
@@ -517,7 +517,7 @@ ignore-ssl-certificate = true
os
.
makedirs
(
test_result_path_root
)
global
counter
counter
=
0
def
patch_startTestSuite
(
self
,
test_node_title
,
*
args
,
**
kw
):
def
patch_startTestSuite
(
self
,
node_title
,
computer_guid
=
'unknown'
):
global
counter
config_list
=
[]
# Sclalability slave testnode is not directly in charge of testsuites
...
...
@@ -566,6 +566,8 @@ ignore-ssl-certificate = true
result
=
TestResultProxy
(
self
.
_proxy
,
self
.
_retry_time
,
self
.
_logger
,
test_result_path
,
node_title
,
revision
)
return
result
def
patch_runTestSuite
(
self
,
*
argv
,
**
kw
):
return
{
'status_code'
:
0
}
original_sleep
=
time
.
sleep
time
.
sleep
=
doNothing
self
.
generateTestRepositoryList
()
...
...
@@ -607,7 +609,7 @@ ignore-ssl-certificate = true
original_prepareSlapOS
=
RunnerClass
.
_prepareSlapOS
original_runTestSuite
=
RunnerClass
.
runTestSuite
RunnerClass
.
_prepareSlapOS
=
doNothing
RunnerClass
.
runTestSuite
=
doNothing
RunnerClass
.
runTestSuite
=
patch_runTestSuite
SlapOSControler
.
initializeSlapOSControler
=
doNothing
# Inside test_node a runner is created using new UnitTestRunner methods
test_node
.
run
()
...
...
@@ -699,7 +701,7 @@ ignore-ssl-certificate = true
os
.
makedirs
(
test_result_path_root
)
global
counter
counter
=
0
def
patch_startTestSuite
(
self
,
test_node_title
,
*
args
,
**
kw
):
def
patch_startTestSuite
(
self
,
node_title
,
computer_guid
=
'unknown'
):
global
counter
config_list
=
[
test_self
.
getTestSuiteData
(
reference
=
'aa'
)[
0
],
test_self
.
getTestSuiteData
(
reference
=
'bb'
)[
0
]]
...
...
@@ -715,6 +717,8 @@ ignore-ssl-certificate = true
result
=
TestResultProxy
(
self
.
_proxy
,
self
.
_retry_time
,
self
.
_logger
,
test_result_path
,
node_title
,
revision
)
return
result
def
patch_runTestSuite
(
self
,
*
argv
,
**
kw
):
return
{
'status_code'
:
0
}
def
checkTestSuite
(
test_node
):
test_node
.
node_test_suite_dict
rand_part_set
=
set
()
...
...
@@ -775,9 +779,15 @@ ignore-ssl-certificate = true
test_node
=
self
.
getTestNode
()
# Change UnitTestRunner class methods
original_prepareSlapOS
=
RunnerClass
.
_prepareSlapOS
RunnerClass
.
_prepareSlapOS
=
doNothing
original_runTestSuite
=
RunnerClass
.
runTestSuite
if
my_test_type
==
"ScalabilityTest"
:
RunnerClass
.
runTestSuite
=
patch_runTestSuite
else
:
RunnerClass
.
runTestSuite
=
doNothing
RunnerClass
.
_prepareSlapOS
=
doNothing
SlapOSControler
.
initializeSlapOSControler
=
doNothing
test_node
.
run
()
self
.
assertEquals
(
counter
,
3
)
...
...
@@ -947,7 +957,7 @@ ignore-ssl-certificate = true
return
result
global
startTestSuiteDone
startTestSuiteDone
=
False
def
patch_startTestSuite
(
self
,
test_node_title
,
*
args
,
**
kw
):
def
patch_startTestSuite
(
self
,
node_title
,
computer_guid
=
'unknown'
):
config_list
=
[]
global
startTestSuiteDone
if
not
startTestSuiteDone
:
...
...
@@ -980,6 +990,8 @@ ignore-ssl-certificate = true
return
True
def
patch_isRegisteredHostingSubscription
(
self
,
*
args
,
**
kw
):
return
True
def
patch_runTestSuite
(
self
,
*
args
,
**
kw
):
return
{
'status_code'
:
0
}
test_self
=
self
test_result_path_root
=
os
.
path
.
join
(
test_self
.
_temp_dir
,
'test/results'
)
os
.
makedirs
(
test_result_path_root
)
...
...
@@ -1020,7 +1032,7 @@ ignore-ssl-certificate = true
TaskDistributor
.
getTestType
=
patch_getTestType
TaskDistributionTool
.
createTestResult
=
patch_createTestResult
RunnerClass
.
_prepareSlapOS
=
doNothing
RunnerClass
.
runTestSuite
=
doNothing
RunnerClass
.
runTestSuite
=
patch_runTestSuite
SlapOSControler
.
supply
=
doNothing
SlapOSControler
.
request
=
doNothing
SlapOSControler
.
updateInstanceXML
=
doNothing
...
...
erp5/util/testnode/testnode.py
View file @
edb63e2b
...
...
@@ -328,11 +328,17 @@ branch = %(branch)s
remote_test_result_needs_cleanup
=
False
begin
=
time
.
time
()
portal_url
=
config
[
'test_suite_master_url'
]
portal
=
taskdistribution
.
TaskDistributionTool
(
portal_url
,
logger
=
DummyLogger
(
log
))
portal
=
taskdistribution
.
TaskDistributionTool
(
portal_url
,
logger
=
DummyLogger
(
log
))
self
.
portal
=
portal
self
.
test_suite_portal
=
taskdistribution
.
TaskDistributor
(
portal_url
,
logger
=
DummyLogger
(
log
))
self
.
test_suite_portal
.
subscribeNode
(
node_title
=
config
[
'test_node_title'
],
computer_guid
=
config
[
'computer_id'
])
test_suite_json
=
self
.
test_suite_portal
.
startTestSuite
(
node_title
=
config
[
'test_node_title'
],
computer_guid
=
config
[
'computer_id'
])
self
.
test_suite_portal
=
taskdistribution
.
TaskDistributor
(
portal_url
,
logger
=
DummyLogger
(
log
))
self
.
test_suite_portal
.
subscribeNode
(
node_title
=
config
[
'test_node_title'
],
computer_guid
=
config
[
'computer_id'
])
test_suite_json
=
self
.
test_suite_portal
.
startTestSuite
(
node_title
=
config
[
'test_node_title'
],
computer_guid
=
config
[
'computer_id'
])
test_suite_data
=
Utils
.
deunicodeData
(
json
.
loads
(
test_suite_json
))
log
(
"Got following test suite data from master : %r"
%
\
(
test_suite_data
,))
...
...
@@ -371,7 +377,8 @@ from the distributor.")
self
.
process_manager
.
killPreviousRun
()
self
.
getAndUpdateFullRevisionList
(
node_test_suite
)
# Write our own software.cfg to use the local repository
self
.
constructProfile
(
node_test_suite
,
my_test_type
,
runner
.
getRelativePathUsage
())
self
.
constructProfile
(
node_test_suite
,
my_test_type
,
runner
.
getRelativePathUsage
())
# Make sure we have local repository
test_result
=
portal
.
createTestResult
(
node_test_suite
.
revision
,
[],
config
[
'test_node_title'
],
False
,
...
...
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