-
Notifications
You must be signed in to change notification settings - Fork 52
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
Tidy Errors Integration #26
base: master
Are you sure you want to change the base?
Conversation
Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @test_user_selection_ignore_this (or someone else) soon. |
Thanks for doing this work! I'm not sure precisely when I'll have time to review it, but my intention is to do so this week! |
Sounds good to me. I'll give you a shout next week if I haven't heard back from you by then. |
Well now I know what the 'Close and comment' button does... |
Wow. I just glanced through each of the commits, and this looks like a fairly complicated series of refactorings and test harness changes. Any chance you could summarize the new design so I can orient my feedback appropriately? Additionally, where can I learn more about the mocking and @patch stuff? I have ~0 experience with idiomatic testing in Python. |
Not a problem. I'll address Mock and patch first. You can learn more about Python's mock library here and here. The reason behind using the library is twofold:
|
Here's an overview of the design:
If you'd like anymore info, or have any questions, just let me know. |
@jdm, if you'd rather chat about the design, tests, etc., on the Servo IRC, just let me know. I'm free most days after 5:00 PM EST |
error_re = "\\x1b\[94m(.+?)\\x1b\[0m:\\x1b\[93m(.+?)\\x1b\[0m:\s\\x1b\[91m(.+?)(?:\\x1b\[0m|$)" | ||
cont_comment_re = "\t\\x1b\[\d{2}m(.+?)\\x1b\[0m" | ||
# error_re = "File:\s(.+?)\sLine:\s(.+?)\sComment:\s(.+)" | ||
# cont_comment_re = "(\t.+)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose of these commented lines?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, left over from personal testing. I will remove them.
else: | ||
pass | ||
|
||
def manage_pr_state(self, issue, payload): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_manage_pr_state?
Ok, I finally finished reading the changes; apologies for the long delay! Thank you again for tackling this, and for spending time to improve the architecture of the code! Generally, I think many of the changes are for the better - we've got some decent separation of concerns now, and it looks like it's easier to both read and reason about in many cases. I'm less clear on the benefits of the test changes; I hope the comments I left in test.py are able to explain my concerns effectively. I am particularly interested in restoring the integration tests that previously existed; I believe those tests verify many of the properties of the bot's behaviour that are most important, and they do so without focusing on the actual implementation. Does that make sense? |
No worries on the delay, I appreciate you taking the time to look over the code. Thank you for the valuable feedback, as well. Outside of test.py, I believe we're on the same page with the changes that should be made. As far as test.py is concerned, I'd like to discuss what kind of tests should be run and where. I'm relatively new to testing, and after reviewing your comments I see I may have gone on a unit testing rampage in an effort to get as much code coverage as possible. Before I do any refactoring of test.py, I'd like to make sure we agree on what should be done. Here's what I propose:
What do you think? |
Guh, sorry about the long delay.
|
I plan to rebase this on top of #33 once those changes merge, for the record! |
err_match = None | ||
i = 0 | ||
|
||
while not err_match and i < len(log_list): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be better structured as a standard for log in log_list:
with a if err_match:
conditional inside
A lot of refactoring took place, mostly moving code into classes and removing existing tests in favor of using python's unittest module.
I still need to determine a way to test this to make sure the CGI Script reacts properly to the json inputs (possibly just integration tests).
PR for: servo/servo#7480