pact-foundation / pact-cplusplus

C++ DSL for Pact Library
https://pact.io
MIT License
9 stars 4 forks source link

Feature Request: Implement API for generating contract using the v4 Pact Specification #4

Open adamdama opened 1 year ago

adamdama commented 1 year ago

Context

We are currently undergoing a large scale project of adding contract testing to components being run on embedded devices. As embedded device components they are written in either C++ or Rust and compiled to binaries which are delivered out to the hardware devices.

These components communicate between each other primarily in 5 ways:

For the HTTP Request + Response and asynchronous messages the current implementation of the C++ library using the v3 spec is sufficient. However a large amount of our inter-component communications are synchronous messages over WebSockets. We have not yet started looking at the dbus communications but that will come up in the not so distant future.

We have written a pact plugin that supports WebSocket connections and have started using this to create contract tests between the components. This works really nicely in Rust as the Rust API is the reference and has support for synchronous message contracts and also loading plugins. However in C++ we have resorted to using the FFI functions directly. While this is working we feel that the developer experience is worse and there is a larger amount of effort involved when compared to using the fluid API interface of the pact-cplusplus library.

The Request

We would like to be able to use the pact-cpluscplus library to create Pact v4 spec contracts so that we can A) load plugins WebSockets and likely in the future dbus and B) create synchronous message contracts. Therefore we are requesting that the library be updated to offer this functionality.

YOU54F commented 1 year ago

thanks for the feature request @adamdama

i don’t think we in the core team will have the capacity to pick this up any time soon however we have had interest in authoring pact client libraries and integrating with the ffi so i’m planning on running a workshop soon.

would you or your team be interested in working on implementing the functionality in this repo and if so, what guidance if any do you need and i can help sort