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.

Verifying pact with in-memory API

See original GitHub issue

Hi! Is it possible to verify pact with in-memory version of the API? As I can found in the previous version of the README, previously we can pass to ServiceProvider custom HTTP client or in-memory HTTP client (for ex. with OWIN). Now in current version I can see that you have removed to support for Microsoft.Owin.Testing. And it says that “You will now be required to start the API and listen on the correct port, as part of the test.” and we can pass only URI to the ServiceProvider. Does it mean that now I can run tests and verify pact only on the really deployed API application (locally or on any environment) and not using in-memory?

Because when I’m trying to verify pact with in-memory API and pass in-memory URI to the provider I got the error like: Errno::ECONNREFUSED: No connection could be made because the target machine actively refused it. - connect(2) for "localhost" port 80

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
tchaiko-bodencommented, Apr 23, 2020

Thanks for the answer @mefellows! It is unfortunate that there is no such possibility. In-memory API provides more flexibility for testing strategy including Pact tests.

Maybe you have some plans to implement it in the nearest future?

0reactions
adamrodgercommented, Aug 26, 2021

The example above is the correct way to host your API so that the external Ruby process can call it. It’s worth noting that’s not an im-memory server though, it’s hosting on a real port and served on localhost.

Read more comments on GitHub >

github_iconTop Results From Across the Web

5 minute guide | Pact Docs
Remember that pact is for testing the contract used for communication, and not for testing particular UI behaviour or business logic.
Read more >
Verify Pact Contract And Continuous Deployment With ...
In this tutorial, we will look at how to set up a provider test, manage state, verify the contract, and deploy using Pact...
Read more >
Enhance your microservice change resilience with contract ...
PACT takes the verification part of the provider's test. It compares the file with hosted in-memory API (for .NET Core example).
Read more >
Seperate Pact Interactions in Provider Verification Tests by ...
Is there a way to seperate the interaction from the pact file such that I could have multiple small verification tests in my...
Read more >
Pact broker : the missing piece of your Consumer-Driven ...
The Pact Broker is an application for sharing for consumer driven contracts and verification results. It is optimized for use with "pacts" ...
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