pact-foundation / pact-jvm

JVM version of Pact. Enables consumer driven contract testing, providing a mock service and DSL for the consumer project, and interaction playback and verification for the service provider project.
https://docs.pact.io
Apache License 2.0
1.08k stars 480 forks source link

Lack of --retry-while-unknown capability to gradle PactCanIDeployTask #1241

Open AliaksandrValadzko opened 4 years ago

AliaksandrValadzko commented 4 years ago

CanIDeploy can be used with --retry-while-unknown parameter to poll Pact Broker until verification result be published https://docs.pact.io/pact_broker/client_cli/readme#can-i-deploy

gradle PactCanIDeployTask has no such capability au.com.dius.pact.provider.gradle.PactCanIDeployTask

uglyog commented 4 years ago

4.1.11 has been released

rarora-trip commented 3 years ago

Hi @uglyog Thank you for adding retry mechanism. can you please share one example how values will be passed in case of gradle? I tried below and it seem to not care about retry. ./gradlew canIDeploy -Ppacticipant=ProductService -PpacticipantVersion=-Ppact.provider.version -DretryCountWhileUnknown=12 -DretryWhileUnknownInterval=10 -PtoTag=develop --info

Also, If possible can you create gradle task for createTag which can be useful in case service is not on ci-cd

uglyog commented 3 years ago

See https://github.com/pact-foundation/pact-jvm/tree/master/provider/gradle#enabling-retry-when-there-are-unknown-results-4111

uglyog commented 3 years ago

Can you create a separate issue for the createTag task?

rarora-trip commented 3 years ago

@uglyog Thank you for your reply. I checked and used correct variable(i think) ./gradlew canIDeploy -Ppacticipant=ProductService -DretryCountWhileUnknown=12 -DretryWhileUnknownInterval=10 -PtoTag=develop-SNAPSHOT but when updated pact is published by consumer(ContentService) it triggers build through webhook and instead of waiting for build result, it says no.

Computer says no ?_(?)_/? 18:11:02
18:11:02 There is no verified pact between version 7bbc762b578f9338c7865608d9f991e3c9195902 of ProductService and the latest version of ContentService with tag develop-SNAPSHOT (e9bf877249b9558865a18ca643a48aef65e74b07)

uglyog commented 3 years ago

@rarora-trip you need to use -P with Gradle, not -D

uglyog commented 3 years ago

Also, checking the link I posted above, you need to configure it in your Gradle build file. You can't pass the values on the command line.