question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Multiple Provider Verifier type support

See original GitHub issue

Software 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:closed
  • Created 4 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mefellowscommented, Aug 12, 2022

Closing as the specification now supports this (as above) and this package supports it. It needs to be exposed in Pact JS.

1reaction
ckotyancommented, Sep 4, 2019

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Multiple Provider Verifier type support · Issue #179 - GitHub
I have a micro service which has REST endpoints as well as it publishes messages when certain event happens. Hence I have 2...
Read more >
Provider Verification | Pact Docs
Provider Verification. Pact Go supports both HTTP and non-HTTP verification (using plugins). Contract Testing Process (HTTP)​.
Read more >
Write a contract for several providers - Stack Overflow
I have found the solution here: https://github.com/DiUS/pact-jvm/tree/master/pact-jvm-consumer-junit#requiring-a-test-with-multiple- ...
Read more >
What is: Multifactor Authentication - Microsoft Support
You may hear it called "Two-Step Verification" or "Multifactor Authentication" but ... For example, a password is one kind of factor, it's a...
Read more >
Managing owners, users, and permissions - Search Console ...
You must delete all tokens used to verify a specific user's ownership of the property. A user might use multiple methods to verify...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found