Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
vidjil
vidjil
Commits
4b30c707
Commit
4b30c707
authored
Mar 18, 2021
by
Mathieu Giraud
Browse files
benchmark-releases.py: bikeshed output
parent
521317d5
Changes
1
Hide whitespace changes
Inline
Side-by-side
algo/tests/benchmark-releases.py
View file @
4b30c707
...
...
@@ -142,9 +142,7 @@ def go(cmd, log=None, time=False):
flog
.
close
()
if
returncode
:
print
(
'FAILED'
,
end
=
' '
)
if
not
time
:
print
()
print
(
color
(
ANSI
.
RED
,
"FAILED"
))
sys
.
stdout
.
flush
()
raise
subprocess
.
CalledProcessError
(
returncode
,
cmd
)
elif
not
time
:
...
...
@@ -185,7 +183,7 @@ def get_releases():
def
install
(
release
,
tgz
):
os
.
system
(
'mkdir -p %s'
%
BIN
)
os
.
system
(
'mkdir -p %s'
%
GERM
)
print
(
'==
%s'
%
release
)
print
(
'==
'
,
color
(
ANSI
.
MAGENTA
,
release
)
)
dir
=
SRC
+
release
go
(
'mkdir -p %s'
%
dir
)
...
...
@@ -217,7 +215,7 @@ def install_from_archive(install_versions):
if
(
not
install_versions
)
or
release
in
install_versions
:
install
(
release
,
tgz
)
except
subprocess
.
CalledProcessError
:
print
(
"FAILED"
)
print
(
color
(
ANSI
.
RED
,
"Install failed "
)
)
def
installed
():
return
sorted
([
f
.
replace
(
BIN
,
''
)
for
f
in
glob
.
glob
(
'%s/*'
%
BIN
)])
...
...
@@ -230,11 +228,13 @@ def run_all(tag, args, retries):
print
(
color
(
ANSI
.
MAGENTA
,
'%9s'
%
release
),
end
=
' '
)
log
=
RUN
+
'/%s-%s.log'
%
(
tag
,
release
)
cmd
=
'%s/%s '
%
(
BIN
,
release
)
+
convert
(
args
,
release
)
cmd
=
'%s/%
-9
s '
%
(
BIN
,
release
)
+
convert
(
args
,
release
)
cmd
=
cmd
.
replace
(
GERM_VAR
,
'%s/%s'
%
(
GERM
,
release
))
try
:
benchs
=
[]
for
i
in
range
(
retries
)
:
if
i
:
print
(
'%9s'
%
''
,
end
=
' '
)
benchs
.
append
(
go
(
cmd
,
log
,
True
))
time
=
min
([
b
[
0
]
for
b
in
benchs
])
mem
=
min
([
b
[
1
]
for
b
in
benchs
])
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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