1

I am using Pact JS for contract testing. I have written both the provider and consumer part and uploaded them to the pact broker. Contracts URLs are pointing to my QA environment. I want to create a Slack webhook that would run on a daily basis and verify that the contract still passes. Is there a way for me to run pact verification on demand without uploading new contracts? Why would I need to change my contracts if I just want to check if nothing changed? this seems like it's a basic functionality everyone should be using, but for the love of me I am unable to find it in the docs

keith meow
  • 11
  • 1

1 Answers1

0

I think you've misunderstood how the pact broker works. It doesn't run provider tests - your CI job for the provider would run that test, and during that stage it will pull the contracts down from the broker and test against your provider (usually locally, but in your case against a QA env).

So in your case, the thing you want to trigger is the provider CI build, not pact broker.

But also, if nothing is changed (i.e. neither the consumer has published a new contract nor provider has changed its implementation) why run a build at all?

Matthew Fellows
  • 3,669
  • 1
  • 15
  • 18
  • So is triggering the provider CI build the only way to go? any chance to run contract tests against the env *after* it's been deployed? I am working with multiple different teams, and it's proving to be difficult to convince them to modify their CI workflows – keith meow Apr 26 '21 at 06:25
  • Might be worth jumping in our community workspace at slack.pact.io / pact-foundation.slack.com and discussing the options there. Short answer is that Pact Broker / Pactflow doesn't run your actual tests, so the solution is likely to be outside of that process. If convincing teams to modify their CI processes to use Pact, you might be interested in https://pactflow.io/blog/bi-directional-contracts/ – Matthew Fellows Apr 27 '21 at 10:20