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
Sven Franck
erp5
Commits
b38cbd7d
Commit
b38cbd7d
authored
Jun 12, 2013
by
Benjamin Blanc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix self.test_suite_portal?
parent
80daf097
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
12 deletions
+27
-12
erp5/tests/testERP5TestNode.py
erp5/tests/testERP5TestNode.py
+22
-7
erp5/util/testnode/ScalabilityTestRunner.py
erp5/util/testnode/ScalabilityTestRunner.py
+5
-5
No files found.
erp5/tests/testERP5TestNode.py
View file @
b38cbd7d
...
@@ -459,11 +459,13 @@ branch = foo
...
@@ -459,11 +459,13 @@ branch = foo
self
.
assertRaises
(
SubprocessError
,
runner
.
prepareSlapOSForTestSuite
,
self
.
assertRaises
(
SubprocessError
,
runner
.
prepareSlapOSForTestSuite
,
node_test_suite
)
node_test_suite
)
def
test_11_run
(
self
,
my_test_type
=
'UnitTest'
):
def
test_11_run
(
self
,
my_test_type
=
'UnitTest'
,
grade
=
'master'
):
def
doNothing
(
self
,
*
args
,
**
kw
):
def
doNothing
(
self
,
*
args
,
**
kw
):
pass
pass
def
patch_getTestType
(
self
):
def
patch_getTestType
(
self
,
*
args
,
**
kw
):
return
my_test_type
return
my_test_type
def
patch_isValidatedMaster
(
self
,
*
args
,
**
kw
):
return
(
grade
==
'master'
)
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
)
...
@@ -472,12 +474,17 @@ branch = foo
...
@@ -472,12 +474,17 @@ branch = foo
def
patch_startTestSuite
(
self
,
test_node_title
):
def
patch_startTestSuite
(
self
,
test_node_title
):
global
counter
global
counter
config_list
=
[]
config_list
=
[]
# Sclalability slave testnode is not directly in charge of testsuites
if
my_test_type
==
'ScalabilityTest'
and
grade
==
'slave'
:
count
+=
5
return
[]
def
_checkExistingTestSuite
(
reference_set
):
def
_checkExistingTestSuite
(
reference_set
):
test_self
.
assertEquals
(
set
(
reference_set
),
test_self
.
assertEquals
(
set
(
reference_set
),
set
(
os
.
listdir
(
test_node
.
working_directory
)))
set
(
os
.
listdir
(
test_node
.
working_directory
)))
for
x
in
reference_set
:
for
x
in
reference_set
:
test_self
.
assertTrue
(
os
.
path
.
exists
(
os
.
path
.
join
(
test_self
.
assertTrue
(
os
.
path
.
exists
(
os
.
path
.
join
(
test_node
.
working_directory
,
x
)),
True
)
test_node
.
working_directory
,
x
)),
True
)
if
counter
==
0
:
if
counter
==
0
:
config_list
.
append
(
test_self
.
getTestSuiteData
(
reference
=
'foo'
)[
0
])
config_list
.
append
(
test_self
.
getTestSuiteData
(
reference
=
'foo'
)[
0
])
config_list
.
append
(
test_self
.
getTestSuiteData
(
reference
=
'bar'
)[
0
])
config_list
.
append
(
test_self
.
getTestSuiteData
(
reference
=
'bar'
)[
0
])
...
@@ -516,12 +523,16 @@ branch = foo
...
@@ -516,12 +523,16 @@ branch = foo
self
.
generateTestRepositoryList
()
self
.
generateTestRepositoryList
()
RunnerClass
=
self
.
returnGoodClassRunner
(
my_test_type
)
RunnerClass
=
self
.
returnGoodClassRunner
(
my_test_type
)
# Patch
# Patch
if
my_test_type
==
'ScalabilityTest'
:
original_isValidatedMaster
=
TaskDistributor
.
isValidatedMaster
TaskDistributor
.
isValidatedMaster
=
patch_isValidatedMaster
original_startTestSuite
=
TaskDistributor
.
startTestSuite
original_startTestSuite
=
TaskDistributor
.
startTestSuite
original_subscribeNode
=
TaskDistributor
.
subscribeNode
original_subscribeNode
=
TaskDistributor
.
subscribeNode
original_getTestType
=
TaskDistributor
.
getTestType
original_getTestType
=
TaskDistributor
.
getTestType
TaskDistributor
.
startTestSuite
=
patch_startTestSuite
TaskDistributor
.
startTestSuite
=
patch_startTestSuite
TaskDistributor
.
subscribeNode
=
doNothing
TaskDistributor
.
subscribeNode
=
doNothing
TaskDistributor
.
getTestType
=
patch_getTestType
TaskDistributor
.
getTestType
=
patch_getTestType
original_createTestResult
=
TaskDistributionTool
.
createTestResult
original_createTestResult
=
TaskDistributionTool
.
createTestResult
TaskDistributionTool
.
createTestResult
=
patch_createTestResult
TaskDistributionTool
.
createTestResult
=
patch_createTestResult
# TestNode
# TestNode
...
@@ -537,6 +548,8 @@ branch = foo
...
@@ -537,6 +548,8 @@ branch = foo
self
.
assertEquals
(
5
,
counter
)
self
.
assertEquals
(
5
,
counter
)
time
.
sleep
=
original_sleep
time
.
sleep
=
original_sleep
# Restore old class methods
# Restore old class methods
if
my_test_type
==
'ScalabilityTest'
:
TaskDistributor
.
isValidatedMaster
=
original_isValidatedMaster
TaskDistributor
.
startTestSuite
=
original_startTestSuite
TaskDistributor
.
startTestSuite
=
original_startTestSuite
TaskDistributionTool
.
createTestResult
=
original_createTestResult
TaskDistributionTool
.
createTestResult
=
original_createTestResult
TaskDistributionTool
.
subscribeNode
=
original_subscribeNode
TaskDistributionTool
.
subscribeNode
=
original_subscribeNode
...
@@ -584,7 +597,7 @@ branch = foo
...
@@ -584,7 +597,7 @@ branch = foo
def
test_15_suite_log_directory
(
self
,
my_test_type
=
'UnitTest'
):
def
test_15_suite_log_directory
(
self
,
my_test_type
=
'UnitTest'
):
def
doNothing
(
self
,
*
args
,
**
kw
):
def
doNothing
(
self
,
*
args
,
**
kw
):
pass
pass
def
patch_getTestType
(
self
):
def
patch_getTestType
(
self
,
*
args
,
**
kw
):
return
my_test_type
return
my_test_type
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'
)
...
@@ -767,8 +780,10 @@ branch = foo
...
@@ -767,8 +780,10 @@ branch = foo
# This case test may be dispensable on ScalabilityTest case
# This case test may be dispensable on ScalabilityTest case
# so..
# so..
pass
pass
def
test_scalability_11_run
(
self
,
my_test_type
=
'ScalabilityTest'
):
def
test_scalability_as_master_11_run
(
self
,
my_test_type
=
'ScalabilityTest'
):
self
.
test_11_run
(
my_test_type
)
self
.
test_11_run
(
my_test_type
,
grade
=
'master'
)
def
test_scalability_as_slave_11_run
(
self
,
my_test_type
=
'ScalabilityTest'
):
self
.
test_11_run
(
my_test_type
,
grade
=
'slave'
)
def
test_scalability_12_spawn
(
self
,
my_test_type
=
'ScalabilityTest'
):
def
test_scalability_12_spawn
(
self
,
my_test_type
=
'ScalabilityTest'
):
self
.
test_12_spawn
(
my_test_type
)
self
.
test_12_spawn
(
my_test_type
)
def
test_scalability_13_SlaposControlerResetSoftware
(
self
,
my_test_type
=
'ScalabilityTest'
):
def
test_scalability_13_SlaposControlerResetSoftware
(
self
,
my_test_type
=
'ScalabilityTest'
):
...
...
erp5/util/testnode/ScalabilityTestRunner.py
View file @
b38cbd7d
...
@@ -79,11 +79,11 @@ class ScalabilityTestRunner():
...
@@ -79,11 +79,11 @@ class ScalabilityTestRunner():
We will build slapos software needed by the testnode itself,
We will build slapos software needed by the testnode itself,
"""
"""
if
self
.
test_suite_portal
.
isValidatedMaster
(
self
.
config
[
'test_node_title'
]):
if
self
.
test_suite_portal
.
isValidatedMaster
(
self
.
config
[
'test_node_title'
]):
software_path_list
=
[]
#
software_path_list = []
software_path_list
.
append
(
self
.
testnode
.
config
.
get
(
"software_list"
))
#
software_path_list.append(self.testnode.config.get("software_list"))
for
software_path
in
software_path_list
:
#
for software_path in software_path_list:
for
launcher_node
in
self
.
launcher
_nodes
:
# for launcher_node in self.????
_nodes:
self
.
_prepareSlapOS
(
software_path
,
launcher_node
[
'computer_id'
])
#
self._prepareSlapOS(software_path, launcher_node['computer_id'])
# TODO : change the line below
# TODO : change the line below
return
{
'status_code'
:
0
}
return
{
'status_code'
:
0
}
else
:
else
:
...
...
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