pact-foundation / pact-net

.NET 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://pact.io
MIT License
846 stars 232 forks source link

Package without Pact Ruby engine embedded #161

Closed joelfoliveira closed 6 years ago

joelfoliveira commented 6 years ago

Just started using Pact to test API contracts. It would be nice to have Nuget package where the Pact ruby engine was not embedded.

In this case I would like to run the Mock Service on a Docker instance in our pipeline, but the MockProviderService class is forcing the mock service URL to be localhost.

Having the Pact ruby engine embedded is great because it encapsulates all the underlying complexity, but I wonder if it is possible so separate the client libraries with the actual executables of the Pact Mock Service, Pact Provider Verifier and Pact Broker Client so we could have the services running independent and the package provides a framework to talk to the individual components.

The ruby embedded engine could be a additional package.

neilcampbell commented 6 years ago

Hi @uonze Yeah it's definitely possible, however I guess it's a trade off between ease of use and ultimate flexibility. We also need to think about backwards compatibility etc.

With your specific scenario there is PactBuilder.MockService(MockServerPort, host: IPAddress.Any);, which will bind the ruby mock provider to listen on all IP addresses rather than just the loopback address. Does that help?

neilcampbell commented 6 years ago

Also sorry for the slow response!