Skip to content

Commit 132c873

Browse files
authored
Report workflows failing maxmem check as a numericly sorted list (#2654)
* Report workflows failing maxmem check as a numericly sorted list * Black formatting * Workflow string is s[3] not s[2] because grep output includes filename
1 parent 98f1abc commit 132c873

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

report-pull-request-results.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -298,19 +298,25 @@ def read_material_budget_log_file(unit_tests_file):
298298
# reads maxmem comparison error files
299299
#
300300
def read_maxmem_comparison_file(unit_tests_file):
301-
errors_found = ""
301+
errors_found = set()
302302
err_cnt = 0
303303
for line in openlog(unit_tests_file):
304304
if "exceeds" in line.lower():
305305
err_cnt += 1
306-
errors_found += " - " + line.split(":")[1:] + "\n"
307-
306+
message_line = ("-",)
307+
message_line += tuple(line.split(":", 1)[-1].strip().split(" "))
308+
message_line += ("\n",)
309+
errors_found.add(message_line)
308310
if err_cnt > 0:
309311
message = (
310312
"\n## Max Memory Comparisons exceeding threshold\n\n"
311-
"@cms-sw/core-l2 , I found %s workflow step(s) with memory usage exceeding the error threshold:\n\n%s"
312-
% (err_cnt, errors_found)
313+
"@cms-sw/core-l2 , I found %s workflow step(s) with memory usage exceeding the error threshold:\n"
314+
% err_cnt
313315
)
316+
message += "<details>\n<summary>Expand to see workflows ...</summary>\n\n"
317+
for message_line in sorted(errors_found, key=lambda s: float(s[3].split("_")[0])):
318+
message += " ".join(message_line)
319+
message += "</details>\n\n"
314320
send_message_pr(message)
315321

316322

0 commit comments

Comments
 (0)