0

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?

askedNov 7, 2024 at 6:08
omriman12's user avatar
3
  • 3
    Does it make a difference for the quality of the test how you call it?CommentedNov 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.CommentedNov 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.CommentedNov 7, 2024 at 13:39

1 Answer1

1

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?".

answeredNov 7, 2024 at 11:23
Ewan's user avatar

Your Answer

Sign up orlog in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

By clicking “Post Your Answer”, you agree to ourterms of service and acknowledge you have read ourprivacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.