Omar Sadd
10/05/2022, 2:55 PMKenneth Krause
10/06/2022, 4:58 PMRachel Butler
10/06/2022, 6:30 PMNoor Hashem
10/11/2022, 3:52 PMNoor Hashem
10/11/2022, 5:35 PMAlicia (pactflow.io)
Cyrus Devnomad
10/13/2022, 11:53 AM{
"recipients": [
{
"firstName": "string",
"lastName": "string",
"emailAddress": "string"
}
],
"subject": "string",
"content": "string"
}
And I have a consumer which sends a request to the provider with following request body:
{
"Content": "<h1>test</h1>",
"Recipients": [
{
"EmailAddress": "<mailto:test@test.com|test@test.com>",
"FirstName": "Test",
"LastName": "User"
}
],
"Subject": "Test subject"
}
I'm trying to have Pact based bi directional contract testing working between these two apps.
When I publish both the provider OpenAPI definition and the consumer pact, Pactflow complains about the consumer pact being incompatible with the provider. The message is like this:
Incompatibility With Provider Contract
Request Body Is Incompatible
Request body is incompatible with the request body schema in the spec file: should NOT have additional properties
Mismatched at:
[root].interactions[0].request.body
I manually changed the pact file to have properties starting with lower letters and then published the manually modified pact file and then Pactflow was happy and there were no more errors about incompatibility.
My question is, can this case sensitive behavior be disabled by some configuration option?
ThanksNigel Finley
10/14/2022, 9:18 PMValidator Error
can't resolve reference #components/schemas/class from id #
Here is the api spec:
openapi: 3.0.0
info:
title: "API"
version: "1.0.0"
components:
schemas:
class:
type: object
properties:
attempted:
type: boolean
paths:
/api/v1/instructor/me:
get:
tags:
- Instructor
description: This will fetch a users classes.
responses:
200:
description: You have successfully found all classes and their status for the current user
content:
application/json:
schema:
type: object
properties:
Classes:
type: array
items:
$ref: '#components/schemas/class'
Elem:
type: array
items:
$ref: '#components/schemas/class'
Trainings:
type: array
items:
$ref: '#components/schemas/class'
Sela:
type: array
items:
$ref: '#components/schemas/class'
SelaFT:
type: array
items:
$ref: '#components/schemas/class'
401:
description: Unauthorized
And here is the consumer contract:
{
"consumer": {
"name": "Consumer"
},
"provider": {
"name": "Provider"
},
"interactions": [
{
"description": "A request for a single user classes",
"providerState": "User exists with no classes",
"request": {
"method": "GET",
"path": "/api/v1/instructor/me",
"headers": {
"Authorization": "Bearer undefined",
"Accept": "application/json, text/plain, */*",
"Cache-Control": "no-cache"
}
},
"response": {
"status": 200,
"headers": {
"Content-Type": "application/json; charset=utf-8 "
},
"body": {
"Classes": [],
"Elementary": [],
"Sela": [],
"SelaFT": [],
"Trainings": []
}
}
}
],
"metadata": {
"pactSpecification": {
"version": "2.0.0"
}
}
}
Hoping to get some guidance as to why I might be receiving this error. I have validated the Spec. One thing I was curious about is I am using the the pact specification of 2.0.0
on the consumer side. Should I be using 3.0.0
?
Thank you!!!Noor Hashem
10/18/2022, 9:40 PMThomas
10/21/2022, 11:01 AMhead
as branch and not master
(as I expected).
Is this the expected behaviour or is something wrong in my pushing script?Francisco Quijada
10/21/2022, 2:13 PMFrancisco Quijada
10/21/2022, 2:40 PMhello, where can I find the broker username and broker password in pactflow?
Brendan Donegan
10/21/2022, 3:38 PMFrancisco Quijada
10/23/2022, 1:06 AMNoor Hashem
10/24/2022, 1:44 PMnpx pact-broker publish ./pacts --branch=$GITHUB_HEAD_REF --broker-base-url=$pact_broker --broker-token=$pact_broker_token --consumer-app-version=${version} --tag testing_tag
. The github workflows always passes on the PR, but for some reason it failed when I tried merging it. I have never see this error before on my PR. The only place I see consumer_version_number
is here, link but i'm working with the webhookless approach. I took a look at the example webhookless consumer on github that you guys have but I also don't see a consumer_version_number in the workflows anywhere.
Please let me know if you'd like me to provide any more information.Noor Hashem
10/24/2022, 7:05 PMRachel Butler
10/25/2022, 3:32 PMError from Pactflow stub: Pact::Error - Value to generate \"[\"string\"]\" does not match regular expression /[A-Za-z0-9]{1,}/
For reference, we have tried both of the two ways (one including a custom example, and the other not):
// Example not included (Pactflow generates randomly)
pactDslRequestWithPath = pactDslRequestWithPath.matchQuery(parameter.getName(), "[A-Za-z0-9]{1,}");
// Example included
pactDslRequestWithPath = pactDslRequestWithPath.matchQuery(parameter.getName(), "[A-Za-z0-9]{1,}", "string");
Here is the relevant part of the contract that was generated:
"request": {
"method": "GET",
"path": "<path>",
"query": "response_type=string&client_id=string&redirect_uri=string&state=string&scope=string",
"matchingRules": {
<path>,
"$.query.response_type": {
"match": "regex",
"regex": "[A-Za-z0-9]{1,}"
},
"$.query.client_id": {
"match": "regex",
"regex": "[A-Za-z0-9]{1,}"
},
...
}
We were facing similar issues with machPath() when we were not including the example, but including the custom example worked in that case.
Has anyone got this feature working with v2 contracts? Am I missing something?Anton Yakutovich
10/28/2022, 7:48 AMBas Dijkstra
10/28/2022, 12:23 PMkedar ghate
10/31/2022, 2:10 PMSashi Kandru
10/31/2022, 4:10 PMShuying Lin
11/02/2022, 3:43 AMkedar ghate
11/02/2022, 10:51 AMEddie Stanley
11/03/2022, 8:55 PMNoor Hashem
11/07/2022, 6:37 PM- run: docker pull pactfoundation/pact-cli:latest
but I have been using a command that looks like this: npx jest --testMatch '**/*.pact.test.ts'"
does it matter which one I use? So far npx has been fine for meStefan Tertan
11/08/2022, 12:22 PMNoor Hashem
11/08/2022, 4:10 PMContract published that requires verification
webhook to the consumer PR that triggered it. I see on this page here there is a link to the publishing-pact-verification-results-to-github
but the link does not work. Is there any other resource teaching how to do this?Noor Hashem
11/08/2022, 9:19 PMMust provide both provider and pactBrokerUrl if pactUrls not provided.
on that github workflow. But I configured the webhook exactly as shown here. I have attached the provider verification file that is giving the error.Nathan Deamer
11/10/2022, 11:34 AM[2022-11-09T18:47:44Z] DEBUG: Webhook context {"base_url":"<https://gocity.pactflow.io>","consumer_version_branch":null,"build_url":null,"consumer_version_tags":[],"event_name":"contract_requiring_verification_published","provider_version_number":"0609085aced24bfeaac13a660b9878230d44d197","provider_version_branch":"main","provider_version_descriptions":["latest from main branch"]}
[2022-11-09T18:47:47Z] DEBUG: Webhook context {"base_url":"<https://gocity.pactflow.io>","consumer_version_branch":null,"build_url":null,"consumer_version_tags":[],"event_name":"contract_requiring_verification_published","provider_version_number":"562fd7aaa5c45882a8121c9968a32de10c02f983","provider_version_branch":"main","provider_version_descriptions":["deployed in dev","deployed in ext","deployed in production"]}
The different seems to be the provider_version_descriptions
-is there any documentation on this?Noor Hashem
11/14/2022, 4:59 AM