Hello there, I have a consumer generated by <https...
# pact-ruby
m
Hello there, I have a consumer generated by https://github.com/surpher/PactSwift. So all specifications are from V3. We are a provider on pact-ruby. So do you know how can I remove the warning like this:
Copy code
WARN: Ignoring unsupported combine AND for path
Thanks a lot 🙏
blobwave 2
y
At the moment you cant with the pact gem as it only supports up to V2 You can use the pact-reference core (which is built in rust) as a standalone CLI tool, or you could alpha test the pact-ffi gem https://github.com/YOU54F/pact-ruby-ffi I’ve just updated the pact ffi libraries and the interface in the latest gem’s (0.0.3) And example of a verifier is here https://github.com/YOU54F/pact-ruby-ffi/blob/deps/update_libs/spec/pactffi_verifier_spec.rb
m
I'm not sure what your message mean tbh 😬
y
your current pact ruby implementation does not support v3 specification at the moment
m
This ok 🙂 But is there a way to support it? thinking2
y
yes, read above 🙂
m
ahah I read it 😄 The problem is to understand your example here => https://github.com/YOU54F/pact-ruby-ffi/blob/deps/update_libs/spec/pactffi_verifier_spec.rb thinking2 Are you running a test like pact_verifer_cli does? (meaning testing through a open url) Or it is something we can add in our project and test again the test env like
pact-ruby
do? think up
y
So the pact-reference impl in rust is available via the CLI, or via an FFI (Foreign function interface). The current guidance would be to run the verifier CLI against an open URL, to test your provider, in order to support contracts generated in V3 or V4 format. Pact-ruby does not support V3/V4 Pact-ruby-ffi supports V1-V4 utilising the
ffi
gem’s functionality to load the Pact FFI’s functionality via this shared library, providing a very light-weight ruby-equse wrapper around.
Or it is something we can add in our project and test again the test env like
pact-ruby
do?
The end goal would be for you to continue to use pact-ruby gem as usual, with it leveraging the pact-ruby-ffi gem to interface with the new pact-core. The spec linked above, utilises pact-ruby-ffi gem, calling the verifier functions exposed in the FFI. You would start your provider in your ruby tests, rather than requiring it to be started from the outside. This wouldn’t really be exposed to the end user of the pact-ruby interface as its probably a) a bit too low level b) a big shift from the existing pact ruby interface, and we want to keep user facing changes to a minimum.
In the example linked, I am not actually even starting up a provider 🙂 just providing enough args to get the verifier to run, and return a failure due to no pacts to verify
Sorry if this is a little confusing!
m
hum thinking2 And do you have an example of "The end goal would be for you to continue to use pact-ruby gem as usual, with it leveraging the pact-ruby-ffi gem to interface with the new pact-core." ?
y
I don’t no, as it doesn’t exist yet. I have an interactive example here https://killercoda.com/safdotdev/course/safacoda/grpc_plugins_quick_start_ruby which utilises the pact-ffi gem for the consumer side, and the pact_verifier_cli for the provider side, to test a gRPC server. the pact_verifier_cli step in step5, would be relevant to your current use case of needing to use verifier_cli on the command line, with a running server
m
Thanks a lot for having take time with this 🙏 I'll check then 🙇
👍 1