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
amrani
erp5
Commits
4be70868
Commit
4be70868
authored
Jul 15, 2013
by
Benjamin Blanc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testnode: runScalabilityTestSuite: send log and csv to master
parent
80325714
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
3 deletions
+55
-3
erp5/util/scalability/runScalabilityTestSuite.py
erp5/util/scalability/runScalabilityTestSuite.py
+55
-3
No files found.
erp5/util/scalability/runScalabilityTestSuite.py
View file @
4be70868
...
@@ -10,6 +10,7 @@ import errno
...
@@ -10,6 +10,7 @@ import errno
import
json
import
json
import
logging
import
logging
import
logging.handlers
import
logging.handlers
import
glob
from
erp5.util.benchmark.argument
import
ArgumentType
from
erp5.util.benchmark.argument
import
ArgumentType
from
erp5.util.benchmark.performance_tester
import
PerformanceTester
from
erp5.util.benchmark.performance_tester
import
PerformanceTester
from
erp5.util
import
taskdistribution
from
erp5.util
import
taskdistribution
...
@@ -17,6 +18,8 @@ from erp5.util.testnode import Utils
...
@@ -17,6 +18,8 @@ from erp5.util.testnode import Utils
from
subprocess
import
call
from
subprocess
import
call
LOG_FILE_PREFIX
=
"performance_tester_erp5"
class
ScalabilityTest
(
object
):
class
ScalabilityTest
(
object
):
def
__init__
(
self
,
data
,
test_result
):
def
__init__
(
self
,
data
,
test_result
):
self
.
__dict__
=
{}
self
.
__dict__
=
{}
...
@@ -116,6 +119,32 @@ class ScalabilityLauncher(object):
...
@@ -116,6 +119,32 @@ class ScalabilityLauncher(object):
"""
"""
pass
pass
def
_returnFileContentList
(
path
,
scheme
):
"""
"""
complete_scheme
=
os
.
path
.
join
(
path
,
scheme
)
file_path_list
=
glob
.
glob
(
scheme
)
content_list
=
[]
for
file_path
in
file_path_list
:
opened_file
=
open
(
file_path
,
'r'
)
content_list
.
append
(
opened_file
.
readlines
())
opened_file
.
close
()
return
content_list
def
returnLogList
():
return
self
.
_returnFileContentList
(
self
.
__argumentNamespace
.
log_path
,
"%s*.log"
%
LOG_FILE_PREFIX
)
def
returnCsvList
():
return
self
.
_returnFileContentList
(
self
.
__argumentNamespace
.
log_path
,
"%s*.csv"
%
LOG_FILE_PREFIX
)
def
cleanUplogAndCsv
():
files_to_delete
=
glob
.
glob
(
os
.
path
.
join
(
path
,
"%s*.log"
%
LOG_FILE_PREFIX
))
+
glob
.
glob
(
os
.
path
.
join
(
path
,
"%s*.csv"
%
LOG_FILE_PREFIX
))
for
file_path
in
files_to_delete
:
os
.
remove
(
file_path
)
def
getNextTest
(
self
):
def
getNextTest
(
self
):
"""
"""
Return a ScalabilityTest with current running test case informations,
Return a ScalabilityTest with current running test case informations,
...
@@ -157,16 +186,39 @@ class ScalabilityLauncher(object):
...
@@ -157,16 +186,39 @@ class ScalabilityLauncher(object):
test_suites
,
test_suites
,
'--benchmark-path-list'
,
benchmark_path_list
,
'--benchmark-path-list'
,
benchmark_path_list
,
'--users-file-path'
,
user_file_path
,
'--users-file-path'
,
user_file_path
,
'--filename-prefix'
,
"
performance_tester_erp5_%s_"
%
(
current_test
.
title
),
'--filename-prefix'
,
"
%s_%s_"
%
(
LOG_FILE_PREFIX
,
current_test
.
title
),
'--report-directory'
,
self
.
__argumentNamespace
.
log_path
,
'--report-directory'
,
self
.
__argumentNamespace
.
log_path
,
])
])
except
:
except
:
self
.
log
(
"Error during tester call."
)
self
.
log
(
"Error during tester call."
)
raise
ValueError
(
"Tester call failed"
)
raise
ValueError
(
"Tester call failed"
)
self
.
log
(
"Test Case %s is finish"
%
(
current_test
.
title
))
self
.
log
(
"Test Case %s is finish"
%
(
current_test
.
title
))
current_test
.
stop
()
log_contents
=
self
.
returnLogList
()
csv_contents
=
self
.
returnCsvList
()
self
.
cleanUplogAndCsv
()
#current_test.stop()
proxy
=
taskdistribution
.
ServerProxy
(
self
.
__argumentNamespace
.
test_suite_master_url
,
allow_none
=
True
).
portal_task_distribution
test_result_line_test
=
taskdistribution
.
TestResultLineProxy
(
proxy
,
retry_time
,
self
.
log
,
current_test
.
relative_path
,
current_test
.
title
)
stdout
=
"LOG:
\
n
""
\
n
====
\
n
====
\
n
====
\
n
====
\
n
"
for
log_content
in
log_contents
:
stdout
=
stdout
+
log_content
+
"
\
n
====
\
n
====
\
n
"
stdout
=
stdout
+
"CSV:
\
n
""
\
n
====
\
n
====
\
n
====
\
n
====
\
n
"
for
log_content
in
log_contents
:
stdout
=
stdout
+
log_content
+
"
\
n
====
\
n
====
\
n
"
test_result_line_test
.
stop
(
stdout
=
stdout
)
self
.
log
(
"Test Case Stopped"
)
self
.
log
(
"Test Case Stopped"
)
return
error_message_set
,
exit_status
return
error_message_set
,
exit_status
def
main
():
def
main
():
...
...
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