Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple pacts for different consumer-provider pairs seem to overwrite each other #108

Open
atra2396 opened this issue Jul 22, 2021 · 0 comments

Comments

@atra2396
Copy link

atra2396 commented Jul 22, 2021

I'm a bit confused about the instructions for having multiple pacts. The README states:

During a test run you're likely to need to write multiple pact interactions for a consumer/provider relationship. pactman will manage the pact file as follows:
...

These instructions make sense if you're trying to split up the same Consumer-Provider relationship into several test files in the same module. But it seems like this applies to having multiple different Consumer-Provider relationships as well - the behavior I am seeing is that only one of my pacts will get created when I run pytest, even though I have two different Consumer-Provider relationships.

This behavior can be seen here in this repo: https://github.com/atra2396/pactman-demo
If you go to the "CatalogService" folder, you will see what I mean; I have two files defining two different relationships (Catalog -> Accounting, and Catalog -> Inventory). But if you run make up && make create-pacts, only the Catalog -> Accounting pact gets created.

I am not adept at writing Python so maybe I am missing something obvious here, I apologize in advance if that's the case. My organization has been considering implementing contract testing in some fashion for a while now, and so far this library seems to be exactly what we'd need to get started. Thank you for all your hard work!

@atra2396 atra2396 changed the title Multiple pacts per consumer Multiple pacts for different consumer-provider pairs seem to ovewrite each other Jul 22, 2021
@atra2396 atra2396 changed the title Multiple pacts for different consumer-provider pairs seem to ovewrite each other Multiple pacts for different consumer-provider pairs seem to overwrite each other Jul 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant