Skip to content
Snippets Groups Projects
Commit b7649e4c authored by Samuel Jackson's avatar Samuel Jackson
Browse files

Add tools for parsing unit & system test speed.

parent 0c941808
No related branches found
No related tags found
No related merge requests found
"""
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")
"""
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")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment