Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mantidproject
mantid
Commits
b7649e4c
Commit
b7649e4c
authored
7 years ago
by
Samuel Jackson
Browse files
Options
Downloads
Patches
Plain Diff
Add tools for parsing unit & system test speed.
parent
0c941808
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tools/system_test_speed.py
+28
-0
28 additions, 0 deletions
tools/system_test_speed.py
tools/unit_test_speed.py
+19
-0
19 additions, 0 deletions
tools/unit_test_speed.py
with
47 additions
and
0 deletions
tools/system_test_speed.py
0 → 100755
+
28
−
0
View file @
b7649e4c
"""
Usage system_test_speed.py <build-log> <output-csv>
Given a the raw output from a Jenkins build server log this script will output
a CSV file of the speed & memory for each system test.
"""
import
sys
with
open
(
sys
.
argv
[
1
],
'
r
'
)
as
f
:
lines
=
f
.
readlines
()
lines
=
filter
(
lambda
x
:
"
RESULT|
"
in
x
or
"
: Executing
"
in
x
,
lines
)
# Strip out tests that did not run
# look ahead and remove tests that have no results
idxs
=
[]
for
i
,
(
x
,
y
)
in
enumerate
(
zip
(
lines
,
lines
[
1
::])):
if
"
Executing
"
in
x
and
"
Executing
"
in
y
:
idxs
.
append
(
i
)
lines
=
[
i
for
j
,
i
in
enumerate
(
lines
)
if
j
not
in
idxs
]
with
open
(
sys
.
argv
[
2
],
'
w
'
)
as
f
:
f
.
write
(
"
name, time, memory
\n
"
)
for
name
,
time
,
memory
in
zip
(
lines
[::
3
],
lines
[
1
::
3
],
lines
[
2
::
3
]):
name
=
name
.
split
(
"
Executing
"
)[
-
1
].
strip
()
time
=
time
.
split
(
"
|1
"
)[
-
1
].
strip
()
memory
=
memory
.
split
(
"
|
"
)[
-
1
].
strip
()
f
.
write
(
"
,
"
.
join
([
name
,
time
,
memory
])
+
"
\n
"
)
This diff is collapsed.
Click to expand it.
tools/unit_test_speed.py
0 → 100644
+
19
−
0
View file @
b7649e4c
"""
Usage unit_test_speed.py <build-log> <output-csv>
Given a the raw output from a Jenkins build server log this script will output
a CSV file of the speed for each unit test.
"""
import
sys
with
open
(
sys
.
argv
[
1
],
'
r
'
)
as
f
:
lines
=
f
.
readlines
()
lines
=
filter
(
lambda
x
:
"
.... Passed
"
in
x
,
lines
)
names
=
[
l
.
split
(
'
:
'
)[
1
].
split
(
"
....
"
)[
0
]
for
l
in
lines
]
times
=
[
l
.
split
(
'
Passed
'
)[
-
1
].
split
(
'
sec
'
)[
0
]
for
l
in
lines
]
with
open
(
sys
.
argv
[
2
],
'
w
'
)
as
f
:
f
.
write
(
"
name, time
\n
"
)
for
name
,
time
in
zip
(
names
,
times
):
f
.
write
(
"
,
"
.
join
([
name
,
time
])
+
"
\n
"
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment