Skip to content

Commit 41b36f8

Browse files
authored
fix test name discovery for intermittent commenter (#8769)
1 parent f289885 commit 41b36f8

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

treeherder/intermittents_commenter/commenter.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -602,9 +602,15 @@ def get_test_name(self, all_tests, summary):
602602
if any(k for k in test_file_extensions if f"{k} | single" in summary):
603603
if " (finished)" in summary:
604604
summary = summary.replace(" (finished)", "")
605-
# get <test_name> from: "TEST-UNEXPECTED-FAIL | <test_name> | single tracking bug"
605+
# get <test_name> from: "Intermittent <test_name>[ == <test_name-ref>] | single tracking bug"
606+
test_name_re = re.compile(r".*? ((\S+ [!=]= )?(\S+)) \| single tracking bug")
607+
m = test_name_re.match(summary)
608+
if m:
609+
test_name = m.group(1)
610+
if not test_name:
611+
return None
612+
606613
# TODO: fix reftest
607-
test_name = summary.split("|")[-2].strip()
608614
if " == " in test_name or " != " in test_name:
609615
test_name = test_name.split(" ")[0]
610616
else:

0 commit comments

Comments
 (0)