Timothy Jones
08/03/2022, 11:32 PMpollet
08/04/2022, 12:25 PMLaura Cabantous
08/08/2022, 10:42 AMwith 30000 ms timeout for Pact
. I've tried to increase the timeout (quite significantly but it still fails with the same message).
Is there any way to check why it times out? It seems due to a promise that doesn't resolve...
Also it seems to be specifically when looking to get the provider to respond with status 400 š¤Gueorgui
08/09/2022, 10:48 AMJean Paiva
08/10/2022, 7:03 PMpact-provider-verifier
and I installed it through gem
.
On my use case I needed to use a header called response-format
(all lower case)but it seems like when pact-provider-verifier does the request it changes the header and capitalizes it to Resonse-Format
, is there a way to prevent this from happening and being able to use the header all lower case?Daniel Tischner
08/11/2022, 7:28 AMfromProviderState
mechanism. Its not language specific, but I'll use the JVM examples.
A frequent situation, also shown in the docs, would be that a consumer is asking for a specific situation:
builder.given("product with ID 10 exists")
.uponReceiving("get product with ID 10")
.method("GET")
.path("/product/10")
...
In this example the consumer had to came up with an ID that might exist for a product. (And the provider will then have to adhere to that, making product 10 available).
Would this also be a valid application for fromProviderState
to let the provider decide on the ID of an existing product? (All examples I found in the docs only relate to autogenerated IDs that can not really be picked by the consumer without making life hard for the provider. And they are also mostly focused on using fromProviderState
for the response part, i.e. after willRespondWith()
.)
I.e. should we write this code instead as
builder.given("a product exists")
.uponReceiving("get that product")
.method("GET")
.pathFromProviderState("/product/\${id}", "/product/10")
...
with a provider having a state like
@State("a product exists")
fun createProduct(params: Map<String, String>): Map<String, Any> {
val product = ... // maybe create that product in the DB or something
return mapOf("id" to product.id)
}
Thanks in advance and cheers šDaniel Tischner
08/12/2022, 8:46 AMfromProviderState
design. Where do I ideally draw the line when to use it for argument details that the consumer simply does not care about.
Lets say the pact is testing a hello world
response and the API also requires a somewhat unrelated header that the consumer is supposed to send, maybe X-Locale: de
. Now, for the test and pact this argument does not matter, any valid country-code would suffice, fr
for example.
Should the pact on consumer side now explicitly demand de
, using headers("X-Locale", "de")
or let the provider decide on this with headerFromProviderState("X-Locale", "${anyValidLocale}", "de")
?
This question goes even further. Lets say we have to send a complex DTO body, but for the particular pact only one value in it actually matters. Should the rest of the DTO be given by the provider state or should the consumer just specify the full DTO, even though majority of it doesnt matter?
Essentially, I am looking for ways to signal to the provider that something was not picked due to any particular reason, but could be anything. So that the provider clearly knows which part of the contract is actually important to the consumer.Michel Kaporin
08/12/2022, 11:58 AMGET /path/to/resource?version=2021-09-21
with the parameter targeting a specific date of the API specification. In other words, when new API breaking changes get published, API provider creates completely new OpenAPI specification that consumers have to switch to if they want to target the latest version. The old versions are being supported until a certain deprecation date. You can read more here, if you need a more detailed explanation.
How would the consumer and provider contract testing flow look like in such scenario?Prateek Madapurmath
08/15/2022, 1:20 AMPrateek Madapurmath
08/15/2022, 7:30 PMCyrus Devnomad
08/16/2022, 6:24 AMThai Le
08/16/2022, 3:21 PMHazem Borham
08/16/2022, 7:24 PMBen Hubbard
08/17/2022, 9:33 AMSushant Soni
08/17/2022, 9:49 AMSushant Soni
08/18/2022, 10:49 AMerror
logLevel. How to make it manageable and to be able to debug from those?
maybe a flag to not show the actual responses but just the error and differences. or any other tips?Subrahmanyam Rentala
08/18/2022, 3:58 PM/Users/srentala/Desktop/Pact/pacts
{
"consumer": {
"name": "test-consumer"
},
"provider": {
"name": "test-provider"
},
"interactions": [
{
"description": "a request to get the machine IP",
"providerState": "a endpoint to get IP",
"request": {
"method": "GET",
"path": "/product"
},
"response": {
"status": 200,
"headers": {
"Content-Type": "application/json; charset=utf-8"
},
"body": {
"ip": "81.96.249.131"
},
"matchingRules": {
"$.headers.Content-Type": {
"match": "regex",
"regex": "^application\\/json"
},
"$.body": {
"match": "type"
}
}
}
}
],
"metadata": {
"pactSpecification": {
"version": "2.0.0"
}
}
}
I am running the following command to create a mock server using Pact : pact-mock-service --consumer test-consumer --provider test-provider --port 1234 --pact-dir=/Users/srentala/Desktop/Pact/pacts
but on hitting the endpoint from Postman, it gives following āno interactions foundā . What am I missing here?Alejandro VĆ©lez-Calderón
08/18/2022, 7:20 PMrecord-deployment
as part of our CI/CD process.
If a provider version (git sha) was never required to verify a pact should we still use record-deployment
when deploying that version of the provider? We are only using consumer driven contract testing, and leverage the contract_requiring_verification_published
event so the consumer in some cases never triggers a provider build because the content is the same. Should we be leveraging create-or-update-version
first in this case?Sushant Soni
08/19/2022, 2:05 PMdavid nguyen
08/20/2022, 8:03 AMŠŠ»Š°Ńа ŠŃŃŃŠ·Š¾Š²Š°
08/22/2022, 10:07 AMŠŠ»Š°Ńа ŠŃŃŃŠ·Š¾Š²Š°
08/23/2022, 9:02 AMŠŠ»Š°Ńа ŠŃŃŃŠ·Š¾Š²Š°
08/23/2022, 9:09 AMAlejandro Vélez-Calderón
08/23/2022, 1:32 PMcontract_requiring_verification_published
event was detected when publishing a pact? the pact content is not changing and I believe we are populating all the required fields. I also see this message beside it (pact content is the same as previous versions with tags and no new tags were applied)
Rubem Ferreira
08/23/2022, 5:44 PMpedro
08/23/2022, 9:15 PMAlan Zhu
08/25/2022, 2:07 AMAmi Tabak
08/25/2022, 6:07 AMJan Matusz
08/25/2022, 7:30 AMstaging
for develop branch, and production
for master branch). We have noticed a potential obstacle:
⢠have a query User{fullname}
,
⢠lets assume we want to change that query to return firstName, lastName
our initial thought was:
⢠lets change the provider to return {firstName, lastName, fullName}
⢠then we are able to make changes in the consumer, and deploy to staging
⢠then we are able to remove the redundant & unused fullName
from the provider, and deploy to staging
that would work okay for develop branch, but then if code gets merged to master
, we wouldn't be able to deploy provider (as the currently deployed production
consumer still requires fullName
to be passed)
and in such case, we are unsure how to proceed.Thomas Shipley
08/25/2022, 9:41 AM