-
Notifications
You must be signed in to change notification settings - Fork 138
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
Feat/async message producer #725
Merged
JP-Ellis
merged 12 commits into
pact-foundation:master
from
valkolovos:feat/async-message-producer
Jul 18, 2024
Merged
Feat/async message producer #725
JP-Ellis
merged 12 commits into
pact-foundation:master
from
valkolovos:feat/async-message-producer
Jul 18, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
149e29b
to
e65ba47
Compare
Good news! I have got this to work properly 🎉 Thank you so much for the effort @valkolovos. The tests will fail in CI at the moment as we will need to wait for a new release of the Pact FFI. |
3 tasks
With this PR, async message providers (aka producers) are now (mostly) working, so that the `pact.v3` module supports both asynchronous message providers and consumers.
The provider subprocess has an issue whereby logging is not inherited from the parent Python process. This has been fixed by passing an additional `log_level` argument which will configure logging (if not already enabled). This means that the `logger` instance can be used consistently throughout the codebase. A few minor log fixes are also included in this commit. Signed-off-by: JP-Ellis <[email protected]>
Truncating to the first and last 6 bytes/chars was far too little to be useful. Bumping both up to 128. Signed-off-by: JP-Ellis <[email protected]>
Signed-off-by: JP-Ellis <[email protected]>
Signed-off-by: JP-Ellis <[email protected]>
The `InteractionDefinition` class and the way it works with the `Provider` class during testing has been fairly signifcantly refactored. This should hopefully make it clearer and easier to maintaing going forward. Signed-off-by: JP-Ellis <[email protected]>
The `with_binary_file` FFI function is perhaps poorly named, as it doesn't just set the (binary) body of an interaction, but it also sets the matcher to be a content type matcher. It would be best to have two separate FFI calls (which are now supported) of `with_binary_body` and `with_matching_rule`. Signed-off-by: JP-Ellis <[email protected]>
The `__init__` was getting a bit too cluttered, so I have refactored the entire `InteractionDefinition` class into its own module. I have also refacted the nested classes to stand alone now. A minor refactor was also made to avoid assigning custom attributes to the `Flask` app, and some changes were made to the provider initialisation to avoid passing a redundant `self.app` in a method call. Signed-off-by: JP-Ellis <[email protected]>
e65ba47
to
c7f6667
Compare
Signed-off-by: JP-Ellis <[email protected]>
Signed-off-by: JP-Ellis <[email protected]>
See mentioned issue for details. Signed-off-by: JP-Ellis <[email protected]>
JP-Ellis
approved these changes
Jul 18, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📝 Summary
Feature/add support and example messenger consumer using rust engine
🔥 Motivation
Work for Add support and example for verifying a message provider using the Rust engine #379
🔨 Test Plan
Implemented tests for the compatibility suite. Specifically message provider tests for v3 and v4.
🔗 Related issues