Skip to content

Added regression test for issue #4643 #4893

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kitsiosk
Copy link

Added regression test for issue #4643, which was resolved in PR #4868.

The test below is automatically generated and serves as a regression test for PR #4868 because it:

  • passes, and
  • fails in the codebase before the PR.

This is part of our research at the ZEST group of University of Zurich in collaboration with Mozilla.
If you have any suggestions, questions, or simply want to learn more, feel free to contact us at [email protected] and [email protected].

Click to see which lines were covered.
diff --git a/bugbug/tools/code_review.py b/bugbug/tools/code_review.py
--- a/bugbug/tools/code_review.py
+++ b/bugbug/tools/code_review.py
@@ -1042,8 +1042,11 @@
                 if scope["has_added_lines"]
                 else patched_file.source_file[2:]
             ),
-            start_line=scope["line_start"],
-            end_line=scope["line_end"],
+            # Note(suhaib): We were previously using the hunk's scope instead of# ✅ Covered by above test
+            # the line number returned by the model. This was changed to reduce# ✅ Covered by above test
+            # confusion: https://github.com/mozilla/bugbug/issues/4643# ✅ Covered by above test
+            start_line=line_number,# ✅ Covered by above test
+            end_line=line_number,# ✅ Covered by above test
             content=comment["comment"],
             on_removed_code=not scope["has_added_lines"],
         )

Line coverage* achieved: 100.0%

* Line coverage is calculated over the lines added in this PR.

@marco-c marco-c requested a review from suhaibmujahid March 21, 2025 16:33
@kitsiosk
Copy link
Author

Hi, the test failure seems pre-existing: I removed my test and re-run the tests locally and it still fails. Let me know if I should dig further.



def test_generate_processed_output_attaches_comment_to_correct_line():
# Regression test for https://github.com/mozilla/bugbug/issues/4643
Copy link
Member

Choose a reason for hiding this comment

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

The issue was not a bug; it was a feature request. Looking at the test again, it does not seem to test the changed code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants