servo / highfive

Github hooks to provide an encouraging atmosphere for new contributors
Mozilla Public License 2.0
254 stars 58 forks source link

Tidy Errors Integration #26

Open jerneyio opened 9 years ago

jerneyio commented 9 years ago

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: https://github.com/servo/servo/issues/7480

highfive commented 9 years ago

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.

highfive commented 9 years ago

warning Warning warning

jdm commented 9 years ago

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!

jerneyio commented 9 years ago

Sounds good to me. I'll give you a shout next week if I haven't heard back from you by then.

jerneyio commented 9 years ago

Well now I know what the 'Close and comment' button does...

jdm commented 9 years ago

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.

jerneyio commented 9 years ago

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:

jerneyio commented 9 years ago

Here's an overview of the design:

If you'd like anymore info, or have any questions, just let me know.

jerneyio commented 9 years ago

@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

jdm commented 9 years ago

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?

jerneyio commented 9 years ago

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?

jdm commented 9 years ago

Guh, sorry about the long delay.

jdm commented 8 years ago

I plan to rebase this on top of #33 once those changes merge, for the record!