Hello, Does the Pact support testing with multiple...
# general
p
Hello, Does the Pact support testing with multiple Providers? Example like below:
Copy code
Frontend Service ====> Auth Service
Frontend Service ====> User Service
Frontend Service ====> Order Service
All of the example services run together in the same environment. Is it possible to configure this?
m
yes
You just need to have a different provider name for each separate integration point
it will create 1 contract file per consumer <==> provider combination
each contract can have 1 or more interactions in it
p
Make sense. Thanks @Matt (pactflow.io / pact-js / pact-go)
👍 1
Hello @Matt (pactflow.io / pact-js / pact-go), I was trying to do the same as you mentioned before. But no option to set provider name in #C9W94PXPY
m
https://github.com/pact-foundation/pact-php#basic-consumer-usage
$config->setProvider(...)
sets the provider name
The provider is set on the pact configuration, not set on the interaction
p
message has been deleted
I follow with the way of phpunit.xml ===> see this from the pact-php
Keep in mind that both the test suite and the arguments array must be the same value.
As you mention in the code. I need to start the mock server manually and set the configuration depending on a test case, right? So I need some example for PHP
However, start Mockserver by manually got slow response on test not sure why
See this file https://github.com/pact-foundation/pact-php/blob/master/src/PhpPact/Consumer/Listener/PactTestListener.php If I need to start Mockserver manually, I will customize it to send pact files to Pactflow. Look like #C9W94PXPY support only config from env
m
Ah sorry I'm not familiar enough with Pact PHP to advise. But it must be possible, it's a very standard scenario.
Might need to raise an issue on the repo to get visibility for the maintainers
p
Yes, you're right. As I try to see issues on #C9W94PXPY I see many things hard to be complete on PHP to connect to Ruby. Firstly, I see the default Listener of the package no has any option to config per integration. I need to customize by myself. Sorry for bothering you @Matt (pactflow.io / pact-js / pact-go).
👍 1
However, thanks so much to support me 🙂
🙌 1
What's the language you hand on?
m
I help maintain JS and Golang
And other general things across the community