pact-jvm icon indicating copy to clipboard operation
pact-jvm copied to clipboard

Incorrect error message for canIDeploy failed gradle task

Open AliaksandrValadzko opened this issue 3 years ago • 2 comments

Steps to reproduce:

  1. create interaction between serviceA and serviceB;
  2. create failed verification of contract between serviceA and serviceB;
  3. create interaction between serviceC and serviceD;
  4. create failed verification of contract between serviceC and serviceD;
  5. run canIDeploy for serviceA and serviceB
canIDeploy
-Ppacticipant=serviceA
-PpacticipantVersion=versionA
-Ppacticipant=serviceB
-PpacticipantVersion=versionB

Expected resut:

Computer says no ?\_(?)_/? 

There is no verified pact between the latest version of serviceA (versionA) 
and version versionB of serviceB

Actual result:

Computer says no ?\_(?)_/? 

There is no verified pact between the latest version of serviceC (versionC) 
and version versionD of serviceD

Issue pacticipant and pacticipantVersion parameters are ignored in error message for failed canIDeploy task

Note: for verified interaction we still receive valid output, no issue here Computer says yes \o/

AliaksandrValadzko avatar Jun 28 '21 07:06 AliaksandrValadzko

I am unable to replicate this. Can you provide the versions of Pact-JVM, Gradle and the Pact broker you are using?

I have setup the broker as per your example: image image image

And when I run canIDeploy:

$ ./gradlew canIDeploy -Ppacticipant=serviceA -PpacticipantVersion=versionA -Ppacticipant=serviceB -PpacticipantVersion=versionB

> Configure project :

The 'org.jetbrains.kotlin.platform.*' plugins are deprecated and will no longer be available in Kotlin 1.4.
Please migrate the project to the 'org.jetbrains.kotlin.multiplatform' plugin.
See: https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html

> Task :canIDeploy FAILED
Computer says no ¯\_(ツ)_/¯ 

WARN: For production use of can-i-deploy, it is recommended to specify the environment into which you are deploying. Without the environment, this result will not be reliable.
The verification for the pact between the latest version of serviceA (versionA) and version versionB of serviceB failed

FAILURE: Build failed with an exception.

* What went wrong:
Can you deploy? Computer says no ¯\_(ツ)_/¯ 

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 0s

uglyog avatar Jul 17 '21 02:07 uglyog

BTW, the canIDeploy task does not take multiple values for pacticipant and pacticipantVersion, I assume they just overwrite each other, so it is effectively just running ./gradlew canIDeploy -Ppacticipant=serviceB -PpacticipantVersion=versionB

uglyog avatar Jul 17 '21 02:07 uglyog