Sentaku - An abstraction layer library
Parthvi Vala (~valaparthvi) |
What is Sentaku? Sentaku is an abstraction layer library. It allows to dynamically choose implementation of an object.
How is Sentaku helpful? Sentaku is helpful while testing a system which has multiple layers implementing the same code, or while using different implementations for setup/teardown.
A sample use case of Sentaku?
Think of a modern day application that consists of different layers such as -
- A rich front-end
- An Internal backend
- REST API
When doing test setup/teardown, we might want to get things done faster, say via REST API or the back-end, but while running the actual acceptance/system tests we might want to run it against the rich user interface. Sentaku makes it easy to select the implementation, i.e. choosing REST or UI or back-end to perform an operation.
A little history about the library? Sentaku was developed as an internal library for ManageIQ's integration_test project. integration_tests contains test cases that have to deal with various layers of ManageIQ appliance, layers such as - UI, REST API, Database and Self-Service UI. integration_tests needed a tool that could make it easier to use the attributes/actions of domain objects via whatever layer they wanted. The plan was to to be able to abstract domain objects under use, so that it would become relatively easy to switch the implementation of an action/attribute to - UI/REST/DB/SSUI.
In simpler words, one can define the elements of an application and all the actions/attributes related to it for the different layers and Sentaku will take care of choosing the implementation of the actions/attributes.
Sample code? Check this code example for a better understanding of Sentaku.
Who would benefit from using Sentaku? Any project that has to deal with more than one layer, say UI and REST, can use Sentaku. Sentaku will help develop a more structured project where object and it's property/actions can be defined separately for all these layers, thus abstracting object from it's property/actions, making the object isolated from all these layers. This will also help write a more organized test suite for the project.
- ELI5 : Context Managers (Sentaku extensively uses context managers, so it would be helpful for the audience to start with a little talk about it)
- What is Sentaku?
- A bit of history about Sentaku, why was it written and why would one want to use it?
- How does Sentaku work?
- Demo on using Sentaku - (An example of defining an object and it's actions and attributes with sentaku and 1-2 test cases to test it all)
- Understand what context managers are.
- Get introduced to the Sentaku library
- Some ideas on writing a structured project and test suite with the use of Sentaku.
- A brief idea about writing tests with pytest.
A little knowledge of pytest would be a plus
Sentaku: Github Repo
My name is Parthvi Vala. I currently work as an AssociateQE for CloudForms at RedHat. My day-to-day task includes filing/verifying bugs and test case automation. Our automation test project is quite extensive and built in python. I like working with Python and Django. I was a 2017 GSoC-er where I worked on a Django Project with Cadasta Foundation. I aspire to give more talks, I have spoken at local meetups but this is my first time submitting a talk at any conference. I like volunteering at conferences, organizing workshops and helping people learn.