pact-foundation / pact-js

JS version of Pact. Pact is a contract testing framework for HTTP APIs and non-HTTP asynchronous messaging systems.
https://pact.io
Other
1.61k stars 344 forks source link

Proposal: Fail with error message any verification against an invalid consumer version tag #469

Open AdamPike opened 4 years ago

AdamPike commented 4 years ago

Feature Request

When running my verification I got a success, happy days. Later I realised that my providerBaseUrl was wrong and this should be failing, after some time I worked out that I had consumerVersionTags: ['master'] but the only version in broker was from a branch, after changing this it failed (correctly). My fault entirely but, It would be great if Pact Verifier alerts me to the fact that there's no pact for those tags rather than giving me a false positive.

bethesque commented 4 years ago

We could add a flag to the selector object for the 'pacts for verification' api to indicate whether or not it was required.

consumerVersionSelectors: [{ tag: 'master', latest: true, required: true }]

bethesque commented 4 years ago

I've added a feature request https://pact.canny.io/feature-requests/p/support-required-true-for-consumer-version-selectors-in-pacts-for-verification-a

mefellows commented 4 years ago

Thanks @AdamPike, We have a similar flag for other use cases so Beth's proposal makes sense to me.

AdamPike commented 4 years ago

Ok, thanks. Closing this one.

mefellows commented 4 years ago

Let's leave it open so we can track the progress @AdamPike .