[openstack-dev] [qa] [patrole] Proposed role switch overhaul to framework

MONTEIRO, FELIPE C fm577c at att.com
Tue Nov 28 02:19:08 UTC 2017


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20171128/599bfe49/attachment.html>


More information about the OpenStack-dev mailing list