Hello Team,

With roughly 3 months left in Queens, we should start to commit to some of the 
Queens goals we discussed during Denver [0]. To that end, [1] sets the 
foundation for streamlining role switching in Patrole.

The current implementation for role switching has many shortcomings:

*         Code readability issues (relies on precisely placed call to 
switch_role() in the code, which gets lost amid the rest of the test code)

*         Unintuitive user interface (always passing in a Boolean value 
needlessly)

*         Not very atomic (there is no convenient "stop button" for the role 
switch; it ends when the test does)

*         Needless code coupling between modules

Proposed approach seeks to fix those issues:

*         Role switch implemented as context manager to make it obvious "what" 
the role switch affects

*         User interface simplified (just call the function, don't worry about 
Boolean value)

*         Role switch made as atomic as possible

*         De-couples code between modules, resulting in cleaner code

Only downside with proposed approach is - unsurprisingly - code churn.

Any feedback/thoughts/questions are appreciated.

[0] https://etherpad.openstack.org/p/qa-queens-ptg
[1] https://review.openstack.org/#/c/521703/

Thanks,

Felipe

__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

Reply via email to