A
A
Alexander2019-05-26 14:26:44
Python
Alexander, 2019-05-26 14:26:44

How to build an architecture for autotests?

Hello!
There was a rather difficult question for me about how to approach the automation of testing the API of several microservices that are written in python and go. I already tried to approach this solution with python and pytest, but immediately realized that it would be extremely difficult to maintain tests and extend them. And I can not find examples that are worthy of attention.
Given: microservices A, B, C. Each of them has several (tens) api endpoints. There is a task to cover all APIs with functional tests, as well as integration ones. In the original version, I used fixtures as wrappers over the logic of the service. But at some point I thought that one abstraction is not enough, because there is a lot to change and supplement. But is it necessary to add another layer between logic and tests?
I cannot find materials that fully describe approaches to solving automation tasks and problems. Maybe I missed some materials/books/courses? Any worthwhile thing, paid and free, will do.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
OnYourLips, 2019-05-26
@netolyrg

What is your role: programmer, full stack or technical director?
The question on one side goes out of the scope of the programmer's work.
Unittests with mocks. The maximum number of such tests, they are the most effective.
Integration tests are primitive (through a couple of components) with mocks, if possible, the rest with fixtures.
System tests are already done outside of the Python ecosystem. External dependencies usually stabilize.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question