Test-automation is quite new around here, and we have both “edges” covered by now: Unit Tests and E2E Tests (Web-automation using Playwright).
We would like to introduce other layers of testing, and where it currently hurts is integration between two services. Mostly, service A - would change Endpoint/field/parsing of a value and will break the contract with service B.
Enter contract-testing.
Pact seems to be a popular choice (I would love to hear about other popular options if any to check). Using pack seems to have a little bit of an overhead to it. Mainly, the fact that Service B, will have to supply a “Given” state so Service A tests can run (and that require great skills of communication and time to help between teams). Also, Pack-Broker seems to introduce some complexity.
There’s couple of other options in marked, that focus more on the producer side. Generate OpenAPI schema, and then there’s multiple tools that create diffs between versions (your branch and Mastet for example) to tell if API is broken. Protobuf also help with some of those issues as you use Object-Stubs. Pact main plus is probably being able to verify the VALUE of fields are still correct (in case you parse a specific prefix for example).
I wonder if you have any good/bad opinions about Pact, Pitfalls we should be aware of, alternative and if this has worked for you.
In my personal experience, contract testing with Pact has always worked very efficiently. Initially, teams may be hesitant to adopt it due to the required upfront work, but once they experience it, the value it provides is so significant that they usually end up being very satisfied with the outcome.
In my humble opinion, one of the greatest advantages of using a tool like Pactflow (or contract testing itself) is its automation capabilities and seamless integration into pipelines. However, as you mentioned, it may come with some overhead and complexity.
If you’re curious about the challenges you might face when trying to implement this framework, I recommend checking out our article series on contract testing, which covers multiple situations you might encounter when onboarding a large organization: Road to Pactflow Enterprise.
In my humble opinion, one of the greatest advantages of using a tool like Pactflow (or contract testing itself) is its automation capabilities and seamless integration into pipelines
What do you mean by “automation capabilities”? It doesn’t integrate into the pipeline so easily right? because it require you to now work with Pact files/broker or block your CI because other teams tests etc?
Please feel free to reach out with any other questions or concerns you may have. Good luck with your contract testing journey!
Thank you sharing the articles, I will be checking them today