Closed Bug 1111314 Opened 11 years ago Closed 11 years ago

Refactor and create unit tests for regression.py in mozregression

Categories

(Testing :: mozregression, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: parkouss, Assigned: parkouss)

References

Details

Attachments

(1 file, 1 obsolete file)

Currently regression.py is the last (pretty) big file that is not unit tested. I would like to rework it - refactor it for a better separation of concerns and make it more unit testable. I started working on it. Here is my approach on this: split the regression.py file in two: - bisector.py - main.py The main.py file will handle parameters reading, from command line and config file (see bug 1111310) and will run a BisectRunner located in bisector.py The bisector.py will contain some classes, with the entry point BisectRunner: - a Bisector class: will handle the logic of bisecting (manipulate build_data, start launchers, ask for good/bad and go one way or the other). The Bisector will "fire" events to a bisectorhandler (below) - a BisectorHandler class: This will react to events of the Bisector (build_good, build_bad, build_retry, ...). the build_data will be accessible to this class in a read only mode, so it will be able to show progress for example. From this class, There will be two subclasses: - InboundHandler - NightlyHandler - finally the BisectRunner class: it will handle the logic of creating Bisector/handlers, go from nightly to inbound when it applies, be able to show the resume options, ...) Does that make sense to you ?
I think it is pretty obvious but to be more accurate, main.py will also setup some things like logging, cache control (bug 1019528), ...
Attached file regression refactoring (obsolete) —
Hey guys, As we are now official core contributors, I would like your feedback on this ! This is a big change to make things simpler in regression.py and make a better separation of concerns. Currently the branch https://github.com/parkouss/mozregression/compare/refactor_regression only show the code that will replace (I hope) current implementation of regression.py. It is already basically functional. I know I will have to rebase with some incoming pull requests but that won't be too difficult. Tell me if that is a direction you also want to take for mozregression. :)
Attachment #8537764 - Flags: feedback?(wlachance)
Attachment #8537764 - Flags: feedback?(samdgarrett)
Comment on attachment 8537764 [details] regression refactoring Removing feedbacks flags as a review is needed now.
Attachment #8537764 - Flags: feedback?(wlachance)
Attachment #8537764 - Flags: feedback?(samdgarrett)
Hi guys, There is some big changes here, and I would really appreciate if you can do a review on this one. William, I know that you are busy, but if you have some time, that will sure help.
Attachment #8537764 - Attachment is obsolete: true
Attachment #8539243 - Flags: review?(wlachance)
Attachment #8539243 - Flags: review?(samdgarrett)
See Also: → 1088480
See Also: → 1114562
I will wait until 2014-12-26, and merge this in if no one gives any feedback. It seems fine to me anyway, and there are other things I want to work on that will require this.
Comment on attachment 8539243 [details] [review] refactoring regression module Merged this in. I hope that won't hurt. :)
Attachment #8539243 - Flags: review?(wlachance)
Attachment #8539243 - Flags: review?(samdgarrett)
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: