Jane Wheatley
07/06/2022, 5:32 PMjson
07/06/2022, 5:47 PMJane Wheatley
07/06/2022, 6:00 PMjson
07/06/2022, 6:15 PMJane Wheatley
07/06/2022, 9:15 PMTimothy Jones
07/07/2022, 12:44 AMIt's not well-suited to APIs where we don't control both ends of the implementation, e.g. APIs we provide to clientsThe general case is if you can't know who the consumers are, consumer-driven contract testing is not a good fit. Pact can work if you don't control the implementation, but still know who they are (and can ask them to send you a pact file). It does depend, though- if you're also providing an API client library to your customers, then you can contract test that library. @json’s point about breaking changes being a common point of confusion is spot on. Using Pact will mean you need to think about when you should ask compatibility questions (do I want to fail the master build if the master consumer is not compatible? Often, no). I don't personally use gitflow (and I try to avoid branches, depending on the team), but you can still use pact very effectively with gitflow, github-flow or trunk based - you just need to be clear about when and what you expect to be compatible. Something that may have changed since you last looked at it is that the broker has better support for telling pact which contracts you expect to fail the build. Have a look at pending-pacts and work-in-progress pacts here https://docs.pact.io/pact_broker/advanced_topics/pending_pacts
ruby, python, javascript and golangThese are all languages that pact supports 😎 . They share the same core, so anything you can do in one will work in the others.
Boris
07/07/2022, 12:47 AMBoris
07/07/2022, 12:51 AMTimothy Jones
07/07/2022, 12:51 AMMatt (pactflow.io / pact-js / pact-go)
Jane Wheatley
07/07/2022, 6:00 PMI believe my main concern with Pact was that you're not getting end-to-end tests, cause the frontend is still left out.
In our solution, that's still a pretty big chunk that's not getting tested and while you can say that the interfaces between services work okay (and you can probably even contract test the interface the frontend uses), the code in the frontend itself doesn't get verified.
In addition, I see an overlap between Pact tests and controller/requests specs/test. For a good amount of APIs, we're already verifying their behaviour based on the input -> output, so I'm wondering what Pact offers here in addition.
Jane Wheatley
07/07/2022, 6:00 PMjson
07/07/2022, 6:30 PMjson
07/07/2022, 6:36 PMJane Wheatley
07/07/2022, 7:08 PMJane Wheatley
07/07/2022, 7:13 PMJane Wheatley
07/07/2022, 7:14 PMjson
07/07/2022, 7:18 PMJane Wheatley
07/07/2022, 7:59 PMJane Wheatley
07/07/2022, 9:33 PMTimothy Jones
07/07/2022, 11:24 PMwe're already verifying their behaviour based on the input -> output, so I'm wondering what Pact offers here in addition.Are you also verifying that the input you're testing the controller with is what your client actually sends?
Timothy Jones
07/07/2022, 11:25 PMTimothy Jones
07/08/2022, 1:34 AMTimothy Jones
07/08/2022, 1:36 AMIt's looking like our specs are run against a mock.This is very common. Pact is still a mock - but the difference is that that mock is sharable with the provider, so you check that your mocks are correct. Your team might find the diagrams on this page helpful: https://docs.pact.io/getting_started/how_pact_works
Boris
07/08/2022, 2:15 AMJane Wheatley
07/08/2022, 3:35 AMBoris
07/08/2022, 3:39 AMBoris
07/08/2022, 3:39 AMBoris
07/08/2022, 3:41 AMBoris
07/08/2022, 3:42 AMJane Wheatley
07/08/2022, 3:42 AMBoris
07/08/2022, 3:43 AMJane Wheatley
07/08/2022, 3:43 AMBoris
07/08/2022, 3:45 AMJane Wheatley
07/08/2022, 3:47 AMBoris
07/08/2022, 3:47 AMBoris
07/08/2022, 3:55 AMJane Wheatley
07/08/2022, 3:56 AMJane Wheatley
07/08/2022, 4:00 PMjson
07/08/2022, 4:07 PMjson
07/08/2022, 4:08 PMMatt (pactflow.io / pact-js / pact-go)
Jane Wheatley
07/10/2022, 11:52 PMBoris
07/11/2022, 2:28 AMBoris
07/11/2022, 2:28 AMJane Wheatley
07/11/2022, 2:36 AMBoris
07/11/2022, 2:37 AMBoris
07/11/2022, 2:38 AMJane Wheatley
07/11/2022, 2:38 AM