I'm a little unclear on the order by which pactici...
# pact-broker
k
I'm a little unclear on the order by which pacticipants should be publishing their results when first setting up new consumers/providers. Say I have a new consumer and provider and I set up my CI process to do the following: Consumer PR: 1. Run consumer test a. New contract should kick off the provider new contract verification task 2. Run
pact-can-i-deploy
Provider PR: 1. Run provider verification test 2. Run
pact-can-i-deploy
If I start the consumer test flow first, the provider new contract verification test will fail with
TypeError: providerVersion
because my provider is new and has not yet run. If I start the provider test flow first, the provider verification will still fail because I have no consumer contracts to verify. How do we avoid these types of race conditions? And will this be something to consider when we have multiple environments (dev, qa, prod, etc.) that the tests are running for the first time?
b
Hi @Kerry McKeever
Have you done the CI/CD workshop?
the provider verification will still fail because I have no consumer contracts to verify.
There is a switch to turn this off
k
Hey Beth! I'm actually in the middle of that right now after stumbling a bit in setting up my own applications' pact tests. I was testing the provider and consumer in the CI/CD workshop on "what if" scenarios, and this was one of them. I knew there was a switch for the consumer to not fail if the provider test wasn't yet executed, but wasn't aware the provider had a similar switch if the consumer wasn't yet published.
Guess I should continue reading the workshop 😄
👍 1
👍🏼 1