Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intermittent fixes #8380

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions tests/intermittents_commenter/test_commenter.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,13 @@ def test_intermittents_commenter_with_failures(
with open("tests/intermittents_commenter/expected_comment_with_5_failures.text") as comment:
expected_comment = comment.read()
assert comment_params[0]["changes"]["comment"]["body"] == expected_comment


def test_get_test_variants(mock_test_variants_firefoxci_request):
process = Commenter(weekly_mode=True, dry_run=True)
test_suite = "mochitest-browser-chrome-spi-nw-10"
variants = process.get_test_variant(test_suite)
assert variants == "spi-nw"
test_suite = "mochitest-browser-chrome-2"
variants = process.get_test_variant(test_suite)
assert variants == "no_variant"
4 changes: 2 additions & 2 deletions treeherder/intermittents_commenter/commenter.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def generate_bug_changes(self, startday, endday, alt_startday, alt_endday):
change_whiteboard = None
priority = 0
rank = top_bugs.index(bug_id) + 1 if self.weekly_mode and bug_id in top_bugs else None
test_variants |= bug_stats[bug_id]["test_variants"]
test_variants = bug_stats[bug_id]["test_variants"]

if bugs_info and bug_id in bugs_info:
if self.weekly_mode:
Expand Down Expand Up @@ -353,7 +353,7 @@ def get_test_variant(self, test_suite):
base_symbol = test_suite
found_variants = []
for variant in variant_symbols:
if f"-{variant}" in base_symbol:
if f"-{variant}-" in base_symbol:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are some variants that might not have a -<variant>- pattern, such as eme.

maybe it could be:
if f"-{variant}-" in base_symbol or base_symbol.endswith(variant):

found_variants.append(variant)
base_symbol = base_symbol.replace(f"-{variant}", "")
if not found_variants:
Expand Down