Rachid Lafriakh
06/18/2022, 2:30 PMMike Geeves
06/18/2022, 5:24 PMMike Geeves
06/18/2022, 5:25 PMRachid Lafriakh
06/18/2022, 6:12 PMMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Mike Geeves
06/19/2022, 9:14 PMCONSUMER_NAME = "ig-watcher"
PROVIDER_NAME = "ig-analysis"
@pytest.fixture(scope="session")
def pact(consumer_version):
pact = MessageConsumer(CONSUMER_NAME, tag_with_git_branch=True, version=consumer_version).has_pact_with(
Provider(PROVIDER_NAME),
pact_dir=PACT_DIR,
publish_to_broker=True,
broker_base_url=PACT_BROKER_URL,
broker_username=PACT_BROKER_USERNAME,
broker_password=PACT_BROKER_PASSWORD,
)
yield pact
...followed by pact tests using pact, between provider ig-analysis -> consumer ig-watcher
then the same but for the other providers involved
test_pact_tracker_consumer.py
CONSUMER_NAME = "ig-watcher"
PROVIDER_NAME = "ig-tracker"
@pytest.fixture(scope="session")
def pact(consumer_version):
pact = MessageConsumer(CONSUMER_NAME, tag_with_git_branch=True, version=consumer_version).has_pact_with(
Provider(PROVIDER_NAME),
pact_dir=PACT_DIR,
publish_to_broker=True,
broker_base_url=PACT_BROKER_URL,
broker_username=PACT_BROKER_USERNAME,
broker_password=PACT_BROKER_PASSWORD,
)
yield pact
...followed by pact tests using pact, between provider ig-tracker -> consumer ig-watcher
When the "pact" object [can't think of the correct terminology right now] finishes/finalises/closes etc it will submit the appropriate pact for that pair.
...then another "pact" will do the same for the other pairs.
My graph in the broker does look quite horrible since multiple consumers can receive and consume the same message [bridge vs queue] but that's another problem 😅Rachid Lafriakh
06/20/2022, 9:39 AM