Kiran Patel
11/01/2023, 10:43 PMOpenAPISpecification
for the consumers and validating the tests request/response against the OpenAPISpecification
using simple library like this ? doesn't it gives the same schema-based validation same as the bidirectional contract verification ?Matt (pactflow.io / pact-js / pact-go)
Is such pactfile only targeted for bi-directional contract verification supported by pactflow ? as they are not so useful to run as tests for traditional pact provider verification.that’s correct
Matt (pactflow.io / pact-js / pact-go)
If yes, then what is the difference in validating the stubs/mocks against theYes. In fact, we have forked that repository and it’s what is used at the core of the BDCT feature. It’s then wrapped up in the familiar PactFlow workflows with tools likefor the consumers and validating the tests request/response against theOpenAPISpecification
using simple library like this ? doesn’t it gives the same schema-based validation same as the bidirectional contract verification ?OpenAPISpecification
record-deployment
and can-i-deploy
.
The reason for the fork, is that there are several philosophical differences in approaching the problem (e.g. how it supports keywords, and what constitutes breaking changes etc.)
They obviously built it for their own internal use case where they can control certain things, whereas of course PactFlow has a much wider audience to satisfyMatt (pactflow.io / pact-js / pact-go)
Kiran Patel
11/01/2023, 11:03 PMintegrated tests
.Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Kiran Patel
11/01/2023, 11:12 PMKiran Patel
11/01/2023, 11:14 PMMatt (pactflow.io / pact-js / pact-go)
btw, I have also experimented with https://specmatic.in/, which does the same.Would love your feedback on usage of it. One thing about it that I’d like to understand is how it tracks the consumer changes over time, and how you know what consumers use which part of the API (amongst other questions)
Kiran Patel
11/01/2023, 11:17 PMYousaf Nabi (pactflow.io)
.but unfortunately the user base hardly dive into such level of concerns....they simply copy/paste or record the payloads by invoking the real services and continue using until they find they are stale.No tool, can mitigate these types of behaviours. They can be addressed by better development practises, and appropriate check points, whereby there is appropriate peer review, which can pick up and challenge bad practises. You are going to get bitten by bugs at some point, at which point. users which to get that feedback is up to them.
they simply copy/paste or record the payloads by invoking the real services and continue using until they find they are stale.This is an approach, but its reactive, rather than proactive compared to Pact’s approach to CDCT.
So with that we are still limited by the schema-based contract testing, which unfortunately does not give higher guarantee and avoid the need forThis isn’t contract testing sole aim (to remove integrated tests) rather to reduce the number of, and to provide feedback sooner, reducing the size of the haystack when understanding failures. In an integrated environment, you get high levels of confidence which you will always want, as your production env will be integrated, but when an error occurs, you want to be able to pinpoint to the root cause, and that is much easier in isolation. If you’ve tested in isolation, and an error occurs in an integration environment, you know that you have certain touch points which are covered by contracts and okay, and the issue exists elsewhere..integrated tests
Yousaf Nabi (pactflow.io)
Kiran Patel
11/08/2023, 12:55 AM