Or "The steps for reaching Pact Nirvana"
This is a technical guide for developers and testers who want to use Pact to implement consumer driven contract testing.
By the end of the guide, you will understand how to create a release pipeline that allows you to independently deploy any application with the confidence that it will work correctly with the other applications in its environment - without having to run a suite of end to end tests.
Although many guides assume a greenfields project with no existing code, this document is intended to also be useful for retrofitting Pact into an existing project.
Before you read this document, you should:
- have a basic understanding of the concepts of both consumer driven contracts and Pact,
- have read the Pact Broker Overview
- have read the section on versioning in the Pact Broker
Each integration is different. Each organisation has different history and culture, and each team may have different processes for development, testing, and deployment. Each of these differences affect the best choices for Pact workflow.
However, there are many similarities in the steps necessary on the journey to a full-featured and effective Pact setup ("Pact Nirvana"). This document describes those steps.
Feel free to pick and choose the steps that apply best to your team. You may implement only the first few steps described below, and just use Pact as a precursor to your standard integration tests; or you may throw away your integration tests altogether and reach "Pact Nirvana".
As Pact has been implemented in many different languages, this document will outline the theory for each step. You will need to consult the documentation of your chosen language to learn the relevant syntax for each task. See the implementation guides section for more information.
- Spike (Optional)
- Write and verify a real Pact
- Automate the contract and verification results exchange
- Allow contracts to change without breaking your builds
- Use tags to ensure your provider is compatible with your production consumer
- Use The Pact “Matrix” as a gateway to deployments
- Prevent missing verifications