Skip to content

Commit a74f528

Browse files
authored
Merge pull request lisa-lab#178 from slefrancois/test_perf_report
Split speed test report files for clarity in jenkins
2 parents f1c0587 + cd462ec commit a74f528

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

code/test.py

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -224,20 +224,16 @@ def do_tests():
224224
print('float32/gpu', float32_times / gpu_times, file=sys.stderr)
225225

226226
# Generate JUnit performance report
227-
# Define speedtest file write method
228-
def write_junit(f, algos, times, label):
229-
for algo, time in zip(algos, times):
230-
f.write(' <testcase classname="{label}" name="{algo}" time="{time}">'
231-
.format(label=label, algo=algo, time=time))
232-
f.write(' </testcase>\n')
233-
234-
with open('speedtests_time.xml', 'w') as f:
235-
f.write('<?xml version="1.0" encoding="UTF-8"?>\n')
236-
f.write('<testsuite name="dlt_speedtests" tests="{ntests}">\n'
237-
.format(ntests=test_total))
238-
for label, times in times_dic.items():
239-
write_junit(f, algo_executed, times, label)
240-
f.write('</testsuite>\n')
227+
for label, times in times_dic.items():
228+
with open('speedtests_{label}.xml'.format(label=label), 'w') as f:
229+
f.write('<?xml version="1.0" encoding="UTF-8"?>\n')
230+
f.write('<testsuite name="dlt_speedtests_{label}" tests="{ntests}">\n'
231+
.format(label=label, ntests=test_total/len(times_dic)))
232+
for algo, time in zip(algo_executed, times):
233+
f.write(' <testcase classname="speed" name="{algo}" time="{time}">'
234+
.format(label=label, algo=algo, time=time))
235+
f.write(' </testcase>\n')
236+
f.write('</testsuite>\n')
241237

242238
if do_gpu:
243239
assert not numpy.isnan(gpu_times).any()

0 commit comments

Comments
 (0)