-
Notifications
You must be signed in to change notification settings - Fork 234
feat(verifier): Added support of set_no_pacts_is_error feature #541
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
base: master
Are you sure you want to change the base?
feat(verifier): Added support of set_no_pacts_is_error feature #541
Conversation
PR is related to this feature request #462 |
Looks OK to me @levanoz. |
@mefellows Thank you! |
@@ -53,6 +53,13 @@ public interface IPactVerifierSource | |||
/// <returns>Fluent builder</returns> | |||
IPactVerifierSource WithCustomHeader(string name, string value); | |||
|
|||
/// <summary> | |||
/// Return an error or not if no pacts were found when looking up from a broker. Default value is true. |
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.
Does the flag work only with a broker source ? If so, shouldn't the flag be in the IPactBrokerOptions ? Otherwise, the message should be corrected.
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.
Hi @scrocquesel , sorry for the late response.
From what I’ve seen in the core verifier library, the no_pacts_is_error option is defined in VerificationOptions. I initially thought it would be more appropriate to provide it via IPactVerifierSource, but it’s worth noting that this option is only used in the case of a PactBrokerError.
What would you suggest — where would be the best place to add this option?
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.
I think this belongs on IPactBrokerOptions
as it only seems to apply to broker sources, and should be named NoPactsIsError
to match the name used in the FFI and CLI
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.
@adamrodger Thanks for suggestion. I've moved it to IPactBrokerOptions
and renamed to NoPactsIsError
.
@@ -53,6 +53,13 @@ public interface IPactVerifierSource | |||
/// <returns>Fluent builder</returns> | |||
IPactVerifierSource WithCustomHeader(string name, string value); | |||
|
|||
/// <summary> | |||
/// Return an error or not if no pacts were found when looking up from a broker. Default value is true. |
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.
I think this belongs on IPactBrokerOptions
as it only seems to apply to broker sources, and should be named NoPactsIsError
to match the name used in the FFI and CLI
/// Configures the verifier to return an error | ||
/// if no pacts were found when looking up from a broker | ||
/// </summary> | ||
/// <param name="isError"></param> |
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.
docs: Param docs missing
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.
Thanks for review. I've moved it to IPactBrokerOptions and renamed to NoPactsIsError. Also, I've updated xml docs.
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.
Hi @adamrodger could you please review requested changes?
Added support for the set_no_pacts_is_error feature, implemented similarly to how it's done in pact-js and other Pact libraries.