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
Labels
Merge Requests
144
Merge Requests
144
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
c46ba4e0
Commit
c46ba4e0
authored
Jul 29, 2019
by
Bryton Lacquement
🚪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip
parent
db740982
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
29 additions
and
33 deletions
+29
-33
erp5/tests/testERP5TestNode.py
erp5/tests/testERP5TestNode.py
+4
-4
erp5/util/benchmark/report.py
erp5/util/benchmark/report.py
+2
-4
erp5/util/testbrowser/examples/createERP5User.py
erp5/util/testbrowser/examples/createERP5User.py
+2
-5
erp5/util/testbrowser/examples/createPerson.py
erp5/util/testbrowser/examples/createPerson.py
+2
-2
erp5/util/testnode/ProcessManager.py
erp5/util/testnode/ProcessManager.py
+1
-2
erp5/util/testnode/ScalabilityTestRunner.py
erp5/util/testnode/ScalabilityTestRunner.py
+2
-2
erp5/util/testnode/SlapOSMasterCommunicator.py
erp5/util/testnode/SlapOSMasterCommunicator.py
+1
-1
erp5/util/testnode/testnode.py
erp5/util/testnode/testnode.py
+2
-2
erp5/util/timinglogparser/__init__.py
erp5/util/timinglogparser/__init__.py
+2
-2
erp5/util/timinglogplotter/__init__.py
erp5/util/timinglogplotter/__init__.py
+6
-6
product/ERP5/bin/genbt5list
product/ERP5/bin/genbt5list
+5
-3
No files found.
erp5/tests/testERP5TestNode.py
View file @
c46ba4e0
...
...
@@ -804,15 +804,15 @@ shared = true
test_node
=
self
.
getTestNode
()
node_test_suite
=
test_node
.
getNodeTestSuite
(
'foo'
)
folder
=
node_test_suite
.
test_suite_directory
self
.
assert
Equal
(
False
,
os
.
path
.
exists
(
folder
))
self
.
assert
False
(
os
.
path
.
exists
(
folder
))
createFolder
(
folder
)
self
.
assert
Equal
(
True
,
os
.
path
.
exists
(
folder
))
self
.
assert
True
(
os
.
path
.
exists
(
folder
))
to_drop_path
=
os
.
path
.
join
(
folder
,
'drop'
)
to_drop
=
open
(
to_drop_path
,
'w'
)
to_drop
.
close
()
self
.
assert
Equal
(
True
,
os
.
path
.
exists
(
to_drop_path
))
self
.
assert
True
(
os
.
path
.
exists
(
to_drop_path
))
createFolder
(
folder
,
clean
=
True
)
self
.
assert
Equal
(
False
,
os
.
path
.
exists
(
to_drop_path
))
self
.
assert
False
(
os
.
path
.
exists
(
to_drop_path
))
def
test_15_suite_log_directory
(
self
,
my_test_type
=
'UnitTest'
,
grade
=
'master'
):
def
doNothing
(
self
,
*
args
,
**
kw
):
...
...
erp5/util/benchmark/report.py
View file @
c46ba4e0
...
...
@@ -547,10 +547,8 @@ def generateReport():
report_dict
[
'filename'
].
append
(
filename
)
if
not
per_nb_users_report_dict
:
print
(
"ERROR: No result file found, perhaps "
\
"``--filename-prefix'' should be specified?"
,
file
=
sys
.
stderr
)
sys
.
exit
(
1
)
sys
.
exit
(
"ERROR: No result file found, perhaps ``--filename-prefix'' should"
"be specified?"
)
pdf
=
PdfPages
(
argument_namespace
.
output_filename
)
...
...
erp5/util/testbrowser/examples/createERP5User.py
View file @
c46ba4e0
...
...
@@ -20,11 +20,8 @@ try:
user_nbr
=
int
(
user_nbr
)
except
ValueError
:
print
(
"ERROR: Missing arguments: %s URL USERNAME "
\
"PASSWORD NUMBER_OF_USERS NEW_USERNAME_PREFIX NEW_USERS_PASSWORD"
%
\
sys
.
argv
[
0
],
file
=
sys
.
stderr
)
sys
.
exit
(
1
)
sys
.
exit
(
"ERROR: Missing arguments: %s URL USERNAME PASSWORD NUMBER_OF_USERS "
"NEW_USERNAME_PREFIX NEW_USERS_PASSWORD"
%
sys
.
argv
[
0
])
# Create a browser instance
browser
=
Browser
(
url
,
username
,
password
)
...
...
erp5/util/testbrowser/examples/createPerson.py
View file @
c46ba4e0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from
__future__
import
print_function
from
__future__
import
division
,
print_function
from
erp5.util.testbrowser.browser
import
Browser
ITERATION
=
20
...
...
@@ -90,4 +90,4 @@ if __name__ == '__main__':
counter
+=
1
for
title
,
time_list
in
result_dict
.
iteritems
():
print
(
"%s: %.4fs"
%
(
title
,
float
(
sum
(
time_list
)
)
/
ITERATION
))
print
(
"%s: %.4fs"
%
(
title
,
sum
(
time_list
)
/
ITERATION
))
erp5/util/testnode/ProcessManager.py
View file @
c46ba4e0
...
...
@@ -33,7 +33,6 @@ import signal
import
sys
import
time
from
.
import
logger
from
slapos.util
import
bytes2str
MAX_TIMEOUT
=
3600
*
4
...
...
@@ -80,7 +79,7 @@ def subprocess_capture(p, log_prefix, get_output=True):
break
if
get_output
:
buffer
.
append
(
data
)
log
(
log_prefix
+
bytes2str
(
data
).
rstrip
(
'
\
n
'
))
log
(
log_prefix
+
data
.
decode
(
'utf-8'
,
errors
=
'replace'
).
rstrip
(
'
\
n
'
))
if
p
.
stdout
:
stdout
=
[]
stdout_thread
=
threading
.
Thread
(
target
=
readerthread
,
...
...
erp5/util/testnode/ScalabilityTestRunner.py
View file @
c46ba4e0
...
...
@@ -37,7 +37,7 @@ import shutil
import
logging
import
string
import
random
from
six.moves.urllib
import
parse
from
six.moves.urllib
.parse
import
url
parse
import
base64
from
six.moves
import
http_client
as
httplib
from
.
import
Utils
...
...
@@ -364,7 +364,7 @@ Require valid-user
user
,
password
=
self
.
generateProfilePasswordAccess
()
logger
.
info
(
"Software Profile password: %s"
%
password
)
self
.
reachable_profile
=
"https://%s:%s@%s"
%
(
user
,
password
,
os
.
path
.
join
(
parse
.
urlparse
(
self
.
testnode
.
config
[
'frontend_url'
]).
netloc
,
os
.
path
.
join
(
urlparse
(
self
.
testnode
.
config
[
'frontend_url'
]).
netloc
,
"software"
,
self
.
randomized_path
,
"software.cfg"
))
def
prepareSlapOSForTestSuite
(
self
,
node_test_suite
):
...
...
erp5/util/testnode/SlapOSMasterCommunicator.py
View file @
c46ba4e0
...
...
@@ -11,7 +11,7 @@ from uritemplate import expand
import
slapos.slap
from
slapos.slap
import
SoftwareProductCollection
from
requests.exceptions
import
HTTPError
from
erp5.util
.taskdistribution
import
SAFE_RPC_EXCEPTION_LIST
from
.
.taskdistribution
import
SAFE_RPC_EXCEPTION_LIST
from
.
import
logger
import
six
...
...
erp5/util/testnode/testnode.py
View file @
c46ba4e0
...
...
@@ -39,7 +39,7 @@ from .ScalabilityTestRunner import ScalabilityTestRunner
from
.UnitTestRunner
import
UnitTestRunner
from
.Utils
import
deunicodeData
from
.Utils
import
rmtree
from
erp5.util
import
taskdistribution
from
..
import
taskdistribution
MAX_LOG_TIME
=
15
# time in days we should keep logs that we can see through
# httd
...
...
@@ -171,7 +171,7 @@ shared = true
# only limit to particular error, if we run that code for all errors,
# then if server having most repositories is down for some time, we would
# erase all repositories and facing later hours of downloads
if
getattr
(
error
,
'stderr'
,
b''
).
find
(
b'index'
)
>=
0
:
if
b'index'
in
getattr
(
error
,
'stderr'
,
b''
)
:
rmtree
(
repository_path
)
logger
.
warning
(
"Error while getting repository, ignoring this test suite"
,
exc_info
=
1
)
...
...
erp5/util/timinglogparser/__init__.py
View file @
c46ba4e0
...
...
@@ -27,7 +27,7 @@
#
##############################################################################
from
__future__
import
print_function
from
__future__
import
division
,
print_function
import
os
import
sys
...
...
@@ -150,7 +150,7 @@ def parseFile(filename, measure_dict):
if
line_number
>
0
:
duration
=
time
()
-
begin
print
(
"Matched %i lines (%.2f%%), %i skipped (%.2f%%), %i unmatched (%.2f%%) in %.2fs (%i lines per second)."
%
\
(
match_count
,
(
float
(
match_count
)
/
line_number
)
*
100
,
skip_count
,
(
float
(
skip_count
)
/
line_number
)
*
100
,
(
line_number
-
match_count
-
skip_count
),
(
1
-
(
float
(
match_count
+
skip_count
)
/
line_number
))
*
100
,
duration
,
line_number
/
duration
),
(
match_count
,
(
match_count
/
line_number
)
*
100
,
skip_count
,
(
skip_count
/
line_number
)
*
100
,
(
line_number
-
match_count
-
skip_count
),
(
1
-
(
match_count
+
skip_count
)
/
line_number
))
*
100
,
duration
,
line_number
/
/
duration
),
file
=
sys
.
stderr
)
debug
=
False
...
...
erp5/util/timinglogplotter/__init__.py
View file @
c46ba4e0
...
...
@@ -27,7 +27,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
from
__future__
import
print_function
from
__future__
import
division
,
print_function
from
datetime
import
date
from
os
import
path
...
...
@@ -84,9 +84,9 @@ class CSVFile(object):
if
cell
>
value_max
.
get
(
key
,
0
):
value_max
[
key
]
=
cell
column_dict
[
key
].
append
(
cell
)
line_num
=
float
(
line_num
)
/
100
line_num
=
line_num
/
100
for
key
in
ratio_dict
:
ratio_dict
[
key
]
/=
line_num
ratio_dict
[
key
]
/
/
=
line_num
def
getColumn
(
self
,
column_id
):
return
self
.
column_dict
[
self
.
column_list
[
column_id
]]
...
...
@@ -103,7 +103,7 @@ def computeExpr(expr):
if
expr
:
assert
expr
[
0
]
==
'='
num
,
denom
=
expr
[
1
:].
split
(
'/'
)
result
=
float
(
int
(
num
)
)
/
int
(
denom
)
result
=
int
(
num
)
/
int
(
denom
)
else
:
result
=
None
return
result
...
...
@@ -136,7 +136,7 @@ def main():
# date_list will be like ['2009/07/01', '2009/07/05', '2009/07/10', ...]
factor
=
1
if
len
(
date_string_list
)
>
20
:
factor
=
int
(
len
(
date_string_list
)
/
20
)
factor
=
int
(
len
(
date_string_list
)
/
/
20
)
i
=
0
for
date_string
in
date_string_list
:
if
i
%
factor
==
0
:
...
...
@@ -190,7 +190,7 @@ def main():
if
options
.
minimal_non_empty_ratio
is
not
None
:
column_len
=
len
(
column
)
if
column_len
:
if
float
(
len
(
x_data
))
/
column_len
<
options
.
minimal_non_empty_ratio
:
if
len
(
x_data
)
/
column_len
<
options
.
minimal_non_empty_ratio
:
print
(
'Not enough values to plot for %s...'
%
(
out_file_name
,
))
continue
r_y_data
=
robjects
.
FloatVector
(
y_data
)
...
...
product/ERP5/bin/genbt5list
View file @
c46ba4e0
...
...
@@ -213,11 +213,13 @@ def generateInformation(dir, info=id, err=None):
property_list
=
BusinessTemplate
.
fromDir
(
path
)
else
:
continue
xml
.
write
(
b' <template id="%s">
\
n
'
%
name
.
encode
(
'utf-8'
))
xml
.
write
(
b' <template id="%s">
\
n
'
%
name
.
encode
())
for
k
,
v
in
property_list
:
k
=
k
.
encode
(
'utf-8'
)
if
str
is
not
bytes
:
k
=
k
.
encode
()
for
v
in
(
v
,)
if
type
(
v
)
is
bytes
else
v
:
xml
.
write
(
b' <%s>%s</%s>
\
n
'
%
(
k
,
escape
(
v
.
decode
(
'utf-8'
)).
encode
(
'utf-8'
),
k
))
xml
.
write
(
b' <%s>%s</%s>
\
n
'
%
(
k
,
escape
(
v
)
if
str
is
bytes
else
escape
(
v
.
decode
()).
encode
(),
k
))
xml
.
write
(
b' </template>
\
n
'
)
info
(
'done
\
n
'
)
xml
.
write
(
b'</repository>
\
n
'
)
...
...
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