Robert Henzel
08/03/2022, 5:47 PMÉdouard Lopez
08/05/2022, 9:58 AMv2.0.0-beta.14
branch, in consumer_v3_test.go you do:
ExecuteTest(t, test)
Where does the test
come from?Hazem Borham
08/25/2022, 4:23 PMld: can't open file, errno=13 file '/usr/local/lib/libpact_ffi.dylib' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
A work around was to manually download the file relating to libpact_ffi-osx-aarch64-apple-darwin.dylib.gz and unzip into /usr/local/lib/libpact_ffi.dylib
. These were steps noted in the output during install.Matt (pactflow.io / pact-js / pact-go)
Hazem Borham
09/01/2022, 7:28 PMSneha Singh
09/08/2022, 1:36 PMSneha Singh
09/09/2022, 12:39 AMHazem Borham
09/12/2022, 6:19 PMNick Meyer
09/20/2022, 4:29 PMDavid Kwak
09/26/2022, 6:31 AMpact-go v2.0.0-beta-14
on macOS.
Two questions:
1) Is there something special I have to do to generate a pact file with multiple interactions for a given consumer? I have a consumer test with 3 cases that pass, but the pact file only seems to have the last interaction in the file
2) Is there something special I have to do to generate an interaction entry for a case that returns an error? I have a 404
test case, and the client under test responds to 404
by returning an error, which I check in my test (using the testify/assert.Error
function). This test passes yet doesn’t generate an interaction in a pact file, even when the test is the only one executed.
Any thoughts would be appreciated.Édouard Lopez
10/03/2022, 10:19 AM_NOTE_: This feature is currently only available on Pactflow
Sam Tavakoli
10/19/2022, 1:18 PMJason Taylor
11/01/2022, 10:33 PMHeader("Authorization", matchers.Like("Bearer 111.222.333")).
and get this error running the consumer test:
2022/11/01 22:28:59 [INFO] pact validation failed, errors:
Mismatch with header 'Authorization': Expected 'Bearer 111.222.333' to be equal to 'Bearer aaa.bbb.ccc'
: expected: Bearer 111.222.333
actual: Bearer aaa.bbb.ccc
here is the CLI:
~/go/bin/pact-go version
Pact Go CLI v2.0.0-beta.14
Hazem Borham
11/01/2022, 11:26 PMatLeastOneLike
. in my case i see body match fail for a fields response array mentioning index 0 and 2 failed to match but not index 1. so in reality at least one matched but the test still failed on the pact-go provider.Grace Quek
11/03/2022, 4:31 PMVlad Ledniov
11/07/2022, 8:54 AM2022/11/07 08:46:42 [INFO] checking pact-mock-service within range >= 3.5.0, < 4.0.0
2022/11/07 08:46:42 [ERROR] CLI tools are out of date, please upgrade before continuing
from my `go.mod`:
<http://github.com/pact-foundation/pact-go|github.com/pact-foundation/pact-go> v1.7.0
I’m seeing that 2.x.x version is still in beta, so want to try Pact with a stable version first before doing a transition to 2.x.x.Jason Taylor
11/16/2022, 2:25 PMGitHub
12/07/2022, 8:21 PMJason Taylor
12/08/2022, 9:11 PM[2022-12-08T19:55:52.829Z] 2022-12-08T19:55:49.588545Z INFO ThreadId(03) pact_verifier::pact_broker: Fetching path '/' from pact broker
[2022-12-08T19:55:52.829Z] 2022-12-08T19:55:49.611054Z INFO ThreadId(03) pact_verifier::pact_broker: Fetching path '/pacts/provider/provider/for-verification' from pact broker
[2022-12-08T19:55:52.829Z] 2022-12-08T19:55:49.617698Z WARN ThreadId(03) pact_verifier: Ignoring no pacts error - Could not load pacts from the pact broker
Jason Taylor
12/08/2022, 9:37 PMJason Taylor
12/08/2022, 10:52 PMZeus
12/23/2022, 7:53 AMWill Herring
01/03/2023, 11:54 AMpact-workshop-go
repo, and if i run make consumer
in there, everything runs okay, and the contract is generated, but I’ve tried doing the same thing for one of our own services, and whenever I try to run the consumer test there, I get an error saying that the CLI tools are out of date. Currently running on an M1 Mac. I’ve since tried using the pactfoundation/pact-cli
docker image, and that seems to at least read the test, but just wondering if there’s anything obvious I’ve missed from the standalone CLI installation, or what the recommended setup would be for an M1 Mac.Jason Taylor
01/04/2023, 3:59 PMViktoriia Vlasiuk
01/05/2023, 10:46 AMbody := waveplanner.CreateWavePlanBody{
Waves: []waveplanner.Wave{
{
CutoffTime: "04:00",
FromTime: "10:00",
ToTime: "15:59",
},
{
CutoffTime: "12:00",
FromTime: "16:00",
ToTime: "20:59",
},
{
CutoffTime: "16:00",
FromTime: "21:00",
ToTime: "09:59",
},
},
}
created := waveplanner.CreateWavePlanResponse{
ID: uuid.NewString(),
MfcID: mfc,
CreatedBy: "user-id",
Waves: []waveplanner.WaveItem{
{
ID: uuid.NewString(),
CutoffTime: "04:00",
FromTime: "10:00",
ToTime: "15:59",
Schedules: []waveplanner.ScheduleItem{},
},
{
ID: uuid.NewString(),
CutoffTime: "12:00",
FromTime: "16:00",
ToTime: "20:59",
Schedules: []waveplanner.ScheduleItem{},
},
{
ID: uuid.NewString(),
CutoffTime: "16:00",
FromTime: "21:00",
ToTime: "09:59",
Schedules: []waveplanner.ScheduleItem{},
},
},
}
mockProvider.
AddInteraction().
Given(fmt.Sprintf("retailer %s, mfc %s exists", retailer, mfc)).
UponReceiving(fmt.Sprintf("a request to post wave plan for for retailer %s mfc %s", retailer, mfc)).
WithRequest(http.MethodPost, fmt.Sprintf("/v1/retailers/%s/mfcs/%s/wavePlan", retailer, mfc), func(b *consumer.V4RequestBuilder) {
b.
Headers(matchers.HeadersMatcher{
"X-Env-Type": {matchers.Like("env")},
"X-Token": {matchers.Like("token")},
"Content-Type": {matchers.S("application/json")},
}).
JSONBody(matchers.Like(body))
}).
WillRespondWith(http.StatusCreated, func(repsb *consumer.V4ResponseBuilder) {
repsb.
Headers(matchers.HeadersMatcher{
"Content-Type": {matchers.S("application/json")},
}).
JSONBody(matchers.Like(created))
})
running the test I get pact created, with these matching rules for _request/response bodies_:
"matchingRules": {
"body": {
"$": {
"combine": "AND",
"matchers": [
{
"match": "type"
}
]
}
},
and of course the pact contains request /response body content.
My question is: does this matchingRule means that on Provider verification stage the request/response body example will be used as a source of expected request format?
Before this I was using the older pact version and used Body: dsl.Like(map[string]interface{}{}) way of describing expected response format, which produced exact matching rules per field.Nuno Frias
01/10/2023, 11:34 AMverify_request.go
file they should run only once.Nuno Frias
01/10/2023, 11:35 AMViktoriia Vlasiuk
01/11/2023, 3:23 PMHazem Borham
01/13/2023, 1:05 AMContract published that requires verification
. Utilizing the webhook template library here, I set the env var PACT_URL
. However that doesnt actually seem to do much when using pact-go@2.x.x. and I am not sure how it works prior to using pact_ffi cli. I seem to recall a few PACT_*
env vars being automatically read by the ruby cli tools. Could/should this env var also be automatically configured in pact-go verifier?Viktoriia Vlasiuk
01/13/2023, 9:12 AMWillRespondWith(
dsl.Response{
Status: http.StatusOK,
Headers: dsl.MapMatcher{
"Content-Type": dsl.String("application/json"),
},
Body: dsl.Like(map[string]interface{}{
"code": dsl.Term(code, uuidMatcher),
"closed-at": dsl.Timestamp(),
}),
},
)
generated this part of contract: