Joe Risner
10/12/2023, 10:50 PMcan-i-deploy
in CI when a change is made in the contract to an existing field’s data type/expected value. For example:
• Verified contract between consumer (main
branch) & provider (main
branch) has JSON response body field age
as an integer
• Consumer team publishes revised contract (feature-age
branch) to update age
to be a string. Contract for feature-age
branch has status “Unverified” so can-i-deploy
check in CI fails for no verified contract w/ provider. Pull request is blocked from merging to main
due to failing check.
• Provider team implements change to age
field changing it from integer to string in a feature branch and creates a pull request. Pull request can-i-deploy
CI check fails verification because latest version of main
branch in the consumer still has age
as an integer (consumer PR is blocked from merging).
In this situation, neither the provider nor the consumer can merge PRs to implement the data type change to an existing field. I’d like to prevent a consumer from merging to main
if a contract is unverified or failing when comparing to its provider(s) main
branches. And vice versa for providers. can-i-deploy
seems to fit the bill for that as a CI check when adding or removing fields, but when I try to change the data type/expected value for a field, I hit this wall. Any guidance would be appreciated!Pavithra Krishnasamy
10/18/2023, 12:53 PMThomas
10/19/2023, 5:58 AMAllen Ayala
10/19/2023, 3:16 PMBecky Fulton
10/23/2023, 9:31 AMPrakhar Roy
10/23/2023, 1:03 PMGunaraj Shanmugam
10/23/2023, 9:08 PMGET /v1/tickets?user_id=123
which returns list of tickets a user had purchased. Sample response as follows
{
"tickets": [
{ upcoming_ticket1 },
{ upcoming_ticket2 },
{ upcoming_ticket3 },
{ expired_ticket1 },
{ expired_ticket2 }
],
page: 1,
page_size: 5
}
Now, I want to have following 3 UI test cases.
1. TestUserWithOnlyExpiredTickets
2. TestUserWithBothUpcomingAndTickets
3. TestUserWithOnlyUpcomingTickets
While I can create the request/response pairs for these 3 cases that makes the api consumers to test with those contracts, how would the provider validation work for these 3 cases. As I understand from some of the demo videos, the pact broker validates the contract with actual provider. In these 3 examples of contracts, how does the pact broker knows it has to create user with specific state such as the number of tickets with expired/active flag or how do I write the pact to instruct the pact broker to create the users with a given state ? Is there an example that I could refer ?Matt (pactflow.io / pact-js / pact-go)
thibault alix
10/25/2023, 2:03 AM./pact/bin/pactflow publish-provider-contract ./<contract>.json --broker-base-url https://<url>.<http://pactflow.io/|pactflow.io/> --provider "<provider>" --provider-app-version 0.0.1
Error making request to https://<url>.<http://pactflow.io/provider-contracts/provider/<provider>/publish|pactflow.io/provider-contracts/provider/<provider>/publish> status=400 {"errors":{"_body.contract.contentType":["is missing"]}}
provider
.given("a test")
.uponReceiving("a request")
.withRequest({
method: "GET",
path: "/endpoint",
headers: { 'Content-Type': 'application/json' }
})
.willRespondWith({
body: like(jsonResponse),
status: 200,
headers: { 'Content-Type': 'application/json', 'Accept': 'application/json' }
});
any idea what am I missing?Cyrus Devnomad
10/27/2023, 11:55 AManyi
10/27/2023, 2:02 PManyi
10/27/2023, 3:07 PMRuth
10/30/2023, 8:58 PMRavi L
11/01/2023, 11:17 AManyi
11/02/2023, 3:19 PManyi
11/02/2023, 3:21 PManyi
11/02/2023, 3:42 PManyi
11/02/2023, 3:42 PMJoel Whalen
11/03/2023, 1:22 PMPublishing
under Pact JS here is broken https://docs.pact.io/getting_started/sharing_pacts#language-support
Where is the documentation for publishing to pactflow in Pact JS?Joel Whalen
11/03/2023, 2:38 PMPact successfully published for flow-controller version v7 and provider normalizer.
View the published pact at <https://my-company.pactflow.io/pacts/provider/normalizer/consumer/flow-controller/version/v7>
Events detected: contract_published, contract_content_changed (first time any pact published for this consumer with consumer version tagged v7)
Prashanth
11/03/2023, 3:16 PMKevin de Boer
11/08/2023, 1:46 PMKevin de Boer
11/08/2023, 2:49 PMDaniel Phillips
11/08/2023, 5:21 PMInternal Server Error. An error has occurred. The details have been logged with the reference XXXXXXXXX
Does anyone know why this could be, or how I find further information linked to the reference number the response gave me?Prakhar Roy
11/10/2023, 11:54 AMJacob Rede
11/18/2023, 11:31 PMJoel Whalen
11/22/2023, 4:36 PMGazal Gafoor
11/22/2023, 9:33 PMPrakhar Roy
11/27/2023, 6:06 AMJaspal Puri
11/27/2023, 10:26 AM{
"message": "No interaction found for POST some/request/requiring/auth",
"interaction_diffs": [
{
"description": "some description",
"provider_state": "some provider stage",
"headers": {
"Authorization": {
"EXPECTED": "Bearer 1234",
"ACTUAL": "Bearer {{PACTFLOW_API_KEY}}"
}
}
}
]
}