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
1
Issues
1
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
Roque
erp5
Commits
020d0bde
Commit
020d0bde
authored
Jun 25, 2013
by
Benjamin Blanc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: add launcher draft, update testnode
parent
ebfd9cef
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
135 additions
and
9 deletions
+135
-9
erp5/util/benchmark/scalability_launcher.py
erp5/util/benchmark/scalability_launcher.py
+109
-0
erp5/util/testnode/ScalabilityTestRunner.py
erp5/util/testnode/ScalabilityTestRunner.py
+23
-9
erp5/util/testnode/testnode.py
erp5/util/testnode/testnode.py
+1
-0
setup.py
setup.py
+2
-0
No files found.
erp5/util/benchmark/scalability_launcher.py
0 → 100644
View file @
020d0bde
#!/usr/bin/env python
import
argparse
import
os
import
time
import
sys
import
multiprocessing
import
errno
from
.argument
import
ArgumentType
from
.performance_tester
import
PerformanceTester
from
erp5.util
import
taskdistribution
class
ScalabilityTest
(
object
):
def
__init__
(
self
,
title
,
count
):
self
.
title
=
title
self
.
count
=
count
def
dump
(
self
):
print
'<ScalabilityTest>'
print
'self.title: %s'
%
(
str
(
self
.
title
))
print
'self.count: %s'
%
(
str
(
self
.
count
))
class
ScalabilityLauncher
(
object
):
def
__init__
(
self
,
namespace
=
None
):
if
not
namespace
:
self
.
__argumentNamespace
=
self
.
_parseArguments
(
argparse
.
ArgumentParser
(
description
=
'Run ERP5 benchmarking scalability suites.'
))
else
:
self
.
__argumentNamespace
=
namespace
# Here make a connection with erp5 master
@
staticmethod
def
_addParserArguments
(
parser
):
# Mandatory arguments
parser
.
add_argument
(
'--erp5-url'
,
metavar
=
'ERP5_URL'
,
help
=
'Main url of ERP5 instance to test'
)
parser
.
add_argument
(
'--erp5-test-result-url'
,
metavar
=
'ERP5_TEST_RESULT_URL'
,
help
=
'ERP5 URL to find test results corresponding '
'to the current running test_suite'
)
parser
.
add_argument
(
'--revision'
,
metavar
=
'REVISION'
,
help
=
'Revision of the test_suite'
)
parser
.
add_argument
(
'--node-title'
,
metavar
=
'NODE_TITLE'
,
help
=
'Title of the testnode which is running this'
'launcher'
)
@
staticmethod
def
_checkParsedArguments
(
namespace
):
return
namespace
@
staticmethod
def
_parseArguments
(
parser
):
ScalabilityLauncher
.
_addParserArguments
(
parser
)
namespace
=
parser
.
parse_args
()
ScalabilityLauncher
.
_checkParsedArguments
(
namespace
)
return
namespace
def
checkERP5Instance
(
self
):
"""
Check if erp5_instance is accessible
"""
pass
def
updateTestResultLineStatus
(
self
,
state
):
"""
Update state of a test_result_line
"""
pass
def
_getNextTest
(
self
):
"""
Get testsuite parameters
"""
title
=
"My Sweet Title"
count
=
1
next_test
=
ScalabilityTest
(
title
,
count
)
return
next_test
def
run
(
self
):
max_time
=
10
start_time
=
time
.
time
()
error_message_set
,
exit_status
=
set
(),
0
print
self
.
__argumentNamespace
.
erp5_test_result_url
print
self
.
__argumentNamespace
.
erp5_url
print
self
.
__argumentNamespace
.
revision
print
self
.
__argumentNamespace
.
node_title
while
time
.
time
()
-
start_time
<
max_time
:
current_test
=
self
.
_getNextTest
()
current_test
.
dump
()
time
.
sleep
(
2
)
return
error_message_set
,
exit_status
def
main
():
error_message_set
,
exit_status
=
ScalabilityLauncher
().
run
()
for
error_message
in
error_message_set
:
print
>>
sys
.
stderr
,
"ERROR: %s"
%
error_message
sys
.
exit
(
exit_status
)
\ No newline at end of file
erp5/util/testnode/ScalabilityTestRunner.py
View file @
020d0bde
...
...
@@ -95,17 +95,30 @@ class ScalabilityTestRunner():
instance_title
+=
"-"
instance_title
+=
time
.
strftime
(
'%d/%m/%y_%H:%M:%S'
,
time
.
localtime
())
return
instance_title
def
_createInstance
(
self
,
software_path
,
software_configuration
,
instance_title
):
def
_generateInstanceXML
(
self
,
software_path
,
software_configuration
,
test_result
):
"""
Generate a complete scalability instance XML configuration
"""
config
=
software_configuration
.
copy
()
# Add here zope partition into launcher node to
# watch activities etc... ? or do it into buildout ?
#config.update({'launcher-partition-list':self.launcher_nodes_computer_guid})
config
.
update
({
'scalability-launcher-computer-guid'
:
self
.
launcher_nodes_computer_guid
[
0
]})
config
.
update
({
'scalability-launcher-title'
:
'MyTestNodeTitle'
})
config
.
update
({
'test-result-path'
:
test_result
.
test_result_path
})
config
.
update
({
'test-suite-revision'
:
test_result
.
revision
})
return
config
def
_createInstance
(
self
,
software_path
,
software_configuration
,
instance_title
,
test_result
):
"""
Launch
instance
Create scalability
instance
"""
if
self
.
authorize_request
:
config
=
software_configuration
.
copy
()
# Add here zope partition into launcher node to
# watch activities etc... ?
#config.update({'launcher-partition-list':self.launcher_nodes_computer_guid})
config
.
update
({
'scalability-launcher-computer-guid'
:
self
.
launcher_nodes_computer_guid
[
0
]})
config
=
_generateInstanceXML
(
software_path
,
software_configuration
,
instance_title
,
test_result
)
self
.
log
(
"testnode, request : %s"
,
instance_title
)
self
.
slapos_controler
.
request
(
instance_title
,
software_path
,
"scalability"
,
{
"_"
:
config
})
...
...
@@ -170,6 +183,7 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),))
"""
Just a proxy to SlapOSControler.updateInstanceXML.
"""
# use _generateInstanceXML...;
self
.
slapos_controler
.
updateInstanceXML
(
software_path
,
computer_guid
,
xml
)
def
prepareSlapOSForTestSuite
(
self
,
node_test_suite
):
...
...
@@ -267,7 +281,7 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),))
# Launch instance
instance_title
=
self
.
_generateInstancetitle
(
node_test_suite
.
test_suite_title
)
self
.
_createInstance
(
self
.
reachable_profile
,
configuration_list
[
0
],
instance_title
)
instance_title
,
node_test_suite
.
test_result
)
self
.
log
(
"Scalability instance requested"
)
time
.
sleep
(
15
)
self
.
log
(
"Trying to update instance XML..."
)
...
...
erp5/util/testnode/testnode.py
View file @
020d0bde
...
...
@@ -379,6 +379,7 @@ from the distributor.")
# as partitions can be of any kind we have and likely will never have
# a reliable way to check if they are up or not ...
time
.
sleep
(
20
)
node_test_suite
.
test_result
=
test_result
runner
.
runTestSuite
(
node_test_suite
,
portal_url
)
# break the loop to get latest priorities from master
break
...
...
setup.py
View file @
020d0bde
...
...
@@ -69,6 +69,8 @@ setup(name=name,
'erp5.util.benchmark.performance_tester:main [benchmark]'
,
'scalability_tester_erp5 = '
\
'erp5.util.benchmark.scalability_tester:main [scalability_tester]'
,
'scalability_launcher_erp5 = '
\
'erp5.util.benchmark.scalability_launcher:main'
,
'generate_erp5_tester_report = '
\
'erp5.util.benchmark.report:generateReport [benchmark-report]'
,
'web_checker_utility = erp5.util.webchecker:web_checker_utility'
...
...
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