Hi! I’ve got some concerns about the pacticipant v...
# pactflow
j
Hi! I’ve got some concerns about the pacticipant version creation process in Pact. Given a pacticipant
p1
that is a consumer of
p2
and provider to
p3
, when
p1
fails to publish his contracts but it successfully publishes verification results, then there is a new version created on pactflow. Since publishing contracts failed, this version is empty. It results in
p2
pipeline failing due to
No pacts found
error. In my case, it’s due to the pipeline design where we have separate jobs running provider verification and consumer pact creation (we split tests into parallel jobs to speed up the pipeline) and the use of java libraries where verification is done by running provider test with a specific flag set to true while publishing consumer contracts is done separately (using gradle plugin or pact cli — doesn’t matter in this case). Don’t you think it would be more resilient if both publishing actions were done in a single cli/api call? How do you publish contracts and verifications? At the same time, it would make versioning easier (when using java lib for one and cli for the latter, you need to make sure the same version is used in both places). I know there is pact-provider-verifier but it’s not that straightforward to combine it with the results of java tests from a separate job. In case of consumer tests you are getting a .json object with the contract after running the test but for provider tests I’m not aware of any solution to pass that information from the test to the cli
y
publishing contracts is a consumer action publishing verification results is a provider action
Don’t you think it would be more resilient if both publishing actions were done in a single cli/api call? How do you publish contracts and verifications?
you have a single application which is acting as both capacities, but these are separate concerns
In my case, it’s due to the pipeline design where we have separate jobs running provider verification and consumer pact creation (we split tests into parallel jobs to speed up the pipeline)
I would expect sep jobs for consumer pact creation and provider verification
when
p1
fails to publish his contracts but it successfully publishes verification results, then there is a new version created on pactflow
Since publishing contracts failed, this version is empty.
which version is empty? the provider version that verified that contracts? It can only verify contracts that exist, so it wouldn’t be verifying those contracts that have failed to publish. The version being empty (assuming this is the version number of the provider that verified pacts), seems a like configuration issue of the provider not passing its version number when verifying and publishing verification results to the broker