Skip to content

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

@atra2396

Description

@atra2396

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions