Skip to content

Commit

Permalink
Bug 1906258 - make bug suggestion generation for failure case-insensi…
Browse files Browse the repository at this point in the history
…tive
  • Loading branch information
Archaeopteryx committed Jul 4, 2024
1 parent c227e84 commit 9340ce7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions tests/model/test_bugscache.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def _update_bugscache(bug_list):

BUG_SEARCHES = (
("test_popup_preventdefault_chrome.xul", [455091]),
("test_Popup_Preventdefault_Chrome.XUL", [455091]),
("test_popup_preventdefault_chrome.xul foo bar", []),
(
"test_switch_frame.py TestSwitchFrame.test_should_be_able_to_carry_on_working_if_the_frame_is_deleted",
Expand Down
11 changes: 6 additions & 5 deletions treeherder/model/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ def __str__(self):
@classmethod
def search(cls, search_term):
max_size = 50
search_term = search_term.lower()

# On PostgreSQL we can use the ORM directly, but NOT the full text search
# as the ranking algorithm expects english words, not paths
Expand All @@ -254,11 +255,11 @@ def search(cls, search_term):
all_data = [
match
for match in open_recent_match_string
if match["summary"].startswith(search_term)
or "/" + search_term in match["summary"]
or " " + search_term in match["summary"]
or "\\" + search_term in match["summary"]
or "," + search_term in match["summary"]
if match["summary"].lower().startswith(search_term)
or "/" + search_term in match["summary"].lower()
or " " + search_term in match["summary"].lower()
or "\\" + search_term in match["summary"].lower()
or "," + search_term in match["summary"].lower()
]
open_recent = [x for x in all_data if x["resolution"] == ""]
all_others = [x for x in all_data if x["resolution"] != ""]
Expand Down

0 comments on commit 9340ce7

Please sign in to comment.