Skip to content

Commit 0499511

Browse files
committed
Add test to ensure @bors only responds to itself
Test that we only respond when a command is issued to `@bors`, and not to `@bors-servo` or any other `@bors{something}` bot. This came up because a comment on `rust-lang/rust` referenced `@bors-servo` instead of `@bors` and was still approved successfully. The command-parsing changes apparently already fixed this, but add a test to prevent regressions.
1 parent abd0083 commit 0499511

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

homu/tests/test_parse_issue_comment.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,20 @@ def test_multiple_hooks():
497497
assert thirdhook_commands[0].hook_extra is None
498498

499499

500+
def test_similar_name():
501+
"""
502+
Test that a username that starts with 'bors' doesn't trigger.
503+
"""
504+
505+
author = "jack"
506+
body = """
507+
@bors-servo r+
508+
"""
509+
commands = parse_issue_comment(author, body, commit, "bors")
510+
511+
assert len(commands) == 0
512+
513+
500514
def test_parse_up_to_first_unknown_word():
501515
"""
502516
Test that when parsing, once we arrive at an unknown word, we stop parsing

0 commit comments

Comments
 (0)