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 479 forks source link

[Provider-Maven] Build now fails if there is no pact to verify #713

Closed AlexTess closed 6 years ago

AlexTess commented 6 years ago

I've recently upgraded pact to 3.5.18 (for features I needed) and noticed that now the build fails if there is no pact to verify. "No pact files were found for provider XXXX"

I find this problematic as provider may not know when new contracts will be published by consumer to be verified, so having the provider pact-verify always active, regardless if there is contract to verify at this stage, is preferable (than commenting the verify until contracts are published). I don't really believe it should be a build failure condition.

What is the reasoning behind this? is it possible to change this back to previous behavior ?

Thanks ! :)

uglyog commented 6 years ago

Are you running the verification tests with Gradle, Maven or JUnit?

AlexTess commented 6 years ago

Using Maven plugin.

uglyog commented 6 years ago

That was by accident, not design. The reason that the default behaviour is to fail when there are no pacts to verify is to avoid any false positives. If the project is mis-configured (say the provider name is misspelt or the pact directory name is incorrect) and no pacts are found, then if the build passes everyone could assume that the provider has been verified, when it has not.

But I will add an option to explicitly turn off this behaviour.

uglyog commented 6 years ago

3.5.19 has been released with this fix

AlexTess commented 6 years ago

Thanks !