-
Notifications
You must be signed in to change notification settings - Fork 79
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
ConsumerVersionSelector - Pacticipant and Version Not Honored. #285
Comments
Thanks for the report. Would you be able to attach the part of the debug log where the verifier binary arguments are called, please? (Note that depending on your setup, there may be tokens in the log, which you'll want to remove). |
Thank you for looking into this. There is one important point I forgot to mention: this is the part of the log that shows the correct / complete
|
Thanks, that log is very helpful. @bethesque Can you take a look at the POST body in the log above? I'm not sure here whether the problem is pact-js not doing the right thing, or the broker not behaving correctly. The post body looks right to me, but perhaps I don't have the right meaning for the query. I had thought the consumerVersionSelectors would reduce the set from the providerVersionTag of |
Docs are here http://docs.pact.io/consumer_version_selectors. The properties you're using aren't supported. |
Thank you for your answer. Does that mean that the Pact Broker and the pact-js library currently are not compatible? According to the Pact Broker documentation the Consumer Version Selectors support But it looks to me that the pact-js library has a different definition: see verifier.ts line 7 referes to VerifierOptions in pact-node. Following that reference brings me to the verifier.ts in pact-js-core line 291. // A ConsumerVersionSelector is a way we specify which pacticipants and
// versions we want to use when configuring verifications.
//
// See https://docs.pact.io/selectors for more
export interface ConsumerVersionSelector {
pacticipant?: string;
tag?: string;
version?: string;
latest?: boolean;
all?: boolean;
} The code comments refer to a dead link https://docs.pact.io/selectors The DepricatedVerifierOptions verifier.ts in pact-js-core line 324 are also not offering the properties that are used by the Pact Broker. interface DeprecatedVerifierOptions {
consumerVersionTag?: string | string[];
providerStatesSetupUrl?: string;
providerVersionTag?: string | string[];
tags?: string[];
} I'm sorry if I don't understand things correctly. But this looks confusing to me. |
Looks like pact-js has incorrect expectations. Is that something you can look at @TimothyJones? The docs for the fields are here: pact-foundation/pact_broker#307 |
Looks like a simple mapping problem. It will be a backwards incompatible type change, so we could wrap that and emit a warning (deprecate) or just update the type so that it's correct. I think the latter is better, because the current behaviour is possibly hiding bugs. @athurner for now, you will have to work around it by passing the correct shape through and casting the object |
In the backend, the field is "latest".
|
Im sure I'm doing something wrong, but I'm not sure how to get that working. Or is there maybe a bug?
I have 2 clients (
ClientA
andClientB
) that have contracts (each tagged 'master') published to the pact broker (version 2.79.1) with providerDemoService
.Pact-Broker Matrix (simplified):
I try to setup a
ConsumerVersionSelector
to validate a specific version of a contract forClientA
with the provider.It looks like the
version
andpacticipant
is not honored. Contracts for both consumers are pulled from the pact broker. The log has the following statement:I have the impression this is a bug because the obvious way to configure the selector does not work. (I'm sorry if I'm wrong and have overlooked something important.)
Thank you for looking into this.
The text was updated successfully, but these errors were encountered: