Heya folks :wave: I am looking for recommendation...
# pact-js
m
Heya folks 👋 I am looking for recommendations on how to efficiently implement “bi-directional testing” via Github webhooks.
What I am able to do: Publish
contract_requiring_verification_published
event in case there is a change in consumer contract
What I need help with: My provider spec has:
Copy code
consumerVersionSelectors: [
				{
					latest: true,
					deployed: true,
					mainBranch: true,
				}
			],
y
Hey BDCT doesn't require the use of webhooks
the comparison results are generated on upload of the consumer or provider contract and results are available when calling can i deploy
m
When I use the
pactUrl
supplied by the webhook, the provider spec successfully pulls the contract from the url. But also then tries to fetch the pact using the consumerVersionSelectors
y
for provider verification (for CDCT) there are two types of verification tasks, one via pactUrl, and one via consumer version selectors
you shouldn't use both together
see https://docs.pact.io/provider/recommended_configuration for guidance on recommmend setup for CDCT verification for providers
m
Hey BDCT doesn’t require the use of webhooks
ah! My apologies. I should rephrase my question. The use case that I am trying to implement is the CDCT wherein if a new version. of consumer test is published, it should invoke a verficiation from the provider
Oh! This helps. The Node example exactly shows what I want to implement. The provider should pull consumer contract from
latest
deployed
when a new version of Provider wants to release The provider should pull contract only from the
pactUrl
and ignore all other opts if it receives the webhook (when new consumer wants to go in with changed contract) The node example nicely shows this use case. Thanks đź’™
y
Solid đź’Ş Yeah the BDCT work, basically provides verification results for your provider (provider contracts are uploaded as part of their func test suite), whereas CDCT will return verification results as an output of your CI test run (where you use either the pactUrl or consumer version selectors) to select pacts to verify. The new webhook
contract_requiring_verification_published
is the recommended method so seems like you are on the right track 🙂
🙌 1
t
#CLS16AVEE please