This is by design, as we feel that synchronous and asynchronous contract tests should be separate.
Could you expand on your requirement to mix them?
@uglyog,
I have done this with having two different consumer names (like consumer and consumer-amqp). The reason we keep them separate is the different types of pacts have to be verified in a different manner.
@uglyog,
the different types of pacts have to be verified in a different manner.
It's also the case when a provider has a consumer A for REST API and consumer B for messaging API.
If I would use just@RunWith(PactRunner), some pact will fail as either AmqpTarget or HttpTarget won't be present. But that separation already tackled by splitting pacts byMessagePactRunnerandRestPactRunner.
So, I think provider side is fully covered for tackling mixed pact types for a single consumer (except for reading pacts of different types for a single json).
Using two different consumer names for the same service also breaks a bit the network graph on pact broker side.
@uglyog Just wondering if there's no other way to distinguish between messaging and HTTP style pacts? From the perspective of a user of this library, the consumer name should ideally be the name of the application. Requiring two different names for a consumer application such as "some-app" and "some-app-messaging" feels a bit unnatural. For example, attempting to follow the advice from https://docs.pact.io/best_practices/pact_nirvana#6-use-tags-to-ensure-your-provider-is-compatible-with-your-production-consumer appears to make the process more complicated when an application can potentially have two associated consumer names.
The problem is the verification tooling expects one or the other. It either interacts with a running HTTP server or it invokes methods to get message payloads. It is all setup in the beginning of the verification process before any pact file is loaded, and will require a big change to be able to do both from the contents of one pact file.
Two big downsides:
A third downside:
@uglyog I understand your reasoning of splitting sync and async tests. But this should not stand in the way of naming your consumer with 1 unique name. Maybe its possible to add the type of contract as an extra parameter? (to the name of the json file and in the content itself)
@peternelissen I have no issue with merging the different types of interactions into one file, but the problem is that will require a change to the file format and need to be implemented across about nine language implementations. It's something that needs be to tracked from the specification project https://github.com/pact-foundation/pact-specification.
@uglyog I understand that implementing this is very complicated.
Would it be possible to create a configuration page for the Network graph, where one can setup aliases? So that at least the "graph looks wrong"-issue can be solved?
@bethesque thoughts?
@broeser we plan to add support to the Pact Broker for multiple types of pacts between the same consumers, but I cannot give you any estimate of when it's going to be picked up I'm afraid.
Here is the feature request: https://pact.canny.io/feature-requests/p/support-multiple-protocols-of-pact-for-the-same-application
Most helpful comment
Two big downsides: