Contract testing across 12 services: is Pact worth it or overkill?
Siobhan O'Rourke@siobhan_tests
We have 12 services now (dont ask how, it happened over three years and two reorgs). The e2e suite is slow and flaky because it needs everything up at once, and the integration bugs we do catch are mostly "service A renamed a field and service B found out in production".
Ive been reading about consumer driven contracts with Pact. Has anyone rolled it out across a bunch of teams? Specifically:
- did teams actually keep the contracts up to date, or did it become another thing to skip
- hosted broker or self hosted
- is it overkill for internal JSON APIs, would schema diff checks on the OpenAPI files get us 80% of the way
i want to write a proposal and id rather hear the war stories before I do.
Top answer
We did Pact for payment flows between 5 services. It worked because we started with only the 2 integrations that broke most often, not everything at once. Few learnings:
- can-i-deploy in the pipeline is the real value. Without it the contracts are just documentation nobody reads
- self hosted broker was fine for us, small container plus postgres
- for simple internal CRUD we do OpenAPI diff checks in CI instead, much cheaper and it catches renamed fields
So both, not either. @siobhan_tests happy to share our pipeline config if useful
Get the best of #it-depends weekly
One email each Monday with the most useful posts. No spam; unsubscribe in one click.
Comments
Sign in to join the conversation.
Sign in to commentArjun Mehta@arjunmehta
We did Pact for payment flows between 5 services. It worked because we started with only the 2 integrations that broke most often, not everything at once. Few learnings:
- can-i-deploy in the pipeline is the real value. Without it the contracts are just documentation nobody reads
- self hosted broker was fine for us, small container plus postgres
- for simple internal CRUD we do OpenAPI diff checks in CI instead, much cheaper and it catches renamed fields
So both, not either. @siobhan_tests happy to share our pipeline config if useful
Rachel Kim@rachelkim
From the PM side: when you pitch it, frame it as "fewer production incidents between teams" and attach the last three incidents as examples. Don't frame it as "a new testing tool". The second one gets deprioritized, the first one gets funded.