The document discusses the deployment of microservices and testing strategies, emphasizing the importance of consumer-driven contracts for improving reliability and communication. It contrasts various testing methods, such as unit tests, integration tests, and contract tests, highlighting their strengths and weaknesses. The author advocates for automation and a structured deployment process to enable confident and manageable releases in production environments.
@alexsotob
Advantages Disadvantages
Unit Tests(and Mocks)
14
Cheap
No setup of environment
Fast
Mocks
Reliable
All local, no flaky
Not Trustworthy
How you understand the system
Targeted
You know where it failed
@alexsotob
> Provider Contracts
providercentric, consumers adapts all or nothing
> Consumer Contracts
individual consumer’s needs
> Consumer-driven Contracts
representation of a provider's obligations to all its consumers
Ownership
Different Approaches
20
@alexsotob
> Execute Build
Publishcontracts as artefact version
> Run Head Provider Contract Tests
Check contract compatibility against version contract
> Run Prod Provider Contract Tests
Check contract compatibility against version contract
> Release Consumer
Tag contract with environment name
Deploying Consumer
Steps on CI (Commit Stage)
27
28.
@alexsotob
> Execute Build
Runas usual
> Run Provider Contract Tests
Check contract compatibility against latest contract
> Run Prod Provider Contract Tests
Check contract compatibility against environment contract
> Release Provider
Deploying Provider
Steps on CI (Commit Stage)
28
@alexsotob
Conclusions
31
> End ToEnd Tests
Late feedback
Expensive change
Difficult to orchestrate
> Consumer Driven Contracts
Fail fast
Independent deployments
Improve communication