Hi All :wave: I am curious if somebody dealt with ...
# general
d
Hi All 👋 I am curious if somebody dealt with applying contract tests to libraries. I have a provider with quite complex API, and the team who develops this provider also ships the client library that hides the complexity of this interface. They still want to guard this interface with contract tests, which resulted into contracts between the provider and the library. The library of course is not deployable by itself, so they cannot apply can-i-deploy tool to it. Therefore, when consumers that integrate the library are deployed, there is no way to see if some contracts are broken or not. The alternative is of course to implement contracts between services ignoring the library, but then consumers will need to know the details about the API in between the library and the provider, which is currently nicely hidden from them. Any thoughts? 🙂
p
Hello @Dmitry Korolev. When you wrote "this interface", are you talking about (1) the (network) interface of "Service A" exposed to the "Client library", or (2) the (code) interface of the "Client library" exposed to the "Service B" and "Service C"?
d
Hello Patrice, I meant the network interface exposed by Service A and consumed by Client library.
m
I wrote an answer to this question a while back here :https://pactflow.io/blog/should-i-write-contract-tests-for-client-sdks/
👀 1
We also answered it in one of our AMAs: https://docs.pact.io/help/amas#north-america-2
How can I do contract testing with API clients/SDKS?