Multiple Provider Verifier type support
See original GitHub issueSoftware versions
- MacOs
- OS: Mac OSX 10.14
- Library version: 8.2.6
- Node Version: 10.16
Expected behaviour
The message Pact should only verify contracts for message type consumers contracts and Http REST provider tests should only verify REST call like PACT type consumer contracts.
Actual behaviour
I have a micro service which has REST endpoints as well as it publishes messages when certain event happens. Hence I have 2 types of Providers in the PACT provider test suite: a MessagePact and a http REST pact; therefore there are 2 *Spec.js files. I am using the PACT broker to verify the providers. The issue I am seeing is when I run all the provider tests together, PACT fails the Message Pact tests while executing the REST provider pacts and vice versa.
My question is is this supported yet? if not is there a way to get around this issue? other than having different broker urls (1 for MessagePact and other for REST).
Steps to reproduce
This is the code snippet for running REST Pact provider verification: (providerPactSpec.js)
return new Verifier().verifyProvider({
provider: serviceId,
pactBrokerUrl: 'url',
pactBrokerUsername: 'user',
pactBrokerPassword: 'pwd',
publishVerificationResult: false,
providerVersion: `git short()`,
timeout: 120000,
});
And this is the code snippet for MessagePact provider verification (messagePactSpec.js).
const messagePact = new MessageProviderPact({
messageProviders: messageProviders,
provider: serviceId,
pactBrokerUrl: 'url',
pactBrokerUsername: 'user',
pactBrokerPassword: 'pwd',
publishVerificationResult: false,
providerVersion: `git short()`,
timeout: 120000,,
});
return await messagePact.verify();
Relevant log files
Will provide if needed
I am willing to contribute to help fix this if this is worth fixing.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (4 by maintainers)
Top GitHub Comments
Closing as the specification now supports this (as above) and this package supports it. It needs to be exposed in Pact JS.
Hey @mefellows and @bethesque that was a very quick turnaround. Appreciate that. I will try different provider names and see if that resolves our issue.