Hello. When running the verify job, I am getting t...
# pact-broker
b
Hello. When running the verify job, I am getting this error:
No pacts were found for the consumer versions selected
- This is totally fine however, the job still passes. Is there a way to make it fail in such cases?
b
It depends which client library you're running. Which language is it?
b
Sorry, I should have mentioned that πŸ˜„
JavaScript
t
By default, the Ruby verifier (which pact-js uses) passes if there are no pacts. There is an option to fail if there are no pacts found, but I don't think it's exposed to pact-js
Update: It is not. It's a straightforward change to get this supported, though.
b
Thank you @Timothy Jones
That would be very handy as I think teams are getting a false positive with the current set up
t
You're welcome. Just to make sure there isn't any misunderstanding, I don't have the time to make the change - (which is part of the reason I stopped maintaining pact-js). However, I can happily point you at the right place to do it though - this is the arg mapper that would need to be extended to support
--fail-if-no-pacts-found
https://github.com/pact-foundation/pact-js-core/blob/pact-node/src/verifier.ts#L25 - notes that it is on the
pact-node
branch, not the master branch.
This is the source that I used to check what the argument is called: https://github.com/pact-foundation/pact-ruby-standalone/releases
teams are getting a false positive with the current set up
Note that can-i-deploy will still fail, so the recommended setup of using can-i-deploy to gate deployments will be ok even if teams incorrectly think they're passing verification.
πŸ‘ 1
b
Thanks for that!
I will take a look then. Really appreciate your time on this
b
Thanks @Timothy Jones. There for us even when you’re not there πŸ˜‰
πŸ™Œ 1
πŸ˜‚ 1