Good morning! The pact nirvana doc set (which is g...
# general
n
Good morning! The pact nirvana doc set (which is great, by the way!) describes how to use the broker in CI/CD pipelines. I'm wondering: are the tests designed to be run locally also (alongside unit tests)? I see value in running the consumer-side tests, as they can fail if they can't generate a pact. But to run the provider-side tests, the machine on which I'm running the tests needs to be connected to a network over which pacts can be pulled from the broker. Is the preference not to run provider-side tests locally, or to fall back to reading pacts out of a folder, or to ensure everyone has access to the broker?
b
Hey @Nicholas Simons, I'd definitely prefer using a broker, that's (in my opinion) the only fail-safe way to make sure you always have the latest contracts and versions. By all means run your provider-side tests locally, too (I think that's a great idea) but you'll need that network connection to the broker (running either 'in the cloud' or somewhere within your company network)
Let's put it this way: is there another way to make sure, without human intervention, that you have the latest contracts in your local pact folder?
n
Hi, As you imply, there is no way to ensure I have the latest pacts in my local folder: a system of caching pacts into a folder so that locally I'm at least testing against a relatively new pact seems complicated and of little value because as soon as I push code to my CI tool, the pipeline would run and test against a pact from the broker anyway. If it's convenient enough for the devs on my team, I'll go with fetching from the broker locally; the second-best option looks like disabling the provider test locally, and only running after pushing code to the CI tool (or on a webhook trigger). Thanks for your reply!
👍 1