Hey folks, there's no pact-protobuf channel so ask...
# general
s
Hey folks, there's no pact-protobuf channel so asking here. I was looking for a way to pass metadata (e.g. via WithMetadata in pact-go) but it doesn't look like pact-protobuf actually consumes the metadata correctly - note the
None
as the last parameter: https://github.com/pactflow/pact-protobuf-plugin/blob/main/src/protobuf.rs#L301 I'm not familiar with this codebase enough (and have 0.1 rust experience), so not sure how to fix this properly, and how to make sure you can support matchers on metadata fields.
reading more about this, it doesn't look like
withMetadata
is supposed to work with plugins at all, or is? Seems like for grpc service interaction response metadata is embedded in the message config, so maybe it would be a good idea to add
pact:metadata
key to the protobuf message I wonder?
m
It looks like metadata is supported (see readme here: https://github.com/pactflow/pact-protobuf-plugin)
But you’re right, for plugins, it doesn’t use the
withMetadata
construct
It looks like you can specify it using the
responseMetadata
property in the test
s
yeah, that seems to work for testing grpc services, but not single async messages (e.g. kafka). I'll see if I can learn enough rust to copy the parts of response implementation to the message pact too, but will take me some time probably 🙂
m
ah, I see