Skip to content
This repository has been archived by the owner on May 10, 2022. It is now read-only.

Incorrect work of pact-mock_server #53

Open
ichyr opened this issue Feb 12, 2016 · 4 comments
Open

Incorrect work of pact-mock_server #53

ichyr opened this issue Feb 12, 2016 · 4 comments

Comments

@ichyr
Copy link

ichyr commented Feb 12, 2016

@mefellows @uglyog

I'm using pact-consumer-js-dsl to generate pacts. But found interesting behaviour.

Currently I have 4 pairs of consumer-providers. I run gulp task to run the test cases with pact-dsl to generate them and they all go to the same instance of running pact_mock server. I start it before the tests run.

As a result I have 4 jsons with correct names,. The first json lists correctly the pair C1-P1 and C1P1 interactions but the second json lists C2-P2 and interaction C1P1 + C2P2. Where C = consumer, P = provider. And so on. Last json has all interactions in it but with C4P4.

How can this be overcome? I need json files with interactions specific for specific C-P pair only.

@mefellows
Copy link
Contributor

Hi @ichyr, it sounds like your problem is that you are running the mock service between each C-P pair. I'm no expert on the Mock Service, however as I understand it you should start the service for each combination of C-P. Have you tried this approach?

@ichyr
Copy link
Author

ichyr commented Feb 17, 2016

@mefellows But this is more or less not very efficient. I'm developing Angular.js front-end application that consumed data from microservice infrastructure ( thus one consumer with multiple providers ). I have moved all my pact generation jasmine specs into seperate guild job, but they still run in one batch.

How should this be resolved?

In my opinion this is the way it is supposed to be - run all pact generation script at once.

But current implementation implies that the pact_mock-server should be fired before and shut down after each batch of test with same C-P pair. This is a mess.

@ichyr
Copy link
Author

ichyr commented Feb 17, 2016

@mefellows @uglyog
maybe you already have some patterns to solve problems like mine?

@uglyog
Copy link

uglyog commented Feb 18, 2016

We are looking at ways of fixing this, probably by creating a standard mock server for all language implementations. Unfortunately, this won't be something that can be fixed in the short term.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants