feat: added support for message provider using pact broker by pulphix · Pull Request #257 · pact-foundation/pact-python

@pulphix

Added Pact Broker Support for Message Provider Issue #253

@pulphix

@pulphix

elliottmurray

@elliottmurray

This is looking great again! Just one question around the examples tests. I'll need to hook these into CI I think as well. I think I have an example that uses test containers you might want to consider btw.

fix: updated message_pact to wait writing contract process to finish

@pulphix

@pulphix

This is looking great again! Just one question around the examples tests. I'll need to hook these into CI I think as well. I think I have an example that uses test containers you might want to consider btw.

I did change the examples for messages to use a broker docker instance.
In some Etiqa projects, we are using https://github.com/tox-dev/tox-docker
This allows tox to run a docker and run tests against it.

arturoriter

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used this and worked like a charm... anxiously waiting for it to be merged.

},
provider='ContentProvider',
consumer='DetectContentLambda',
pact_dir='pacts'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the pact_dir should not be here anymore and works just fine if you remove it.

'A document created successfully': document_created_handler,
},
provider='ContentProvider',
consumer='DetectContentLambda',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the consumer should no longer be mandatory because does not make sense since you fetch the data from the pact broker

@elliottmurray

Sorry - I've been busy and then sick this week. I'll hopefully get to it this weekend.

elliottmurray

bethesque

return_code, _ = verifier.verify_pacts(pact_files, verbose=False)
assert (return_code == 0), f'Expected returned_code = 0, actual = {return_code}'

def verify_with_broker(self, enable_pending=False, include_wip_pacts_since=None, **kwargs):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this user facing code? It's missing the consumer version selectors. How can we get those supported?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.