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
b8e0a1f3
Commit
b8e0a1f3
authored
Jun 06, 2013
by
Benjamin Blanc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Delete newlines/spaces
parent
d59b20f7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
33 deletions
+9
-33
erp5/tests/testERP5TestNode.py
erp5/tests/testERP5TestNode.py
+9
-33
No files found.
erp5/tests/testERP5TestNode.py
View file @
b8e0a1f3
...
@@ -377,14 +377,11 @@ branch = foo
...
@@ -377,14 +377,11 @@ branch = foo
return
[]
return
[]
test_node
=
self
.
getTestNode
()
test_node
=
self
.
getTestNode
()
RunnerClass
=
self
.
returnGoodClassRunner
(
my_test_type
)
RunnerClass
=
self
.
returnGoodClassRunner
(
my_test_type
)
runner
=
RunnerClass
(
test_node
)
runner
=
RunnerClass
(
test_node
)
# Create and initialise/regenerate a nodetestsuite
# Create and initialise/regenerate a nodetestsuite
node_test_suite
=
test_node
.
getNodeTestSuite
(
'foo'
)
node_test_suite
=
test_node
.
getNodeTestSuite
(
'foo'
)
self
.
updateNodeTestSuiteData
(
node_test_suite
)
self
.
updateNodeTestSuiteData
(
node_test_suite
)
node_test_suite
.
revision
=
'dummy'
node_test_suite
.
revision
=
'dummy'
# Path to the dummy runable
# Path to the dummy runable
run_test_suite_path
=
_createPath
(
run_test_suite_path
=
_createPath
(
...
@@ -422,10 +419,8 @@ branch = foo
...
@@ -422,10 +419,8 @@ branch = foo
def
test_10_prepareSlapOS
(
self
,
my_test_type
=
'UnitTest'
):
def
test_10_prepareSlapOS
(
self
,
my_test_type
=
'UnitTest'
):
test_node
=
self
.
getTestNode
()
test_node
=
self
.
getTestNode
()
test_node_slapos
=
SlapOSInstance
()
test_node_slapos
=
SlapOSInstance
()
RunnerClass
=
self
.
returnGoodClassRunner
(
my_test_type
)
RunnerClass
=
self
.
returnGoodClassRunner
(
my_test_type
)
runner
=
RunnerClass
(
test_node
)
runner
=
RunnerClass
(
test_node
)
node_test_suite
=
test_node
.
getNodeTestSuite
(
'foo'
)
node_test_suite
=
test_node
.
getNodeTestSuite
(
'foo'
)
node_test_suite
.
edit
(
working_directory
=
self
.
working_directory
)
node_test_suite
.
edit
(
working_directory
=
self
.
working_directory
)
status_dict
=
{
"status_code"
:
0
}
status_dict
=
{
"status_code"
:
0
}
...
@@ -442,7 +437,6 @@ branch = foo
...
@@ -442,7 +437,6 @@ branch = foo
"kw"
:
kw
})
"kw"
:
kw
})
return
{
"status_code"
:
self
.
status_code
}
return
{
"status_code"
:
self
.
status_code
}
if
my_test_type
==
'UnitTest'
:
SlapOSControler
.
initializeSlapOSControler
=
Patch
(
"initializeSlapOSControler"
)
SlapOSControler
.
initializeSlapOSControler
=
Patch
(
"initializeSlapOSControler"
)
SlapOSControler
.
runSoftwareRelease
=
Patch
(
"runSoftwareRelease"
)
SlapOSControler
.
runSoftwareRelease
=
Patch
(
"runSoftwareRelease"
)
SlapOSControler
.
runComputerPartition
=
Patch
(
"runComputerPartition"
)
SlapOSControler
.
runComputerPartition
=
Patch
(
"runComputerPartition"
)
...
@@ -450,15 +444,7 @@ branch = foo
...
@@ -450,15 +444,7 @@ branch = foo
"runSoftwareRelease"
]
"runSoftwareRelease"
]
method_list_for_prepareSlapOSForTestSuite
=
[
"initializeSlapOSControler"
,
method_list_for_prepareSlapOSForTestSuite
=
[
"initializeSlapOSControler"
,
"runSoftwareRelease"
,
"runComputerPartition"
]
"runSoftwareRelease"
,
"runComputerPartition"
]
else
:
SlapOSControler
.
runComputerPartition
=
Patch
(
"supply"
)
method_list_for_prepareSlapOSForTestNode
=
[]
method_list_for_prepareSlapOSForTestSuite
=
[]
runner
.
prepareSlapOSForTestNode
(
test_node_slapos
)
runner
.
prepareSlapOSForTestNode
(
test_node_slapos
)
self
.
assertEquals
(
method_list_for_prepareSlapOSForTestNode
,
self
.
assertEquals
(
method_list_for_prepareSlapOSForTestNode
,
[
x
[
"method_name"
]
for
x
in
call_list
])
[
x
[
"method_name"
]
for
x
in
call_list
])
call_list
=
[]
call_list
=
[]
...
@@ -468,11 +454,8 @@ branch = foo
...
@@ -468,11 +454,8 @@ branch = foo
call_list
=
[]
call_list
=
[]
SlapOSControler
.
runSoftwareRelease
=
Patch
(
"runSoftwareRelease"
,
status_code
=
1
)
SlapOSControler
.
runSoftwareRelease
=
Patch
(
"runSoftwareRelease"
,
status_code
=
1
)
# TODO : write a test for scalability case
# TODO : write a test for scalability case
if
my_test_type
==
'UnitTest'
:
self
.
assertRaises
(
SubprocessError
,
runner
.
prepareSlapOSForTestSuite
,
self
.
assertRaises
(
SubprocessError
,
runner
.
prepareSlapOSForTestSuite
,
node_test_suite
)
node_test_suite
)
else
:
pass
def
test_11_run
(
self
,
my_test_type
=
'UnitTest'
):
def
test_11_run
(
self
,
my_test_type
=
'UnitTest'
):
def
doNothing
(
self
,
*
args
,
**
kw
):
def
doNothing
(
self
,
*
args
,
**
kw
):
...
@@ -527,24 +510,19 @@ branch = foo
...
@@ -527,24 +510,19 @@ branch = foo
original_sleep
=
time
.
sleep
original_sleep
=
time
.
sleep
time
.
sleep
=
doNothing
time
.
sleep
=
doNothing
self
.
generateTestRepositoryList
()
self
.
generateTestRepositoryList
()
RunnerClass
=
self
.
returnGoodClassRunner
(
my_test_type
)
RunnerClass
=
self
.
returnGoodClassRunner
(
my_test_type
)
# Patch
# Patch
original_startTestSuite
=
TaskDistributor
.
startTestSuite
original_startTestSuite
=
TaskDistributor
.
startTestSuite
TaskDistributor
.
startTestSuite
=
patch_startTestSuite
TaskDistributor
.
startTestSuite
=
patch_startTestSuite
original_createTestResult
=
TaskDistributionTool
.
createTestResult
original_createTestResult
=
TaskDistributionTool
.
createTestResult
TaskDistributionTool
.
createTestResult
=
patch_createTestResult
TaskDistributionTool
.
createTestResult
=
patch_createTestResult
# TestNode
# TestNode
test_node
=
self
.
getTestNode
()
test_node
=
self
.
getTestNode
()
# Modify class UnitTestRunner(or more after) method
# Modify class UnitTestRunner(or more after) method
original_prepareSlapOS
=
RunnerClass
.
_prepareSlapOS
original_prepareSlapOS
=
RunnerClass
.
_prepareSlapOS
original_runTestSuite
=
RunnerClass
.
runTestSuite
original_runTestSuite
=
RunnerClass
.
runTestSuite
RunnerClass
.
_prepareSlapOS
=
doNothing
RunnerClass
.
_prepareSlapOS
=
doNothing
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_test_type
)
test_node
.
run
(
my_test_type
)
...
@@ -638,7 +616,6 @@ branch = foo
...
@@ -638,7 +616,6 @@ branch = foo
if
x
.
find
(
"Activated logfile"
)
>=
0
]))
if
x
.
find
(
"Activated logfile"
)
>=
0
]))
RunnerClass
=
self
.
returnGoodClassRunner
(
my_test_type
)
RunnerClass
=
self
.
returnGoodClassRunner
(
my_test_type
)
original_sleep
=
time
.
sleep
original_sleep
=
time
.
sleep
time
.
sleep
=
doNothing
time
.
sleep
=
doNothing
self
.
generateTestRepositoryList
()
self
.
generateTestRepositoryList
()
...
@@ -653,13 +630,10 @@ branch = foo
...
@@ -653,13 +630,10 @@ 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_test_type
)
test_node
.
run
(
my_test_type
)
self
.
assertEquals
(
counter
,
3
)
self
.
assertEquals
(
counter
,
3
)
checkTestSuite
(
test_node
)
checkTestSuite
(
test_node
)
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
...
@@ -771,7 +745,8 @@ branch = foo
...
@@ -771,7 +745,8 @@ branch = foo
# TODO : write own scalability test
# TODO : write own scalability test
pass
pass
def
test_scalability_10_prepareSlapOS
(
self
,
my_test_type
=
'ScalabilityTest'
):
def
test_scalability_10_prepareSlapOS
(
self
,
my_test_type
=
'ScalabilityTest'
):
self
.
test_10_prepareSlapOS
(
my_test_type
)
# TODO : write own scalability test
pass
def
test_scalability_11_run
(
self
,
my_test_type
=
'ScalabilityTest'
):
def
test_scalability_11_run
(
self
,
my_test_type
=
'ScalabilityTest'
):
self
.
test_11_run
(
my_test_type
)
self
.
test_11_run
(
my_test_type
)
def
test_scalability_12_spawn
(
self
,
my_test_type
=
'ScalabilityTest'
):
def
test_scalability_12_spawn
(
self
,
my_test_type
=
'ScalabilityTest'
):
...
@@ -789,3 +764,4 @@ branch = foo
...
@@ -789,3 +764,4 @@ branch = foo
def
test_scalability_18_resetSoftwareAfterManyBuildFailures
(
self
,
my_test_type
=
'ScalabilityTest'
):
def
test_scalability_18_resetSoftwareAfterManyBuildFailures
(
self
,
my_test_type
=
'ScalabilityTest'
):
# TODO : write own scalability test
# TODO : write own scalability test
pass
pass
#TODO : add more test for scalability case
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