Closed abhitrivedi closed 4 years ago
isn't by default all the interactions are verified if you don't specify a state?
Yes, if I specify a provider state then all related interactions are executed. However, Im looking for the ability to execute all interactions for a given consumer.
For instance, here is a sample provider config:
Pact.service_provider "MyService" do
honours_pact_with "Foo" do
...
end
honours_pact_with "Bar" do
...
end
honours_pact_with "Baz" do
...
end
end
What I am looking for is the ability to verify all interactions for a specific consumer, something like this:
bundle exec rake pact:verify CONSUMER=Foo
Make a custom rake task, and give it the URL of the pact for just that consumer (making sure you use the "/latest" URL).
https://github.com/pact-foundation/pact-ruby/wiki/Verifying-pacts#using-a-custom-pactverify-task
This will use the app set up from your pact_helper but verify the pacts that you specify instead of the ones configured in the service_provider
block.
Oh, given you're verifying just the changed pact, use the webhook templating to pass the ${pactbroker.pactUrl}
into the CI job, and then pass that URL into the custom rake task using an environment variable.
Hi.
I work with an app that has many consumers. We recently upgraded our pact-broker and I am currently setting up webhooks to verify pacts on
contract_content_changed
event. Im wondering is there a way for the provider to verify pacts from a specific consumer? Looking at the docs I see options for passing in a provider state or a specific interaction, but I couldn't find an option where one could specify "verify all interactions of consumer Foo".