Hi Team, We are looking for an option to tag PACT ...
# pact-jvm
n
Hi Team, We are looking for an option to tag PACT tests with a specific identifier/version. The use case is having a version already promoted to PROD which should use say version x for provider verification and version y for PACTS being written for provider that is still in DEV. How can we specifically tag the PACT file and have the provider select PACTS only corresponding to that version, so that there are no issues running the PACT tests across multiple branches/deployments. Any specific examples for both configuration on consumer side as well as producer side would help.
m
Have you read about branches and environments? Have you seen the nirvana guide?
n
Just read about in the PACT docs, but they are at a very high level. Can you please point me to the documentation for Junit based PACTS?
m
You would normally use the CLI to publish pacts, which is where you would specify the branch (i.e. consumer side). When you deploy, you would use the
pact-broker record-deployment
command to record this, specifing the environment you are deploying to. This covers most “tagging” needs (note: Pact has a tag feature, but we don’t recommend using it for this purpose. see https://docs.pact.io/blog/2021/07/04/why-we-are-getting-rid-of-tags)
See https://docs.pact.io/provider/recommended_configuration for how you setup selectors in your verification