[Discussion] How to avoid regression with real services? (integration tests but not only) #181
Replies: 6 comments 4 replies
-
Should we use GitHub discussions for discussions rather than issues? It's not something I have used before but would be interested to know what others think. |
Beta Was this translation helpful? Give feedback.
-
You can also enable the discussion feature (from project settings, go down to features). |
Beta Was this translation helpful? Give feedback.
-
Hey there, nice discussion! Tests are going to take a couple of minutes longer but in exchange there would be better coverage with integration tests, flexibility in creating test scenarios and simpler maintenance (compared to mocking). It is also important to consider that the build/releases are done in a greater period of time than just minutes. Let me know if you are interested and I can raise a PR in a short time. Maybe it can help make a decision or raise other questions 👍 |
Beta Was this translation helpful? Give feedback.
-
I am interested in seeing a PR around this. I think that we should try to ensure the following when making an integration testing system.
|
Beta Was this translation helpful? Give feedback.
-
MIT and Apache 2 are both fine. When you add your PR can you also include an update to the |
Beta Was this translation helpful? Give feedback.
-
PR for the POC is up 🎉 Please let me know what you think, what can be improved, documented, simplified, etc. |
Beta Was this translation helpful? Give feedback.
-
Introduction
This discussion topic comes from a recent case where despite all tests passed in developing a PR. and despite unit test coverage is good, the library broken on a real test with a real AWS service (running the sample applications). What was the root cause amd wow could this be avoided or prevented?
Discussion
The root cause is fundamentally the need of mocking the S3 client in order to run the unit tests at build time. Doing so, we basically replace real production code behaviour of the client library and the real behaviour of the service. It may therefore happen that the behaviour modelled by the mock logic hides a misbehaviour of the code using the mock.
As far as I know, I see two approaches to address the issue:
Note that bullet 1 above is probably unavoidable in the long run. There are however several cons with this approach:
For these reasons, even if maybe unavoidable, using integration tests is feasible for some level of smoke tests.
We can instead start exploring option n2. How does it work? I see two main options:
PROS and CONS of options 1
PROS
CONS
PROS and CONS of options 2
PROS
CONS
I would also note that both could be a separate project with the goal of simulate a AWS S3 service (maybe Amazon has something similar already)?
All the above is subject to discussion and I am very interest to hear your feedback and to learn if any other approach is available out there.
Beta Was this translation helpful? Give feedback.
All reactions