Support protobufs
complete
Matt Fellows
complete
The plugin was created and released last year, and after a period of stabilisation I think we can consider this closed: https://github.com/pactflow/pact-protobuf-plugin/
Matt Fellows
The second developer preview of our gRPC/Protobuf support for Pact is now available. Expanding our previous support for Protobufs, this update brings support for using gRPC directly with Pact tests, using a gRPC mock server in consumer tests and the Pact verifier supporting gRPC
for provider verification tests.
Documentation can be found at https://github.com/pactflow/pact-protobuf-plugin#testing-a-grpc-service-method-interaction
gRPC is supported with:
- Pact-JVM 4.4.0-beta.1 and JUnit 5 (https://github.com/pact-foundation/pact-jvm/tree/master/consumer/junit5 and https://github.com/pact-foundation/pact-jvm/tree/master/provider/junit5)
- Pact-Rust consumer crate 0.9.2 (https://crates.io/crates/pact_consumer)
- Pact Verifier CLI 0.9.10 (https://github.com/pact-foundation/pact-reference/releases/tag/pact_verifier_cli-v0.9.10)The Pactflow gRPC/Protobuf plugin can be downloaded from: https://github.com/pactflow/pact-protobuf-plugin/releases
For examples of Pact tests using gRPC:
- https://github.com/pact-foundation/pact-plugins/tree/main/examples/gRPC/area_calculator/consumer-jvm
- https://github.com/pact-foundation/pact-plugins/tree/main/examples/gRPC/area_calculator/consumer-rust
- https://github.com/pact-foundation/pact-plugins/tree/main/examples/gRPC/area_calculator/provider-jvm
What is coming next?
- We want to bring gRPC support to more languages (see https://github.com/pact-foundation/pact-plugins/projects/1).
- We will be updating the Pact Rust FFI with support for plugins, and then updating Pact-Go and Pact-JS with gRPC support.
- We'd welcome a discussion in the #protobufs channel in Slack
Matt Fellows
Blog post released today that summarises our thinking of the deficiencies in protobufs (and similar technologies) and how contract testing can help. Also, a small teaser on the current prototype... https://pactflow.io/blog/the-case-for-contract-testing-protobufs-grpc-avro/
Matt Fellows
in progress
Follow progress here: https://github.com/pact-foundation/pact-plugins/projects/1
Matt Fellows
Just wanted to put a note here about progress on gRPC/Protobufs. My current thinking is that getting it into the core framework via a plugin infrastructure is the path forward, and the proposal for that has been raised here: https://github.com/pact-foundation/pact-specification/issues/83.
Rafa Espillaque
Any estimations now that this feature is planned? 1-2 months?
Matt Fellows
Rafa Espillaque: I'd say in the next quarter we should have an implementation in a few languages (likely Go and JS, as they are the ones I maintain). More information on use cases/languages/etc. from potential customers like yourself will be really helpful in prioritising features within this space.
Matt Fellows
planned
Design for this feature is underway.
Martin Schneider
Thank you for the details. I saw the update on Slack (from the other Matt). I will give this (https://gist.github.com/mcon/2e3ae3eff0b9712d02e06ac1275b7f65) a try first and see whether I can contribute to it in some way.
Beth
I have no details because I've never used protobufs, and only understand them at a theoretical high level. I do know that protobuf pact has been talked about for quite a while though, and that lots of people are interested in it (I believe the protobufs channel has one of the largest memberships of any of the channels on slack.pact.io.), so I thought I'd add it to the list of feature requests.
What would help would be to get an idea of how we might technically achieve a protobuf pact implementation that could be used across different languages. At the moment, our long term plan for pact is to provide a rust impl that can be called via FFI bindings from each of the Pact native languages. I think one of the challenges with protobufs, from a conversation that I've had with someone who was interested in doing this implementation (I believe it was another Matt!) was the dynamic nature of the mock. Dynamic protobuf mocking was only implemented in a few languages.
Martin Schneider
Do you have any details on this? Any way I can help?
Load More
→