-
Notifications
You must be signed in to change notification settings - Fork 106
docs(consumer): create list of best practice rules #383
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
Conversation
This looks great. for the bug catcher rule - we could show a decision engine response, and dependant on the status returned, the client does and returns something different. removing one of the tests would lean to an enum case and associated code tree not being tested |
All makes sense to me |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Nice that you added Authorization: Bearer xxx
since OPC now checks for that explicitly.
That's a decent idea, I'll see about creating one. Thanks all for the feedback. |
18cdbf2
to
764c8fe
Compare
Nice addition to the documentation, good job! What I noticed is that most of these examples are focussed on HTTP based interactions. In my current project we are exclusively using async message based interactions. It would be nice to cover some best practices for those scenarios as well. What is especially challenging to understand for message based interactions is who should define the contracts and who should verify them (and why). In case of HTTP based interactions, with CDC the consumers of the API are driving the contract definitions, which IMO makes sense. But for Message based interactions, producers of messages are verifying instead of driving the contract definitions. One could argue that the producing side of a message, in case of CDC, could also be driving the contract definitions for message based interactions. Next to that it would be valuable to add some best practices regarding the scope of both the consumer and producer (provider) tests with message based interactions. WDYT? |
thanks for wonderful feedback. messaging pact is certainly an area we want to improve our documentation and best practises as there are some caveats and it can be confusing if a user has prior knowledge of pact via http. We’ve done some have you found some best practises that are working well in your org? We always appreciate contributions so we would love to incorporate some of yours. also curious as to how many message based services are you covering, and how long have you been using Pact to support them. also it may be worth adding an issue to request the doc update, so we can huddle there |
Hi @YOU54F, Thanks for your answer. I will open a ticket for this and add some details on how its used. |
I took a shot at extracting the best practices in the video, and transposing them into a useful set of rules people could use to review tests.
I'm not 100% happy with them, but thought I'd share my thinking (the "Bug Catcher" rule I'm struggling to define clearly, but probably because it's quite a difficult thing to generalise but also give concrete examples concisely).