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
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
Léo-Paul Géneau
erp5
Commits
e55c9a9b
Commit
e55c9a9b
authored
Sep 20, 2013
by
Sebastien Robin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5-util-scalability: cleanup useless spaces
parent
3852fd21
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
23 deletions
+23
-23
erp5/util/scalability/runScalabilityTestSuite.py
erp5/util/scalability/runScalabilityTestSuite.py
+22
-22
tests/__init__.py
tests/__init__.py
+1
-1
No files found.
erp5/util/scalability/runScalabilityTestSuite.py
View file @
e55c9a9b
...
...
@@ -34,7 +34,7 @@ class DummyLogger(object):
def
getConnection
(
erp5_url
,
log
):
"""
Return a connection with the erp5 instance.
"""
"""
start_time
=
time
.
time
()
count
=
0
while
MAX_GETTING_CONNECTION_TIME
>
time
.
time
()
-
start_time
:
...
...
@@ -84,7 +84,7 @@ def waitFor0PendingActivities(erp5_url, log):
if
len
(
message_list
)
==
1
:
log
(
"1 pending activity but ok."
)
ok
=
True
log
(
"There is %d pending activities"
%
len
(
message_list
))
time
.
sleep
(
5
)
except
:
...
...
@@ -139,7 +139,7 @@ class ScalabilityTest(object):
def
__init__
(
self
,
data
,
test_result
):
self
.
__dict__
=
{}
self
.
__dict__
.
update
(
data
)
self
.
test_result
=
test_result
self
.
test_result
=
test_result
def
doNothing
(
**
kwargs
):
pass
...
...
@@ -186,7 +186,7 @@ class ScalabilityLauncher(object):
file_handler
.
setFormatter
(
formatter
)
logger
.
addHandler
(
file_handler
)
self
.
log
=
logger
.
info
# Proxy to with erp5 master test_result
self
.
test_result
=
taskdistribution
.
TestResultProxyProxy
(
self
.
__argumentNamespace
.
test_suite_master_url
,
...
...
@@ -205,40 +205,40 @@ class ScalabilityLauncher(object):
parser
.
add_argument
(
'--test-result-path'
,
metavar
=
'ERP5_TEST_RESULT_PATH'
,
help
=
'ERP5 relative path of the test result'
)
parser
.
add_argument
(
'--revision'
,
metavar
=
'REVISION'
,
help
=
'Revision of the test_suite'
)
parser
.
add_argument
(
'--test-suite'
,
metavar
=
'TEST_SUITE'
,
help
=
'Name of the test suite'
)
parser
.
add_argument
(
'--node-title'
,
metavar
=
'NODE_TITLE'
,
help
=
'Title of the testnode which is running this'
'launcher'
)
parser
.
add_argument
(
'--test-suite-master-url'
,
metavar
=
'TEST_SUITE_MASTER_URL'
,
help
=
'Url to connect to the ERP5 Master testsuite taskditributor'
)
parser
.
add_argument
(
'--log-path'
,
metavar
=
'LOG_PATH'
,
help
=
'Log Path'
)
parser
.
add_argument
(
'--erp5-location'
,
metavar
=
'ERP5_LOCATION'
,
help
=
'Path to erp5 depository'
)
parser
.
add_argument
(
'--runner-path'
,
metavar
=
'Runner_PATH'
,
help
=
'runner Path'
)
@
staticmethod
def
_checkParsedArguments
(
namespace
):
return
namespace
@
staticmethod
def
_parseArguments
(
parser
):
ScalabilityLauncher
.
_addParserArguments
(
parser
)
...
...
@@ -270,7 +270,7 @@ class ScalabilityLauncher(object):
return
None
decoded_data
=
Utils
.
deunicodeData
(
json
.
loads
(
data
))
return
ScalabilityTest
(
decoded_data
,
self
.
test_result
)
def
run
(
self
):
self
.
log
(
"Scalability Launcher started, with:"
)
self
.
log
(
"Test suite master url: %s"
%
self
.
__argumentNamespace
.
test_suite_master_url
)
...
...
@@ -279,12 +279,12 @@ class ScalabilityLauncher(object):
self
.
log
(
"Revision: %s"
%
self
.
__argumentNamespace
.
revision
)
self
.
log
(
"Node title: %s"
%
self
.
__argumentNamespace
.
node_title
)
self
.
log
(
"ERP5 url: %s"
%
self
.
__argumentNamespace
.
erp5_url
)
error_message_set
,
exit_status
=
set
(),
0
# Get suite informations
suite
=
makeSuite
(
self
.
__argumentNamespace
.
test_suite
,
self
.
log
)
test_suite_list
=
suite
.
getTestList
()
test_suite_list
=
suite
.
getTestList
()
# Main loop
while
True
:
...
...
@@ -295,7 +295,7 @@ class ScalabilityLauncher(object):
time
.
sleep
(
15
)
current_test
=
self
.
getRunningTest
()
self
.
log
(
"Test Case %s going to be run."
%
(
current_test
.
title
))
# Prepare configuration
current_test_number
=
int
(
current_test
.
title
)
test_duration
=
suite
.
getTestDuration
(
current_test_number
)
...
...
@@ -312,11 +312,11 @@ class ScalabilityLauncher(object):
# Store the number of documents generated for each iteration
document_number
=
[]
# Repeat the same test several times to accurate test result
for
i
in
range
(
1
,
repetition
+
1
):
self
.
log
(
"Repetition: %d/%d"
%
(
i
,
repetition
))
# Get the number of documents present before running the test.
waitFor0PendingActivities
(
self
.
__argumentNamespace
.
erp5_url
,
self
.
log
)
previous_document_number
=
getCreatedDocumentNumberFromERP5
(
self
.
__argumentNamespace
.
erp5_url
,
self
.
log
)
...
...
@@ -340,7 +340,7 @@ class ScalabilityLauncher(object):
'--user-index'
,
str
(
user_index
),
])
user_index
+=
user_number
/
len
(
test_suite_list
)
# Launch commands
tester_process_list
=
[]
for
command
in
command_list
:
...
...
@@ -357,7 +357,7 @@ class ScalabilityLauncher(object):
# Count created documents
# Wait for 0 pending activities before counting
waitFor0PendingActivities
(
self
.
__argumentNamespace
.
erp5_url
,
self
.
log
)
waitFor0PendingActivities
(
self
.
__argumentNamespace
.
erp5_url
,
self
.
log
)
current_document_number
=
getCreatedDocumentNumberFromERP5
(
self
.
__argumentNamespace
.
erp5_url
,
self
.
log
)
created_document_number
=
current_document_number
-
previous_document_number
self
.
log
(
"previous_document_number: %d"
%
previous_document_number
)
...
...
@@ -366,7 +366,7 @@ class ScalabilityLauncher(object):
document_number
.
append
(
created_document_number
)
# Move csv/logs
self
.
moveLogs
(
current_test
.
title
)
self
.
log
(
"Test Case %s is finish"
%
(
current_test
.
title
))
# Get the maximum as choice
...
...
tests/__init__.py
View file @
e55c9a9b
...
...
@@ -147,7 +147,7 @@ class ERP5_scalability(_ERP5):
def
getTestPath
(
self
):
return
'erp5/util/benchmark/examples/'
def
getUsersFilePath
(
self
):
return
'erp5/util/benchmark/examples/scalabilityUsers'
...
...
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