Microservices shared end-to-end testing: Which version(s) of other microservices to use?
Introduction I am reading Building Microservices (second edition) by Sam Newman. In chapter 9 the author highlights 2 problems when desiging end-to-end testing for microservices: Which version of the other microservices should we use? If we have a microservice with end-to-end tests that deploy lots of microservices and run tests against them, what about the end-to-end tests that the other microservices run? The author proposes both problems can be resolved by having multiple piplines "fan-in" to a single end-to-end test stage: We can deal with both of these problems elegantly by having multiple pipelines “fan-in” to a single end-to-end test stage. Here, when one of a number of different builds is triggered, it can result in shared build steps being triggered. For example, in Figure 9-8, a successful build for any of the four microservices would end up triggering the shared end-to-end tests stage. Question I am uncertain about problem 1: "Which version of the other microservices should we use?" Should the version of the other microservices be: Production, or Last successful build, or A combination of the above? With version 1 (production) or version 2 (last successful build), there will be scenarios where a combination of two or more simultaneous and independent deployments of microservices will not have had the corresponding end-to-end testing environment. Production: Pre-testing production environment: {A1, B1} Building: {A2, B2} End-to-end testing stage A2: {A2, B1} End-to-end testing stage B2: {A1, B2} Releasing: {A2, B2} Post-testing production environment: {A2, B2} (A2 not tested against B2 and vice versa) Latest build: Pre-testing production environment: {A1, B1} Building: {A2, B2} Testing stage A2: {A2, B1} (B2 does not exist yet) Testing stage B2: {A2, B2} Releasing: {B2} Post-testing production environment: {A1, B2} (A2 not released, B2 not tested against A1 and vice versa) I am guessing this only becomes a problem when we're releasing microservices in parallel, and even then there are probably exist safeguards for these edge cases that I am currently unaware of.
Introduction
I am reading Building Microservices (second edition) by Sam Newman.
In chapter 9 the author highlights 2 problems when desiging end-to-end testing for microservices:
- Which version of the other microservices should we use?
- If we have a microservice with end-to-end tests that deploy lots of microservices and run tests against them, what about the end-to-end tests that the other microservices run?
The author proposes both problems can be resolved by having multiple piplines "fan-in" to a single end-to-end test stage:
We can deal with both of these problems elegantly by having multiple pipelines “fan-in” to a single end-to-end test stage. Here, when one of a number of different builds is triggered, it can result in shared build steps being triggered. For example, in Figure 9-8, a successful build for any of the four microservices would end up triggering the shared end-to-end tests stage.
Question
I am uncertain about problem 1: "Which version of the other microservices should we use?"
Should the version of the other microservices be:
- Production, or
- Last successful build, or
- A combination of the above?
With version 1 (production) or version 2 (last successful build), there will be scenarios where a combination of two or more simultaneous and independent deployments of microservices will not have had the corresponding end-to-end testing environment.
Production:
- Pre-testing production environment: {A1, B1}
- Building: {A2, B2}
- End-to-end testing stage A2: {A2, B1}
- End-to-end testing stage B2: {A1, B2}
- Releasing: {A2, B2}
- Post-testing production environment: {A2, B2} (A2 not tested against B2 and vice versa)
Latest build:
- Pre-testing production environment: {A1, B1}
- Building: {A2, B2}
- Testing stage A2: {A2, B1} (B2 does not exist yet)
- Testing stage B2: {A2, B2}
- Releasing: {B2}
- Post-testing production environment: {A1, B2} (A2 not released, B2 not tested against A1 and vice versa)
I am guessing this only becomes a problem when we're releasing microservices in parallel, and even then there are probably exist safeguards for these edge cases that I am currently unaware of.