Siim Mardus
08/02/2024, 11:41 AM<consumer>-<provider>.json
. How would I name those then? How would they be treated/handled in the pact broker?
Thanks in advance! 🙇Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Should all interactions be put into one file on the consumer side? (this is what we started with in the beginning)yes, usually
Consumer side works nicely, but on provider side, how would I run only subset of the interactions?in most languages, there is a way to only run specific interactions. e.g. see the filter options for the CLI, most languages expose a version of this: https://docs.pact.io/implementation_guides/rust/pact_verifier_cli
Another option would be to have one test on provider side, but not sure if this is the suggested approach...
Should interactions be put into different contract files on the consumer side?the problem with that, is now you have multiple logical consumers - so you would need to run multiple
can-i-deploy
calls, record-deployment
etc. You’ll likely get tangled in knotsSiim Mardus
08/05/2024, 6:50 AMMatt (pactflow.io / pact-js / pact-go)
@Test
-like annotation, but if you use the JUnit library, I think it reports each interaction separately as different tests.Matt (pactflow.io / pact-js / pact-go)
Siim Mardus
08/05/2024, 7:07 AMSiim Mardus
08/05/2024, 7:13 AMI believe it needs to be one physicalFor context, we are using-like annotation, but if you use the JUnit library, I think it reports each interaction separately as different tests.@Test
pact_erlang
library to run tests in Elixir. I would have to implement the FFI function to test it out.
I think it reports each interaction separately as different tests.I'm just trying to understand what happens over on pact broker side and from the perspective of can-i-deploy when it receives verification results which used the filter options 🤔
Matt (pactflow.io / pact-js / pact-go)
Filtering interactions:
--filter-description <filter-description>
Only validate interactions whose descriptions match this filter (regex format) [env: PACT_DESCRIPTION=]
--filter-state <filter-state>
Only validate interactions whose provider states match this filter (regex format) [env: PACT_PROVIDER_STATE=]
--filter-no-state
Only validate interactions that have no defined provider state [env: PACT_PROVIDER_NO_STATE=]
-c, --filter-consumer <filter-consumer>
Consumer name to filter the pacts to be verified (can be repeated)
We could also extend that to labels (see https://github.com/pact-foundation/pact-specification/issues/75). That would be an obvious thing to doMatt (pactflow.io / pact-js / pact-go)
I’m just trying to understand what happens over on pact broker side and from the perspective of can-i-deploy when it receives verification results which used the filter optionsI’m hoping it doesn’t publish if filter is set
Siim Mardus
08/05/2024, 7:41 AM