[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
With roughly 3 months left in Queens, we should start to commit to some of the Queens goals we discussed during Denver . To that end,  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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the OpenStack-dev