-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support message pacts #68
Comments
To be clear, all the above code would appear in the pactman user's test suite. pactman only exposes those things namespaced as |
Looks interesting. Any timescale for an implementation? |
Any updates on this ? |
I have no plans to implement this feature at this time. |
so, this library doesn't support v3 of the pact spec, then. |
It doesn't support the message queue component of version 3, correct, but it does implement the rest of v3. The issue with message queue pacts is that it's never been more than a theoretical use-case for me, so it's been very difficult to approach in a concrete manner. I spit-balled some ideas at the start of this thread, but I honestly have no idea whether they'd be useful or appropriate. I welcome contributions from people with active interest in message pacts. |
@r1chardj0n3s I believe they would be useful. Particularly in the Severless context as shown here in the pact-foundation repo. This is definitely no longer purely theoretical, as Serverless and IaaS is on the rise. I need to get a better grasp of the core lib before I could personally contribute anything of worth. But this feature would definitely be welcome, as we have other devs using To be fair, |
@r1chardj0n3s Maybe update the README to clarify that what the Although @gordol to be fair, the But @r1chardj0n3s the |
@campellcl I look forward to seeing a contribution from you! I have no current need for pact at present, and having someone with a direct need working on the code would be great :) |
One of the main changes in pact v3 was the addition of the message queue format; users should be informed as soon as possible that Pactman is not a viable solution for validating message queue pacts, rather than wading through github issues like I had to do. reecetech/pactman#68
One of the main changes in pact v3 was the addition of the message queue format; users should be informed as soon as possible that Pactman is not a viable solution for validating message queue pacts, rather than wading through github issues like I had to do. reecetech/pactman#68
One of the main changes in pact v3 was the addition of the message queue format; users should be informed as soon as possible that Pactman is not a viable solution for validating message queue pacts, rather than wading through github issues like I had to do. reecetech/pactman#68
Message pacts contain just the request part of a usual pact, though with renamed keys, as per the spec (note that "metaData" should be spelled "metadata".
An issue with message pacts is that there's no common transport like HTTP, so we need to provide a mechanism that can be more flexible to handle a variety of message system APIs. To that end, two components are proposed
First, a method to verify message pacts, extending the existing pytest
pact_verifier
fixture:pact_verifier.verify_message(handler=handle, provider_state=provider_state)
The handler is responsible for accepting the pact structure (the JSON as a Python dict) and invoking the appropriate provider message handler function with the
contents
andmetadata
values.This would be used like so (example shows both a stomp and AWS sqs implementation):
The second addition is for mocking the consumer's generation of messages to capture and verify against a pact:
This would be used like so (stomp example shown):
The
MockConnection
fixture is then used in tests, like this:The text was updated successfully, but these errors were encountered: