Reputation: 3935
How can e2e be implemented in production without breaking the consistency of the database ? Imagine that we need to the test scenario is a user registration. If we run this test in production, it will create a fake user every time.
The dilemma is that e2e tests are very important, we have more flexibility to run them in the staging environment. But, in production, we suffer from low data consistency, and we are unable to detect production specific bugs. So, is there a way to properly implement end to end tests in production or should we just stay with them in staging ? Thanks in advance
Upvotes: 3
Views: 2148
Reputation: 535
My advice would be to select which tests you REALLY want to run against production and use these to create a 'Production Smoke Test' or deployment test pack.
With a sufficiently reduced test pack the number of additional users you create should be minimised. This will limit the impact of the issues you raised around fake users.
If you can structure the tests such that you use the fake users for other tests in the pack, then this is a good E2E test for the user lifecycle.
I'm also assuming that there is the ability to delete users in your system?
That in itself is a good test, so I would suggest that the final test of any Production pack you create is to test deleting the 'fake' users you have just created.
Upvotes: 7