As many, we use microservices in my company and there's some debate in my group whether a microservice has e2e tests on it's own.
I know e2e tests by definition are user flow tests.
Lets take for example anauditing microservice, here we defined to 2 seperate repos/pipelines, audit-backend/audit-ui.
Lets say for the audit-backend for example:
The service receives audits in some https api call, does some processing on it and serves the data on some other apis, lets say we have the following apis:/api/audits (POST/GET).
Can you write e2e tests as part of theaudit-backend pipeline(independant deployment process), or only integration tests?
(Some devs here claim that you can write an 'e2e' tests here by mocking the client), Whats your opinions, does it count as e2e test or is it just an integration test?
- 3Does it make a difference for the quality of the test how you call it?Doc Brown– Doc Brown2024-11-07 06:51:20 +00:00CommentedNov 7, 2024 at 6:51
- @DocBrown, while I see your point, the names we give certain kinds of tests allow developers to have conversations where we make assumptions in lieu of a more detailed discussion. This becomes an issue of communication. I say "end-to-end test" thinking we are making API calls to a microservice, but you think "open a web browser and navigate the user interface." Those tests verify the application at very different levels of abstraction, and have very different execution environments with a very different number of failure scenarios.Greg Burghardt– Greg Burghardt2024-11-07 13:37:59 +00:00CommentedNov 7, 2024 at 13:37
- I would first start by researching what other people define as an end-to-end test:google.com/search?q=end+to+end+test+definition - this can help prime a conversation with your team.Greg Burghardt– Greg Burghardt2024-11-07 13:39:57 +00:00CommentedNov 7, 2024 at 13:39
1 Answer1
End to End tests are perhaps the best defined tests.
Is your test of the microservice part of a larger flowEND toEND? obviously not, because one of those ends is the UI, and it's not in the test.
Is a UI test with a mock api clientEND toEND? obviously not, because one of those ends is the database.
When someone asks, "do we have end to end tests" they mean is the system tested with all the bits put together. Not "are all of the individual parts of the system tested in isolation?".
Explore related questions
See similar questions with these tags.
