Hi Team! Could you please let me know if `--state-...
# general
t
Hi Team! Could you please let me know if
--state-change-url
of the pact_verifier_cli accepts several urls? For example, if there are two provider states endpoints as
/app_one/pact/provider_states
and
/app_two/pact/provider_states
m
It does not. How would the verifier know to send the request to one or the other URL?
What's the use case?
t
The case is that our microservice talks to two services which live in monolith. And I added provider states. endpoint for each mono app because it will be easy when we start tearing apart the monolith.
👍 1
and of course I would like to add the verification with monolith to the ci/cd pipeline
👍 1
and I was wondering if I can put these two verifications (microservice <> mono 1 & microservice <> mono 2) to one ci/cd job
of course I can do something like:
Copy code
script:
    - >-
      pact-verifier
      --broker-url="$PACTFLOW_URL"
      --token="$TOKEN"
      --provider-name="monolith"
      ----state-change-url=<http://mono_app_one/pact/provider_states> 
      --publish
     
     - >-
      pact-verifier
      --broker-url="$PACTFLOW_URL"
      --token="$TOKEN"
      --provider-name="monolith"
      ----state-change-url=<http://mono_app_two/pact/provider_states> 
      --publish
but it doesn’t look nice and it will grow..😐
but now I think I can use
matrix
in gitLab, and will be something like:
Copy code
parallel:
    matrix:
      - PATH: [mono_app_one, mono_app_two]
script:
    - >-
      pact-verifier
      --broker-url="$PACTFLOW_URL"
      --token="$TOKEN"
      --provider-name="monolith"
      ----state-change-url=http://${PATH}/pact/provider_states 
      --publish
maybe it will work. If it works, it will create 2 parallel jobs with different provider states endpoints
m
Are you testing against a live microservice connected to the monolith?
t
yes, monolith provides data to microservice
m
You should stub that out in your pact test and then have separate pact tests from each of your microservices to each monoloth
You shouldn't do pact testing against a live environment ideally, especially one with live dependencies
t
You should stub that out in your pact test and then have separate pact tests from each of your microservices to each monoloth
yes, it’s implemented like this. I am wondering if I can put different provider states endpoints into one ci/cd job. I’ll try implement it with matrix, let’s see if it works
t
I’m with Matt in that this doesn’t sound like the appropriate approach to this problem- but if you are really faced with it, I would put a prefix on the state string, and do the separation inside the controller for the state change endpoint
☝️ 1