bethskurrie
2018-03-24 03:39
has joined #pact-go

bethskurrie
2018-04-05 04:12
/github subscribe pact-foundation/pact-go

matt.fellows
2018-04-05 04:12
has joined #pact-go

bethskurrie
2018-05-02 04:55
/github subscribe pact-foundation/pact-go releases

bethskurrie
2018-05-02 04:56
/github unsubscribe pact-foundation/pact-go commits

bethskurrie
2018-05-02 04:56
/github unsubscribe pact-foundation/pact-go public

bethskurrie
2018-05-02 04:56
/github unsubscribe pact-foundation/pact-go deployments

tjones
2018-05-15 01:05
has joined #pact-go

aphelps
2018-05-22 21:39
has joined #pact-go

mr.matt.r.long
2018-06-11 13:18
has joined #pact-go

elliot.chen7
2018-07-03 17:48
has joined #pact-go

elliot.chen7
2018-07-03 18:58
Is the README out of sync? I?m getting `undefined: dsl.MapMatcher` when using the example and I?m running v0.0.13 revision 1567bdaba1c9bccb747cfba1ade5e09b9ccf5eea

matt.fellows
2018-07-03 21:34
@elliot.chen7 it shouldn't be, but it's possible. I'll take a look this morning

elliot.chen7
2018-07-03 21:37
Thanks, also do I need to have a daemon running? From the looks of the doc it says pact-go shouldn?t need one?

matt.fellows
2018-07-03 21:40
No you shouldn't need one. It's all just the usual `go get`, but you do need some binaries on the PATH as per readme

elliot.chen7
2018-07-03 21:59

elliot.chen7
2018-07-03 21:59
Getting `unrecognized import path`

yamad
2018-07-07 09:47
has joined #pact-go

yamad
2018-07-07 12:02
i'd like to ask few questions. i was trying `pact-go/examples`. but i've got some troubles. 1. how to execute `./pact-go daemon`. is the file exists in pact-go repogitory? 2. i couldn't run `consumer_test.go` and `provider_test.go`. i've got these message. is this example not recent? ``` $ go test -v -run TestProvider # _/Users/dorako321/pact-go/examples ./consumer_test.go:22: unknown field 'Port' in struct literal of type dsl.Pact ./consumer_test.go:55: cannot use "/foobar" (type string) as type dsl.StringMatcher in field value: string does not implement dsl.StringMatcher (missing GetValue method) ./consumer_test.go:56: cannot use map[string]string literal (type map[string]string) as type dsl.MapMatcher in field value ./consumer_test.go:61: cannot use map[string]string literal (type map[string]string) as type dsl.MapMatcher in field value ./provider_test.go:28: unknown field 'Port' in struct literal of type dsl.Pact FAIL _/Users/dorako321/pact-go/examples [build failed] ```

matt.fellows
2018-07-08 05:02
I?ll take a look @elliot.chen7 @yamad. We?re transitioning to a new API, so it?s quite possible

matt.fellows
2018-07-08 05:36
OK yep, there was definitely a couple of examples out of date - funnily enough, the only 2 that don?t run as part of CI.


matt.fellows
2018-07-08 05:36
Fixed in all branches, sorry about that!

steve.cook
2018-07-08 10:21
has joined #pact-go

elliot.chen7
2018-07-09 01:38
Thanks @matt.fellows! I?ll give it another try tomorrow

matt.fellows
2018-07-09 01:39
:+1:

alex.bednarczyk
2018-07-10 13:19
has joined #pact-go

alex.bednarczyk
2018-07-10 13:24
is there a golang version of pact I need to install to pact test golang code?

yamad
2018-07-10 13:25
@matt.fellows it working perfectly now. thanks. good product.

alex.bednarczyk
2018-07-10 13:25
I tried this command `go get -d http://github.com/pact-foundation/pact-go` and it executed without error but when I run `go test-v .` i get an error ``` :> go test -v . === RUN TestPact_GoKitProvider 2018/07/10 08:24:29 [DEBUG] pact setup logging 2018/07/10 08:24:29 [DEBUG] pact setup 2018/07/10 08:24:29 [DEBUG] checking CLI compatability 2018/07/10 08:24:29 [INFO] checking pact-mock-service within range >= 2.6.4, < 3.0.0 2018/07/10 08:24:29 [DEBUG] running binary pact-mock-service 2018/07/10 08:24:29 [ERROR] CLI tools are out of date, please upgrade before continuing FAIL http://github.com/pact-foundation/pact-go/examples/go-kit/provider 0.027s ```

matt.fellows
2018-07-10 13:32
Awesome, sorry about those. Any questions do let us know

matt.fellows
2018-07-10 13:32
Have you installed the CLI tools?


matt.fellows
2018-07-10 13:35
It's a bit misleading, I'll update that first section of the docs. But you need to first have some tools in your path first

alex.bednarczyk
2018-07-10 13:42
@matt.fellows does this install method work for mac?

alex.bednarczyk
2018-07-10 14:00
the `some tools` isnt clear. i assumed that `go get -d http://github.com/pact-foundation/pact-go` would install everything i need but it didnt seem to work

elliot.chen7
2018-07-10 16:21
I had the same understanding as @alex.bednarczyk and got the same error when I first tried

alex.bednarczyk
2018-07-10 16:54
@elliot.chen7 did you get it working?

matt.fellows
2018-07-10 21:01
@alex.bednarczyk ah, I see the problem in our docs. We have a links section with all of the re-usable links but they aren?t rendering for some reason. I?ll take a look. Apologies


matt.fellows
2018-07-10 21:02
and yes, that should work on a Mac

matt.fellows
2018-07-10 21:02
What have you tried?

matt.fellows
2018-07-10 21:09
Docs updated, links have been restored

alex.bednarczyk
2018-07-10 23:39
I tried NPM install pact, the instructions don?t have the global arg so i?m a little confused how pact would be available gloally

alex.bednarczyk
2018-07-10 23:41
also tried the ruby standalone but i cant find the error i got from that

alex.bednarczyk
2018-07-10 23:41
`go get -d http://github.com/pact-foundation/pact-go` might have done something but `pact` didnt work after so a step might be missing

matt.fellows
2018-07-10 23:51
@alex.bednarczyk npm?

alex.bednarczyk
2018-07-10 23:51
`npm i @pact-foundation/pact-standalone`

matt.fellows
2018-07-10 23:52
Those three steps are all you need: 1. Download the appropriate zip file for your platform from https://github.com/pact-foundation/pact-ruby-standalone/releases 2. Ensure the files in the extracted `bin` dir are on your `PATH` 3. then you can go get

matt.fellows
2018-07-10 23:52
is there somewhere that says to use npm? If so, it?s confusing and it needs to be corrected

alex.bednarczyk
2018-07-10 23:53
let me look

matt.fellows
2018-07-10 23:53
thanks

alex.bednarczyk
2018-07-10 23:54
I think I was trying to get something installed.

alex.bednarczyk
2018-07-10 23:55
let me look at the readme again. ill have some feedback tomorrow. thanks for responding

alex.bednarczyk
2018-07-11 00:03
I unzipped the tgz and moved all files in the bin directory to /Users/alex/bin which is in my path ```:> pact /Users/alex/bin/pact: line 27: /Users/alex/lib/ruby/bin/ruby: No such file or directory```

bethskurrie
2018-07-11 00:04
@alex.bednarczyk the easiest way to install the standalone is to use https://github.com/pact-foundation/pact-ruby-standalone/blob/master/install.sh

bethskurrie
2018-07-11 00:04
What is your OS?

bethskurrie
2018-07-11 00:05
Also, @alex.bednarczyk @matt.fellows let's move this to a thread so we're not spamming the whole channel.

alex.bednarczyk
2018-07-11 00:05
macos

alex.bednarczyk
2018-07-11 00:06
trying the install.sh now

bethskurrie
2018-07-11 00:07
``` bethtemp $ curl -fsSL https://raw.githubusercontent.com/pact-foundation/pact-ruby-standalone/master/install.sh | bash % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 612 0 612 0 0 652 0 --:--:-- --:--:-- --:--:-- 652 100 7435k 100 7435k 0 0 651k 0 0:00:11 0:00:11 --:--:-- 1376k bethtemp $ ./pact/bin/pact Commands: pact docs # Generate Pact documentation in markdown pact help [COMMAND] # Describe available commands or one specific command pact verify -h, --pact-helper=PACT_HELPER # Verify a pact ```

alex.bednarczyk
2018-07-11 00:07
```:> ./install.sh % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 612 0 612 0 0 2398 0 --:--:-- --:--:-- --:--:-- 2390 100 7435k 100 7435k 0 0 1248k 0 0:00:05 0:00:05 --:--:-- 1552k```

alex.bednarczyk
2018-07-11 00:07
ok let me try your command

alex.bednarczyk
2018-07-11 00:08
```:> curl -fsSL https://raw.githubusercontent.com/pact-foundation/pact-ruby-standalone/master/install.sh | bash % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 612 0 612 0 0 2235 0 --:--:-- --:--:-- --:--:-- 2241 100 7435k 100 7435k 0 0 1943k 0 0:00:03 0:00:03 --:--:-- 2369k```

alex.bednarczyk
2018-07-11 00:08
stops there

bethskurrie
2018-07-11 00:08
yes, that's fine.

bethskurrie
2018-07-11 00:08
Then run pact/bin/pact

alex.bednarczyk
2018-07-11 00:11
```:> pact/bin/pact Commands: pact docs # Generate Pact documentation in markdown pact help [COMMAND] # Describe available commands or one specific command pact verify -h, --pact-helper=PACT_HELPER # Verify a pact```

bethskurrie
2018-07-11 00:11
looks like it's working.

alex.bednarczyk
2018-07-11 00:12
ok great. ill try the go test command

alex.bednarczyk
2018-07-11 00:14
```:> go test -v . === RUN TestConsumer 2018/07/10 19:14:53 [INFO] checking pact-provider-verifier within range >= 1.12.0, < 3.0.0 2018/07/10 19:14:53 [ERROR] CLI tools are out of date, please upgrade before continuing FAIL http://github.com/pact-foundation/pact-go/examples 0.025s```

bethskurrie
2018-07-11 00:19
@matt.fellows?

bethskurrie
2018-07-11 00:20
@alex.bednarczyk look at the readme in the top pact dir. It will list all the versions used.

alex.bednarczyk
2018-07-11 00:21
@bethskurrie do I need to do anything with the `pact/bin/pact` file?

bethskurrie
2018-07-11 00:21
no

alex.bednarczyk
2018-07-11 00:22
ok, its in `~/projects/test/pact-ruby-standalone`

bethskurrie
2018-07-11 00:22
The readme?

alex.bednarczyk
2018-07-11 00:22
go is in `~/go/src/github.com/pact-foundation/pact-go/examples`

bethskurrie
2018-07-11 00:22
No, it's in pact/README.md

bethskurrie
2018-07-11 00:22
The standalone that you installed has a readme.md in it.

alex.bednarczyk
2018-07-11 00:23
ok i see it

alex.bednarczyk
2018-07-11 00:23
```This version (1.49.0) of the Pact standalone executables package contains: * pact gem 1.28.0 * pact-mock_service gem 2.9.1 * pact-support gem 1.6.2 * pact-provider-verifier gem 1.14.4 * pact_broker-client gem 1.16.0 * pact-message gem 0.4.5```

bethskurrie
2018-07-11 00:24
So, that logic that says it's out of date is mistaken.

bethskurrie
2018-07-11 00:24
Matt will be able to help you, but he's currently busy.

alex.bednarczyk
2018-07-11 00:24
ok

matt.fellows
2018-07-11 00:31
you need to add that folder (l?m just guessing, but from what you?ve been saying it will be something like: `~/projects/test/pact-ruby-standalone/pact/bin/`) to your `PATH`: e.g. ``` PATH="${PATH}:~/projects/test/pact-ruby-standalone/pact/bin/" ```

matt.fellows
2018-07-11 00:31
Pact Go can?t run a binary if it can?t find it

bethskurrie
2018-07-11 00:32
It looks like you've got the pact-ruby-standalone project checked out?

matt.fellows
2018-07-11 00:32
It looks like you _moved_ the binaries - you can?t do that

alex.bednarczyk
2018-07-11 13:10
yea i have it checked out

alex.bednarczyk
2018-07-11 13:11
i added the `bin` dir to my path and the tests executed

alex.bednarczyk
2018-07-11 13:11
```:> go test -v . === RUN TestConsumer 2018/07/11 08:09:31 [INFO] checking pact-provider-verifier within range >= 1.12.0, < 3.0.0 2018/07/11 08:09:32 [INFO] checking pact-broker within range >= 1.14.0, < 2.0.0 2018/07/11 08:09:33 [INFO] checking pact-mock-service within range >= 2.6.4, < 3.0.0 2018/07/11 08:09:34 [ERROR] service: [2018-07-11 08:09:34] INFO WEBrick 1.3.1 2018/07/11 08:09:34 [ERROR] service: [2018-07-11 08:09:34] INFO ruby 2.2.2 (2015-04-13) [x86_64-darwin13] 2018/07/11 08:09:34 [ERROR] service: [2018-07-11 08:09:34] INFO WEBrick::HTTPServer#start: pid=15046 port=58415 Test Passed! 2018/07/11 08:09:34 [ERROR] service: [2018-07-11 08:09:34] INFO going to shutdown ... 2018/07/11 08:09:34 [ERROR] service: [2018-07-11 08:09:34] INFO WEBrick::HTTPServer#start done. 2018/07/11 08:09:34 [INFO] INFO: Writing pact before shutting down 2018/07/11 08:09:34 [INFO] 2018/07/11 08:09:34 [INFO] Writing pact for MyProvider to /Users/alex/go/src/github.com/pact-foundation/pact-go/examples/pacts/myconsumer-myprovider.json --- PASS: TestConsumer (3.04s) === RUN TestProvider 2018/07/11 08:09:34 [INFO] checking pact-provider-verifier within range >= 1.12.0, < 3.0.0 2018/07/11 08:09:35 [INFO] checking pact-broker within range >= 1.14.0, < 2.0.0 2018/07/11 08:09:35 [INFO] checking pact-mock-service within range >= 2.6.4, < 3.0.0 === RUN TestProvider/has_status_code_200 === RUN TestProvider/has_a_matching_body === RUN TestProvider/"Content-Type"_which_equals_"application/json" --- PASS: TestProvider (2.23s) --- PASS: TestProvider/has_status_code_200 (0.00s) pact.go:314: Verifying a pact between MyConsumer and MyProvider Given User foo exists A request to get foo with GET /foobar returns a response which has status code 200 --- PASS: TestProvider/has_a_matching_body (0.00s) pact.go:314: Verifying a pact between MyConsumer and MyProvider Given User foo exists A request to get foo with GET /foobar returns a response which has a matching body --- PASS: TestProvider/"Content-Type"_which_equals_"application/json" (0.00s) pact.go:314: Verifying a pact between MyConsumer and MyProvider Given User foo exists A request to get foo with GET /foobar returns a response which includes headers "Content-Type" which equals "application/json" PASS ok http://github.com/pact-foundation/pact-go/examples 5.292s```

alex.bednarczyk
2018-07-11 13:38
are these errors ok?

bethskurrie
2018-07-11 21:07
Looks OK to me. Not sure why they're prefixed with ERROR.

matt.fellows
2018-07-11 21:09
I'll double check. There was a bug a while ago where things were being interpreted as if they were from stderr.

matt.fellows
2018-07-11 21:09
But if there is a pact file created, it's working

matt.fellows
2018-07-11 21:14
@bethskurrie I?ll ping you in a sec

matt.fellows
2018-07-12 02:01
How did you go Alex?


bethskurrie
2018-07-12 09:06
@matt.fellows I've worked out how to send that log to stdout. It's in the latest standalone 1.51.0

ssn899
2018-07-12 22:27
has joined #pact-go

bethskurrie
2018-07-13 06:18
> ? 2e0f236 - upgrade(broker): allow pb:pacts and pacts HAL links to be followed (Matt Fellows, Sun May 20 13:15:52 2018 +1000) ? 808ebfa - fix(broker): use 'pb:pacts' instead 'pacts'. See #82 (Matt Fellows, Fri May 18 22:55:20 2018 +1000) Thank you for noticing @matt.fellows!

matt.fellows
2018-07-13 06:34
:smile:

bethskurrie
2018-07-13 06:35
I want to move the pact retrieval into the ruby standalone so that I can put the WIP pacts stuff into there and roll it out to all the languages. it will help the problem where we have to configure the ssl for both the wrapper language and the ruby code as well.

bethskurrie
2018-07-13 06:36
From what I've seen in the js, the configuration options are the provider name, and a list of tags?

bethskurrie
2018-07-13 06:36
`--provider Foo --tag prod --tag master`?

matt.fellows
2018-07-13 06:47
Yep, it makes complete sense.

bethskurrie
2018-07-13 06:48
Rashi has actually already done the ruby code, i just have to hook it up to the command line

matt.fellows
2018-07-13 06:49
I?ll have a quick look, I think that?s correct

kaushalye
2018-07-23 07:11
has joined #pact-go

jim
2018-07-23 17:59
has joined #pact-go

rabih
2018-08-10 06:53
has joined #pact-go

rabih
2018-08-10 07:05
Hello, I am working with pact hosted broker. I have a golang docker image with pact installed in it. I build the image and when try to run consumer integration tests it fails, knowing that when running it independently it works and upload the contracts to the broker. I think it is an issue in creating json contracts locally. Any help regarding this issue would be appreciated :question:

rabih
2018-08-10 11:42
I believe this issue is related to the below https://github.com/pact-foundation/pact-js/issues/154

bethskurrie
2018-08-10 11:46
Have you tried the fix suggested by the issue you mention @rabih?

rabih
2018-08-10 11:46
yes and worked just fine

bethskurrie
2018-08-10 11:50
:+1:


pau
2018-08-20 10:56
has joined #pact-go

madu.alikor
2018-09-27 09:14
has joined #pact-go

madu.alikor
2018-09-27 09:15
my provider test does not seem to ever end and i'm forced to terminate the process can anyone help?

madu.alikor
2018-09-27 09:16
``` // +build contract package rest import ( "encoding/json" "fmt" "log" "net/http" "os" "path/filepath" "testing" "http://github.com/pact-foundation/pact-go/dsl" "http://github.com/pact-foundation/pact-go/types" ) var port = 8000 var dir, _ = os.Getwd() var pactDir = fmt.Sprintf("%s/../../../pacts", dir) var logDir = fmt.Sprintf("%s/logs", dir) func TestProvider(t *testing.T) { // Start provider API in the background go startServer() // Create Pact connecting to local Daemon pact := &dsl.Pact{ Consumer: "client", Provider: "paymentService", Host: "localhost", LogDir: logDir, PactDir: pactDir, DisableToolValidityCheck: true, } // log.Println("Start verify ", []string{filepath.ToSlash(fmt.Sprintf("%s\\buildreader-bringon.json", pactDir))}, // fmt.Sprintf("http://localhost:%d/setup", port), fmt.Sprintf("http://localhost:%d", port), fmt.Sprintf("%s\\buildReader-bringon.json", pactDir)) // Verify the Provider with local Pact Files _, err := pact.VerifyProvider(t, types.VerifyRequest{ ProviderBaseURL: fmt.Sprintf("http://localhost:%d", port), PactURLs: []string{filepath.ToSlash(fmt.Sprintf("%s/client-paymentservice.json", pactDir))}, ProviderStatesSetupURL: fmt.Sprintf("http://localhost:%d/setup", port), }) if err != nil { t.Fatal("Error:", err) } } func startServer() { mux := http.NewServeMux() lastName := "billy" mux.HandleFunc("/foobar", func(w http.ResponseWriter, req *http.Request) { w.Header().Add("Content-Type", "application/json") fmt.Fprintf(w, fmt.Sprintf(`{"name":"billy", "lastName":"%s"}`, lastName)) // Break the API by replacing the above and uncommenting one of these // w.WriteHeader(http.StatusUnauthorized) // fmt.Fprintf(w, `{"s":"baz"}`) }) // This function handles state requests for a particular test // In this case, we ensure that the user being requested is available // before the Verification process invokes the API. mux.HandleFunc("/setup", func(w http.ResponseWriter, req *http.Request) { var s *types.ProviderState decoder := json.NewDecoder(req.Body) decoder.Decode(&s) if s.State == "User foo exists" { lastName = "bagr" } w.Header().Add("Content-Type", "application/json") }) log.Fatal(http.ListenAndServe(":8000", mux)) } ```

fergusstrange764
2018-10-04 02:47
has joined #pact-go

paul.davies
2018-10-12 05:01
has joined #pact-go

rabih
2018-11-06 16:47
hello, any help regarding the below issue:(note that I am using option PactFileWriteMode: ?update?) /pact/lib/ruby/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/shared_helpers.rb:78: warning: Insecure world writable dir /go/bin in PATH, mode 040777

matt.fellows
2018-11-08 08:59
I've seen it before on a wercker build. It's a warning, so shouldn't affect any builds

matt.fellows
2018-11-08 09:00
The answer is in the warning - it's telling you /go/bin had insecure permissions on it. Make it more secure, and it will go away

rabih
2018-11-08 09:56
I have 2 micro-services, first one has GET rest APIs and the other has the POST APIs. Is there a way that the two services could update the same pact consumer and provider? Since what is happening now is that the last integration tests ran will override pacts. Any advice regarding this issue?

nihei.dev
2018-11-12 09:45
has joined #pact-go

rabih
2018-12-12 13:36
Hi all, I have issue in Message pact testing, So the contract has a message with contents, when the provider try to validate this message the dsl.Message is an empty struct, so the question here, the message should have been parsed with the json message found in the contract?

stein
2018-12-19 17:40
has joined #pact-go

stein
2018-12-19 17:40
Hi, quick question. When verifying a pact using the go provider, e.g. ``` res, err := pact.VerifyProvider(...) ``` If no consumers have published pacts the provider verification fails with an ambiguous error - ?Pact URLs is mandatory?. Is this the expected behavior? From memory (I might be wrong) the same scenario in the jvm verifier just skips the test if no consumers are defined. How might I achieve this in go since it?s quite convenient when setting stuff up initially? Cheers

matt.fellows
2018-12-19 23:31
hmm I recall this coming up before, but can?t quite remember the discussion :smile:

matt.fellows
2018-12-19 23:32
one the one hand, not finding any consumers might be a signal something is wrong. On the other hand, perhaps you?re searching for tags (andn therefore consumers) that don?t yet exist, and therefore it isn?t a problem yet.

matt.fellows
2018-12-19 23:33
Could you please raise an issue to track on the github repo?

stein
2018-12-20 08:06
Thanks Matt. Will do.

matt.fellows
2018-12-20 20:42
Sorry for the late response, did you get this sorted?

rabih
2018-12-21 06:40
Hi @matt.fellows, actually no, I am still getting an empty dsl.Message. You can find the below code for your reference. Please advice how MQ pact works. ``` "an event created": func(m dsl.Message) (interface{}, error) { myEvent := m.Content.(*MyEvent) // This is not working, only getting state and message description in m //The below is working since it is comparing it with the message in the contract myCreatedEvent, err := prepareEvent() return myCreatedEvent, err }, ```

matt.fellows
2018-12-21 06:49
The provider will never receive the message - it's the one sending it to a queue in the first place!. Pact will invoke that function and expect it to populate the returning interface {} with the response, which is then compared to the contract.

rabih
2018-12-21 06:51
yes, that?s what I figured out

rabih
2018-12-21 06:52
Thank you

matt.fellows
2018-12-21 08:11
Do you think we could make this clearer on the docs? If so, what do you think we should do differently?

rabih
2018-12-21 08:17
I?d suggest to have more related examples to message queueing like integration with RabbitMQ, Nats, Kafka. Since the example provided for messages is translated from the API examples, which I think is not a valid use case for message queueing. Thank you

matt.fellows
2018-12-21 08:28
Thanks Rabieh. Some good advice for the backlog :slightly_smiling_face:

matt.fellows
2018-12-21 08:29
PR?s welcome, too :smile:

lucas.beier
2019-01-10 12:38
has joined #pact-go

lucas.beier
2019-01-10 12:39
about this specific issue

lucas.beier
2019-01-10 12:39
I'm not sure if this is an issue or not

lucas.beier
2019-01-10 12:39
I'm trying to debug it locally

lucas.beier
2019-01-10 12:41
I saw the server I start is starting in a port (eg 55756) and the mock service on other one (eg 55757)

lucas.beier
2019-01-10 12:41
I'm not sure what is this mock service

lucas.beier
2019-01-10 12:42
In `client.go` we can find this code: ``` port := getPort(request.ProviderBaseURL) waitForPort(port, p.getNetworkInterface(), p.Address, fmt.Sprintf(`Timed out waiting for Provider API to start on port %d - are you sure it's running?`, port)) ```

lucas.beier
2019-01-10 12:43
In the `for select` on `waitForPort`, the first time the `net.Dial` dials to the correct port (57420, for example), but the second time it dials to 0

lucas.beier
2019-01-10 12:53
Is this deliberate?

matt.fellows
2019-01-11 01:55
hi @lucas.beier, thanks for raising the issue. I can?t quite reproduce your code but will publish to our test broker and go from there

matt.fellows
2019-01-11 01:56
The port `0` doesn?tt look deliberate, so i?s possible something else has gone awry before that point to cause issues.

matt.fellows
2019-01-11 01:56
During consumer side testing, the mock service is what records the interactions and is your ?dummy? provider. It?s not used on provider verification, however.

matt.fellows
2019-01-11 02:01
OK,. I?ve just published your pacts to our hosted broker (http://test.pact.dius.com.au)

matt.fellows
2019-01-11 02:02
Passing as expected, I think

matt.fellows
2019-01-11 02:02
My guess is that perhaps it can?t find the CLI tools

matt.fellows
2019-01-11 02:02
Can you please test without `DisableToolValidityCheck: true`?

rabih
2019-01-16 10:30
Hello, I have a question, is it possible to test 2 different consumer against same provider?

matt.fellows
2019-01-16 10:30
Yes

matt.fellows
2019-01-16 10:30
Absolutely!

rabih
2019-01-16 10:33
we are testing the two pacts in the same file, is it a problem?

matt.fellows
2019-01-16 12:43
Can you elaborate on what you mean? You'll need to ensure you setup so that each test directs the interactions at separate mock providers

rabih
2019-01-16 12:46
so we are initializing two pacts, the first is for Consumer1 and Provider1, the second is for Consumer2 and Provider1, we have a TestMain function and multiple testing functions where we are adding the function mapping in each unit tests with the specific pact, and at the end of the TestMain we are calling provider validation

matt.fellows
2019-01-18 02:58
I?m not sure this is a good idea. Each consumer/provider testing should be done in isolation from one another. Is there are reason why they are coupled like this?

rabih
2019-01-18 07:51
so according to CQRS, we have command service and query service, where command ones can consume events from multiple query services

matt.fellows
2019-01-18 10:31
Sure, but you can still separate out the tests for the query and command consumers. Perhaps if you could share some code that would help. In short, you can most definitely share multiple consumers for a single provider

rabih
2019-01-21 15:48
my issue is resolved, so instead, I used one pact for the provider without specifying a consumer, so now it is validating all consumers with one provider

rabih
2019-01-22 12:44
has any one worked with versioning pact with CI builds and github?

matt.fellows
2019-01-24 04:59
might want to ask in #general or #pact-broker

matt.fellows
2019-01-24 04:59
but yes, it?s common :slightly_smiling_face:

zach.the.hammer
2019-02-12 01:15
has joined #pact-go

rickard.andersson
2019-02-20 07:04
has joined #pact-go

rabih
2019-03-04 15:48
Hi, is it possible to force the name for consumer/provider instead of getting this message(other than creating manually): The name ?ServicesProvider? is very similar to the following existing consumers/providers: * providers_api If you meant to specify one of the above names, please correct the pact configuration, and re-publish the pact.

matt.fellows
2019-03-05 02:57
Best asking this in the #pact-broker channel, but the answer is yes (maybe).

matt.fellows
2019-03-05 02:57
Are you using the hosted version or your own?

matt.fellows
2019-03-10 12:22
Hi folks, I've made a few significant changes to pact go tonight and am looking for feedback.

matt.fellows
2019-03-10 12:25
1. Deprecated need for the annoying states setup URL in favour of registering simple state handler functions 2. Added before and after hooks to invoke during test lifecycle 3. Added Request Filter middleware where you can intercept requests to the provider, enabling use cases such as updating bearer tokens https://github.com/pact-foundation/pact-go/tree/feat/hooks-api

matt.fellows
2019-03-10 12:25
This is based on feedback on forums as well as usage and adoption in the JS dsl which I also maintain.

dave.carrell
2019-03-25 14:09
has joined #pact-go

marc
2019-04-17 13:28
has joined #pact-go

vaso.giamarelou
2019-04-20 11:44
has joined #pact-go

j
2019-04-23 02:49
has joined #pact-go

drewbailey5
2019-05-02 17:11
has joined #pact-go

drewbailey5
2019-05-02 17:12
Hello! has anyone ever worked with building query params to allow for the rails flavor of arrays in params?

drewbailey5
2019-05-02 17:12
`names[]=ENV1&names[]=ENV2`

nboyd
2019-05-06 20:52
has joined #pact-go

nick.karamaniolas
2019-05-07 13:10
has joined #pact-go

braddle
2019-05-08 10:09
has joined #pact-go

edwin.tye
2019-05-24 15:59
has joined #pact-go

void.alexey
2019-05-27 22:11
has joined #pact-go

rob.clarken
2019-06-04 22:47
has joined #pact-go

n.chachampis
2019-06-11 06:49
has joined #pact-go

fili.projetto
2019-06-17 10:17
has joined #pact-go

meirosuandreea
2019-07-18 09:58
has joined #pact-go

meirosuandreea
2019-07-18 09:59
Hi, I am pretty new to PACT and I find myself stuck with the following situation: I want to match a stream response of type text/plain which looks similar to: {"Id": 1224, "Name": "Ana", "Age": 5} {"Id": 34, "Name": "Lele", "Age": 4} I know it can be done with regex but I am interested in actually checking if each row is of a certain object type, similar to EackLike("Person") which works if response is json - array of objects. Do you have any suggestion? Or how a custom Matcher would look like?

meirosuandreea
2019-07-18 09:59
has anyone tried something similar or is there any post with more details on custom matcher in go? and how would the pact file be interpreted by a provider in another language (like Java) if the matcher is not built in type?

matt.fellows
2019-07-18 10:29
Hmmm why text/plain?

matt.fellows
2019-07-18 10:30
One option would be to parse it into JSON before handing it off to Pact, but that has its drawbacks

matt.fellows
2019-07-18 10:31
(also I saw your note in gophers, but the real Pact audience is here...)

meirosuandreea
2019-07-18 10:54
yes, I was trying to get an answer and the gophers was the first channel I saw, then I red about this one. But if I change the response to json it means I am not testing the actual response of the provider

matt.fellows
2019-07-18 11:13
> But if I change the response to json it means I am not testing the actual response of the provider Yes, that is the drawback :wink:

matt.fellows
2019-07-18 11:27
I refer you to the pragmatism principle

matt.fellows
2019-07-18 11:28
You?ll need to weigh up the value of maintaining the tests vs potential for reality to get out of sync.

matt.fellows
2019-07-18 11:29
Obviously, it would be ideal to do the plain text match. There is currently no (published) way to add / extend the matchers, and if you did, you?d need to somehow make the pact file it generates compatible with other implementations, else it wouldn?t work if it needed to be verified by, say, Java

matt.fellows
2019-07-18 11:29
The specification for the pact file is https://github.com/pact-foundation/pact-specification/

meirosuandreea
2019-07-18 11:33
ok, got it. thank you for the response. Ideally, I would have wanted something like the EachLike and check for a object type, since with regex order is important and it's hard to cover optional fields and values, but I will reconsider probably the enforcement on the response

matt.fellows
2019-07-18 11:33
Yes.

matt.fellows
2019-07-18 11:33
Currently, all of the matching logic is performed by a Ruby process (for consistency with the other Pact implementations)

matt.fellows
2019-07-18 11:34
In theory, you could add matchers to it by modifying that code (https://github.com/pact-foundation/pact-ruby)

matt.fellows
2019-07-18 11:34
But, probably, a better option would be to add a new matcher to Pact Go somehow that simply is syntatic sugar that spits out a bunch of regexes under the hood, keeping things compatible

matt.fellows
2019-07-18 11:35
It?s been a while since I?ve had my head in the depths of the code base, but you?d probably want to be looking at https://github.com/pact-foundation/pact-go/blob/master/dsl/matcher.go as a starting point

matt.fellows
2019-07-18 11:36
I would absolutely welcome a PR. BUT, I would like to know a bit more about your use case to justify expanding any interface, to see how it could benefit the community going forward

meirosuandreea
2019-07-18 11:39
I looked on it and I was pretty much sure that the custom matcher would have to use the built in types in the end just to support cross language integration but wanted double check.

matt.fellows
2019-07-18 11:40
cool

matt.fellows
2019-07-18 11:40
Let me know if you need help

matt.fellows
2019-07-18 11:41
I?ll be honest, the next 2 weeks i?m flat out (2 talks, 2 interstate trips and client work), but will do what I can.

meirosuandreea
2019-07-18 11:42
thank you again. will come back here if any further questions on the road

kevin.monteiro
2019-07-18 22:12
has joined #pact-go

fergusstrange764
2019-07-30 23:23
I think this message is displayed when the CLI tools can?t actually be found either. You need to install https://github.com/pact-foundation/pact-ruby-standalone beforehand and make sure al the executables are available on your path

elliot.sel
2019-08-14 13:17
has joined #pact-go

marius.maaland
2019-08-21 15:35
has joined #pact-go

marius.maaland
2019-08-21 15:36
I have a question about provider states. I understand that when I can't run the API locally, you need to have an endpoint or similar you can call that will insert the test data into my datasource before the interaction is replayed against the provider. Now, for provider states in a local API, how would they work, exactly? Do they still interact with the datastore, only locally? The only examples I've seen have been really simple and general

matt.fellows
2019-08-21 23:03
exactly

matt.fellows
2019-08-21 23:03
The only difference is how the states get setup. You can instrument your running API with extra endpoints (e.g. `/pact/setup`) that will handle the state, or you can pass a function to the Pact runner and that will do a similar thing

matt.fellows
2019-08-21 23:04
People didn?t like having to add extra endpoints to their APIs - they felt they were cheating or potentially modifying the code in such a way that it reduced their confidence in what was actually going to production. For some, appending new endpoints/handlers to the API was problematic also

marius.maaland
2019-08-21 23:20
I see. And the I presume then will happen right before the interaction is actually run, so the `/pact/setup` endpoint is called, the mock data gets injected into the database, the request is replayed and the provider sees that "Oh, TestUser123 does exist" and responds accordingly

marius.maaland
2019-08-21 23:21
Now, this would have to be cleaned up. It doesn't sound like that can happen in the `setup` endpoint, is this the purpose of the `AfterEach` handler?

matt.fellows
2019-08-21 23:24
Pretty much, albeit in most cases you can have a default case in the setup endpoint enough yelled care of initialisation/cleanup

matt.fellows
2019-08-21 23:24
In most cases, a cleanup is not necessary and the new state setup can just set it as needed

matt.fellows
2019-08-22 00:13
> Pretty much, albeit in most cases you can have a default case in the setup endpoint enough yelled care of initialisation/cleanup Apologies was on the phone and obviously this misspelled. What I meant to say was? Pretty much, albeit in most cases you can have a default case in the setup endpoint that takes care of initialization/cleanup

marius.maaland
2019-08-22 18:30
Makes sense! Thanks for explaining

marius.maaland
2019-08-26 23:56
Quick question: where in the `pact-go` source is the consumer side request parsed? I.e. where the mock receives the request and creates the response

bethskurrie
2019-08-26 23:58
In Ruby :wink:

marius.maaland
2019-08-26 23:58
ah..

bethskurrie
2019-08-26 23:59
It uses the ruby mock service that has been packaged so it can be used independently.


marius.maaland
2019-08-27 00:00
I see, thanks

marius.maaland
2019-08-27 00:03
The reason I am asking is: my client creates the request body in a POST request by calling `json.Marshal()` on a struct instance, and calling `bytes.NewReader(body)` before sending it as an input in `http.NewRequest()`.

marius.maaland
2019-08-27 00:03
In the interaction setup I am describing the body with a `MapMatcher`.

marius.maaland
2019-08-27 00:04
The problem I am having is, when executing the test, pact says that the interaction does not match the request, because the request body it gets has doubly escaped quotation marks, while the interaction does not

bethskurrie
2019-08-27 00:04
have you looked at the logs?

marius.maaland
2019-08-27 00:05
I can, of course, just `json.Marshal` the interaction setup as well, but that is the deprecated way of doing it according to the source code

bethskurrie
2019-08-27 00:05
You'll need @matt.fellows to help you with that.

bethskurrie
2019-08-27 00:05
I'm not a go person

marius.maaland
2019-08-27 00:06
Yep, my logs are showing this: ``` Key: - is expected + is actual Matching keys and values are not shown { - "body": { - "proofRequestId": "someId" - } + "body": "{\"proofRequestId\":\"someId\"}" } ```

marius.maaland
2019-08-27 00:06
Thanks Beth! I'll wait for Matt's input

bethskurrie
2019-08-27 00:06
I think your content types may be not matching

bethskurrie
2019-08-27 00:07
the second one is a string

bethskurrie
2019-08-27 00:07
not a json object

bethskurrie
2019-08-27 00:07
it only tries to parse the body to json if the content type contains "json"

marius.maaland
2019-08-27 00:07
oh good catch, I'll give that a *go*

marius.maaland
2019-08-27 00:10
lol, yup, that was it

marius.maaland
2019-08-27 00:10
Thanks @bethskurrie !

bethskurrie
2019-08-27 00:11
np

priyank.shah217
2019-08-30 07:18
has joined #pact-go

marius.maaland
2019-08-30 23:21
What is the purpose of this check? https://github.com/pact-foundation/pact-go/blob/master/dsl/pact.go#L416 It's causing my `BeforeEach` to be skipped

matt.fellows
2019-08-30 23:40
Hmm I see the issue. I'm assuming you are setting a remote provider states endpoint? The idea is that we need a way to avoid duplication of calling that before each hook. The current rule is to only execute on proxy setup endpoint. We might need to enhance that logic

marius.maaland
2019-09-03 18:40
I am not setting a provider states endpoint, I was just trying to use a `BeforeEach` to run before my test

marius.maaland
2019-09-03 19:56
So the idea is that `BeforeEach` statements are only run if a proxy setup endpoint is set?

matt.fellows
2019-09-04 09:06
No, it should happen only once per interaction. It just so happens to be done when the setup endpoint is called - which should _always_ happen (unless you set a specific remote endpoint for that)

matt.fellows
2019-09-04 09:06
so it sounds like a bug, then

marius.maaland
2019-09-05 17:44
Right, so if I don't set a setup endpoint, pact should still call the `/__setup` endpoint, thus allowing the `BeforeEach` to be run?

mui_ume
2019-09-07 09:13
has joined #pact-go

matt.fellows
2019-09-10 02:47
@marius.maaland apologies, have been away for a few days. Managed to do this on the plane: https://github.com/pact-foundation/pact-go/compare/fix/enable-external-https-requests?expand=1

matt.fellows
2019-09-10 02:48
Would you mind taking a look to see if it?s a sensible implementation?

matt.fellows
2019-09-10 02:48
Basically, allow somebody to specify a TLS configuration for their needs. There is an example in there for a self-signed certificate, but to simply disable verification is also very easy

matt.fellows
2019-09-10 02:48
Yes

matt.fellows
2019-09-10 02:49
Would you mind providing more detail on this bug? It should definitely be called, unless there is a new bug in there

marius.maaland
2019-09-10 05:15
Yep. Let me get back to you tomorrow (pacific time)

marius.maaland
2019-09-10 05:20
great! thanks, I'll take a look as soon as I get the chance

matt.fellows
2019-09-10 06:38
You?re welcome

matt.fellows
2019-09-10 06:38
It?s still not ready from prime time, but I?d rather have real users play with it before I invest too far

marius.maaland
2019-09-16 23:22
Hi @matt.fellows, sorry I've been busy. I'll try to type up an MVP showing the problem asap. But here's a short description: I tried to setup `BeforeEach`, but it wasn't run, because that `if` statement I linked to wasn't entered, since I did not specify any `ProviderStatesSetupURL`

matt.fellows
2019-09-16 23:26
Thanks Marius. It should be the other way around. If you _don?t_ specify that URL, we will do the provider states mapping: https://github.com/pact-foundation/pact-go/blob/master/dsl/pact.go#L345

matt.fellows
2019-09-16 23:26
in any case, if you get around to raising an issue that?d be great. Then we can track it appropriately

marius.maaland
2019-10-01 18:50
Hi @matt.fellows, just wanted to let you know that I haven't forgot about this, I've just had to focus on other things. Will get back to this soon

matt.fellows
2019-10-01 22:26
:+1:

marius.maaland
2019-10-08 23:11
Finally got around to checking this out, thanks for your patience @matt.fellows. The PR looks fine, I don't think we're going to use the self-signed certificate functionality because it provides little extra benefit for our testing. Simply disabling the verification works just fine for us

matt.fellows
2019-10-08 23:11
:+1:

matt.fellows
2019-10-08 23:12
Awesome thanks

matt.fellows
2019-10-08 23:12
I agree

matt.fellows
2019-10-08 23:12
Just driving but will get this in to mainline soon

grzegorz.polek
2019-10-09 14:25
has joined #pact-go

mauricio.galeas
2019-10-09 15:40
has joined #pact-go

mauricio.galeas
2019-10-09 17:44
Hello. I'm new in pact-go. I'm testing the examaples of the pact-go documentation, but appears always the same error. ```2019/10/09 14:34:26 [DEBUG] starting service 2019/10/09 14:34:26 [ERROR] service exec: "pact-mock-service": executable file not found in $PATH 2019/10/09 14:34:26 [DEBUG] waiting for port 55073 to become available 2019/10/09 14:34:36 [ERROR] Expected server to start < 10s. Timed out waiting for Mock Server to start on port 55073 - are you sure it's running? panic: runtime error: invalid memory address or nil pointer dereference```

mauricio.galeas
2019-10-09 17:44
Do you know how to fix this?


mauricio.galeas
2019-10-09 19:23
yes

marius.maaland
2019-10-09 21:20
Is `pact/bin` in your `$PATH` ? `pact-go` does not seem to find `pact-mock-service` so I suspect it might not be

marius.maaland
2019-10-09 21:21
What happens if you run `pact-provider-verifier --help verify` ?

mauricio.galeas
2019-10-09 21:59
You were right. I didn't set the pact/bin correctly, but now i did it. Thx!

marius.maaland
2019-10-09 22:16
:+1:

matt.fellows
2019-10-09 23:01
Thanks Marius!

mauricio.galeas
2019-10-11 17:56
Hello i'm tryng to build a project with pact-go in travis/trusty, but when it starts to run test files this error appears: ```2019/10/11 17:52:57 [ERROR] service: /home/travis/pact/lib/ruby/bin/ruby: line 6: /home/travis/pact/lib/ruby/bin.real/ruby: No such file or directory --- PASS: TestProvider (0.13s)```

mauricio.galeas
2019-10-11 17:56
Is there something missing in travis.yml or my dockerfile?

mauricio.galeas
2019-10-11 18:26
I've fixed the previous error.

matt.fellows
2019-10-14 13:10
FYI `v1.0.0-beta.8` has been released with this included

matt.fellows
2019-10-14 13:10
thanks for your help

matt.fellows
2019-10-14 13:10
probably can release `1.0.0` now :slightly_smiling_face:

marius.maaland
2019-10-14 17:12
Nice! Thank you!

matt.fellows
2019-10-14 21:44
:+1:

matt.fellows
2019-10-14 21:45
Looks like I'll be doing some work on a client that used Go soon, and they are very keen for Pact. So I'll iron out any wrinkles I experience when there

marius.maaland
2019-10-15 21:51
Sounds good :slightly_smiling_face:

srinivasan.anusha
2019-10-28 22:50
has joined #pact-go

matt.fellows
2019-10-31 05:50
First cut at a Pact workshop for Go: https://github.com/pact-foundation/pact-workshop-go Feedback welcome!

mahadi087
2019-11-04 09:20
has joined #pact-go

matt.fellows
2019-11-11 00:14
we have a new feature available to Pact Go to remove the pain point of consumers breaking a provider build with new / changed contracts. If you?d like to opt-in to a beta of this, please DM me.

mauricio.galeas
2019-11-12 21:02
hey. Which is the right way to build a consumer test with a query param?

mauricio.galeas
2019-11-12 21:02
```// Package main contains a runnable Consumer Pact test example. package main import ( "fmt" "log" "net/http" "strings" "testing" "http://github.com/pact-foundation/pact-go/dsl" ) // Example Pact: How to run me! // 1. cd <pact-go>/examples // 2. go test -v -run TestConsumer func TestConsumer(t *testing.T) { type UserOutput struct { Name string `json:"fullname"` Phone string `json:"cellphone"` Gender string `json:"gender"` Country string `json:"country"` Region string `json:"region"` Commune string `json:"commune"` } // Create Pact connecting to local Daemon pact := &dsl.Pact{ Consumer: "consumer", Provider: "prov", Host: "localhost", } defer pact.Teardown() // Pass in test case var test = func() error { u := fmt.Sprintf("http://localhost:%d/api/v1/user/basics?mail=hola@mail.com", pact.Server.Port) req, err := http.NewRequest("GET", u, strings.NewReader(`{"mail":""}`)) // NOTE: by default, request bodies are expected to be sent with a Content-Type // of application/json. If you don't explicitly set the content-type, you // will get a mismatch during Verification. req.Header.Set("Content-Type", "application/json") if err != nil { return err } if _, err = http://http.DefaultClient.Do(req); err != nil { return err } return err } // Set up our expected interactions. pact. AddInteraction(). Given("A user"). UponReceiving("A request to get user"). WithRequest(dsl.Request{ Method: "GET", Path: dsl.String("user/basics?mail=hola@mail.com"), Headers: dsl.MapMatcher{"Content-Type": dsl.String("application/json")}, Body: map[string]string{ "mail": "", }, }). WillRespondWith(dsl.Response{ Status: 200, Headers: dsl.MapMatcher{"Content-Type": dsl.String("application/json")}, Body: dsl.Match(&UserOutput{}), }) // Verify if err := pact.Verify(test); err != nil { log.Fatalf("Error on Verify: %v", err) } fmt.Println("Test Passed!") } ```

mauricio.galeas
2019-11-12 21:03
im using this way but it isnt working prioperly

bethskurrie
2019-11-12 21:05
In other languages, the query params are a separate key

bethskurrie
2019-11-12 21:05
Try "Query".

mauricio.galeas
2019-11-12 21:34
ok, i will try

mauricio.galeas
2019-11-21 20:09
Hello! Which is the best way to retrieve a specific contract from pact-broker without extra information ?

mauricio.galeas
2019-11-21 20:28
I'm currently trying to obtain the "response" tag of a retrieved pact-test, from the broker. But it's pretty messy.

matt.fellows
2019-11-21 22:32
What are you trying to achieve?

gordo
2019-12-09 22:27
has joined #pact-go

bheemreddy181
2019-12-12 23:53
has joined #pact-go

dlmiddlecote
2020-01-12 23:40
has joined #pact-go

mokbat
2020-01-13 20:58
has joined #pact-go

anja.kammer
2020-01-23 12:23
has joined #pact-go

kulik.olenka
2020-03-12 05:18
has joined #pact-go

steffen.vulpius
2020-03-18 00:06
has joined #pact-go

steffen.vulpius
2020-03-18 00:07
Hi, I'm having an issue with the pact workshop. I dont see a pact file being created in step 3.

steffen.vulpius
2020-03-18 00:08
Here is the output (after adding -v and fmt.Println(os.Getenv("PACT_DIR")) in the test): ```--- ?Running Consumer Pact tests go test -v -tags=integration -count=1 http://github.com/pact-foundation/pact-workshop-go/consumer/client -run 'TestClientPact' /home/Steffen/code/pact-workshop-go/pacts 2020/03/17 17:05:28 [INFO] INFO WEBrick 1.3.1 2020/03/17 17:05:28 [INFO] INFO ruby 2.2.2 (2015-04-13) [i386-mingw32] 2020/03/17 17:05:28 [INFO] INFO WEBrick::HTTPServer#start: pid=11104 port=62467 === RUN TestClientPact_GetUser === RUN TestClientPact_GetUser/the_user_exists --- PASS: TestClientPact_GetUser (0.06s) --- PASS: TestClientPact_GetUser/the_user_exists (0.06s) PASS ok http://github.com/pact-foundation/pact-workshop-go/consumer/client 4.179s```

matt.fellows
2020-03-18 00:34
Can you please set the log level to `DEBUG` and run again?

matt.fellows
2020-03-18 02:13
It looks like you might be running in a Windows-like environment, but somehow it seems to start the mock service - so that?s a good start!

matt.fellows
2020-03-18 02:16
There should be a log file somewhere also - if you could dig that up and share that would be ace

tausif2909
2020-03-18 11:37
has joined #pact-go

steffen.vulpius
2020-03-18 17:20
Yes, this is under cygwin.

steffen.vulpius
2020-03-18 17:20
```$ make consumer --- ?Running Consumer Pact tests go test -v -tags=integration -count=1 http://github.com/pact-foundation/pact-workshop-go/consumer/client -run 'TestClientPact' Starting test /home/Steffen/code/pact-workshop-go/pacts 2020/03/18 10:13:47 [INFO] INFO WEBrick 1.3.1 2020/03/18 10:13:47 [INFO] INFO ruby 2.2.2 (2015-04-13) [i386-mingw32] 2020/03/18 10:13:47 [INFO] INFO WEBrick::HTTPServer#start: pid=12612 port=51529 === RUN TestClientPact_GetUser === RUN TestClientPact_GetUser/the_user_exists --- PASS: TestClientPact_GetUser (0.06s) --- PASS: TestClientPact_GetUser/the_user_exists (0.06s) PASS 2020/03/18 10:13:47 [DEBUG] pact setup logging 2020/03/18 10:13:47 [DEBUG] pact setup 2020/03/18 10:13:47 [DEBUG] pact write Pact file 2020/03/18 10:13:47 [DEBUG] mock service write pact 2020/03/18 10:13:47 [DEBUG] teardown 2020/03/18 10:13:47 [DEBUG] client: stop server 2020/03/18 10:13:47 [DEBUG] stopping service with pid 11876 ok http://github.com/pact-foundation/pact-workshop-go/consumer/client 4.177s```

steffen.vulpius
2020-03-18 17:21
I guess the file is written somewhere, but not in the expected place, maybe because its trying to use cygwin path name as a Windows path name?

steffen.vulpius
2020-03-18 17:22
Anyway, I'll set it up on MacOs

matt.fellows
2020-03-18 21:13
Thanks Steffen - given all of that seems to be working fine, I?m also guessing that the pact files will be written somewhere else too!

steffen.vulpius
2020-03-20 20:53
Now that I have it working, the output I get when verifying the provider is different from the doc:

steffen.vulpius
2020-03-20 20:53
```--- ?Running Provider Pact tests go test -count=1 -tags=integration http://github.com/pact-foundation/pact-workshop-go/provider -run "TestPactProvider" 2020/03/20 13:48:06 API starting: port 61622 ([::]:61622) --- FAIL: TestPactProvider (0.90s) pact.go:416: Verifying a pact between GoAdminService and GoUserService Given User sally exists A request to login with user 'sally' with GET /users/10 returns a response which has a matching body user_service_test.go:33: Pact test failed FAIL FAIL http://github.com/pact-foundation/pact-workshop-go/provider 1.129s FAIL make: *** [provider] Error 1```

steffen.vulpius
2020-03-20 20:54
it doesn?t show the diff

matt.fellows
2020-03-20 22:14
yes I?ve seen this issue recently. I think the latest standalone breaks it because of the wey the output

matt.fellows
2020-03-20 22:19
I?ll try and diagnose it today, and will raise an issue to fix it

matt.fellows
2020-03-20 22:19
sorry about this

bethskurrie
2020-03-20 23:31
I didn't think I made a backwards incompatible change, but let me know if you need something fixed @matt.fellows

matt.fellows
2020-03-20 23:39
It was the change that sent output from stdout to stderr or something like that.

matt.fellows
2020-03-20 23:40
I'll fix it on the go side because I think that's where it belongs. I need to look a bit more carefully though and will let you know what I find

bethskurrie
2020-03-20 23:46
There might have been an unintentional release while we were working out the right format.

matt.fellows
2020-03-21 00:02
@bethskurrie so just got home from swimming and did a quick test (outside of go). Start a web server on a port so you get passed the connection refused erors (e.g. `python -m http.server 8080` (python 3) or `python -m SimpleHTTPServer` (python 2), then point your verifier at any old pact file with the json formatter enabed: ``` ./pact/bin/pact-provider-verifier -f json --provider-base-url http://localhost:8080 ./examples/pacts/consumer-httpbin.json | jq .```

matt.fellows
2020-03-21 00:04
With the JSON formatter, neither in stdout/stderr do you get the formatted diffs. This used to be the case, but seems to have disappeared. Current version of the verifier from latest standalone is `1.30.0` . But I?m pretty sure the regression came in a few releases ago

matt.fellows
2020-03-21 00:07
I think the mismatches has the info I need, but doesn?t pretty-print it

bethskurrie
2020-03-21 00:52
Hm I don't remember changing that.

bethskurrie
2020-03-21 00:53
I'll have a look this afternoon.

bethskurrie
2020-03-21 01:29
Looks like the exception has disappeared.

bethskurrie
2020-03-21 02:04
@matt.fellows 1.82.1

bethskurrie
2020-03-21 02:05
It was a while ago that disappeared. I hadn't realised that go was relying on that part of the json for the mismatches, and I'd removed it because of the noise of the backtrace.

matt.fellows
2020-03-21 02:16
I'll have a look but I'm fairly confident we weren't using a JSON field to print the failure - it was in stderr/stdout somewhere and we just printed it verbatim

matt.fellows
2020-03-21 02:16
Let me confirm, I've just put toddler down for a nap and will jump online in 5

bethskurrie
2020-03-21 02:17
I didn't think it supported doing json to file and stdout as well.

bethskurrie
2020-03-21 02:19
Using git@github.com:pact-foundation/pact-ruby-standalone-e2e-example.git is the easiest way to go back in time.

bethskurrie
2020-03-21 02:19
set the standalone version in script/install.sh

matt.fellows
2020-03-21 02:23
thanks

matt.fellows
2020-03-21 02:23
Online now, will give it a ~go~ Go

matt.fellows
2020-03-21 02:33
OK whatever you did fixed it. I?ll look at the diff shortly

bethskurrie
2020-03-21 02:33
I put the exception back in.

matt.fellows
2020-03-21 02:33
Is that in the JSON document?

bethskurrie
2020-03-21 02:33
yes

matt.fellows
2020-03-21 02:33
Cool. Let me just see what we?re doing to make sure it?s sensible

matt.fellows
2020-03-21 02:37
ok cool yep, we were just printing `example.Exception.Message` - so thanks for adding it back in. I recalled a while back me doing some magic on the strings in `stderr`/`stdout` and hence my initial suspicion. The only magic now is the JSONL formatted parsing of `stdout` that goes on to get the JSON.

matt.fellows
2020-03-21 02:37
thanks for fixing so quickly

bethskurrie
2020-03-21 02:41
np

matt.fellows
2020-03-21 02:43
@steffen.vulpius delete the `./pact` folder in the workshop and try running the step again. It should automatically pull down the latest standalone with a fix for that message. Thanks for raising it!

steffen.vulpius
2020-03-21 20:40
Cool. I'll reinstall it. I setup pact broker locally and have a python client publishing to a Go service. Can't wait to demo it to my org next week.

braddle
2020-03-25 11:47
Is there a way to make the example content for Errors empty for this struct?? ```type Status struct { Status string `json:"status" pact:"example=OK"` Errors []string `json:"errors"` }``` I am looking for something like this: ```{ "status": "OK, "errors": [] }```

matt.fellows
2020-03-25 11:49
hmm that is an interesting question.

matt.fellows
2020-03-25 11:49
Also, hello there - long time no speak!

braddle
2020-03-25 11:53
Hi, How are you doing?

rbenbolton
2020-03-26 22:56
has joined #pact-go

matt.fellows
2020-04-20 12:29
Sorry, I ended up going to bed - late night. Did I see that you?d moved on from Sainos?

bheemreddy181
2020-04-20 21:12
Hey , Pact Gophers - How dow you handle a session based authorization on a API while verifying contracts on the provider Example : there is a session API which is used to create a token and that token is an Authorization for another request API , and that session lasts only for some time

matt.fellows
2020-04-20 23:32
:wave:

matt.fellows
2020-04-20 23:32
I usually replace any tokens with a valid token using request filters https://github.com/pact-foundation/pact-go#request-filtering

matt.fellows
2020-04-20 23:33
Step 8-10 cover off this exact scenario. See https://github.com/pact-foundation/pact-workshop-go/tree/step10 for the solution to the problem

bheemreddy181
2020-04-21 00:42
@matt.fellows@matt.fellows@matt.fellows will I be able to do this for each state say good state where the session is valid and invalid state where the session is invalid some thing like that ?

matt.fellows
2020-04-21 00:46
of course

bheemreddy181
2020-04-21 00:47
Typically in the state handlers directly

matt.fellows
2020-04-21 00:47
you can handle that in many ways - state handlers are the main one though

matt.fellows
2020-04-21 00:47
yes

bheemreddy181
2020-04-21 00:52
If you have any example can you share the same ?

matt.fellows
2020-04-21 00:53
The example above does this, does it not?

bheemreddy181
2020-04-21 00:53
The above example adds it to all requests which is slightly different from our case

matt.fellows
2020-04-21 00:54
So use the state handlers to set a variable that the request filter uses

matt.fellows
2020-04-21 00:54
and then the request filter can act conditionally on the state

bheemreddy181
2020-04-21 00:54
Ah got it may be I am understand you let me give a try

bheemreddy181
2020-04-23 14:57
I am slightly confused matt here , can we append request filters from the state handlers ?

matt.fellows
2020-04-23 23:14
No, the request filter is a function that has to be declared in advance of running the verification. That function can close over variables however in the outer scope (e.g. a top-level test variable like `var authorization bool` ). You could then use the state handlers to enable/disable authorization by setting the value to what you need

matt.fellows
2020-04-23 23:14
make sense?

bheemreddy181
2020-04-24 01:55
the idea is the authorization header value changes based on the endpoint what we test , for one API thee header value is static where as for other API the value is dynamic , the dynamic value is what we want to override in the statehandlers

bheemreddy181
2020-04-24 01:55
@matt.fellows ^

bheemreddy181
2020-04-24 01:56
Typically the value for the Dynamic API is generated from static API endpoint basically its all session based

bheemreddy181
2020-04-24 01:59
here is an example what we trying , we haven?t tested this but ```func (suite *FunctionalTestSuite) TestProvider() { token, err := uuid.NewUUID() if err != nil { suite.FailNow(err.Error()) } suite.authToken = token f := func(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { if strings.Contains(r.RequestURI, "requests") { r.Header.Add("Authorization", suite.authToken.String()) next.ServeHTTP(w, r) } }) } // Verify the Provider - Tag-based Published Pacts for any known consumers _, err = suite.pact.VerifyProvider(suite.T(), types.VerifyRequest{ ProviderBaseURL: os.Getenv("PACT_BASE_URL"), Tags: []string{"master", "prod"}, FailIfNoPactsFound: true, BrokerURL: os.Getenv("PACT_BROKER_URL"), BrokerUsername: os.Getenv("PACT_BROKER_USERNAME"), BrokerPassword: os.Getenv("PACT_BROKER_PASSWORD"), BrokerToken: os.Getenv("PACT_BROKER_TOKEN"), PublishVerificationResults: true, StateHandlers: suite.getPactStateHandlers(), RequestFilter: f, }) if err != nil { suite.FailNow(err.Error()) } } func (suite *FunctionalTestSuite) getPactStateHandlers() types.StateHandlers { return types.StateHandlers{ "a session exists for requests API ": func() error { _, err := persistSession(exampleSession(), suite.authToken) if err != nil { return err } return nil }, } }```

bheemreddy181
2020-04-24 02:00
if you look at the statehandlers here we are trying to persist the token what we are passing in the RequestFilter for Authorization

matt.fellows
2020-04-24 02:34
ok, so what?s the question exactly?

matt.fellows
2020-04-24 02:34
I can?t validate that your code works obviously, but something like that should work

matt.fellows
2020-04-24 02:34
you have all of the tools you need to modify the request based on a state handler.

matt.fellows
2020-04-24 02:35
> Typically the value for the Dynamic API is generated from static API endpoint basically its all session based Do you mean you have to go out to another API to get the session value? You may want to consider mocking that component out


bheemreddy181
2020-04-24 03:47
Will give a try for sure , the reason I shared the implementation is to check whether is this the recommended way to implement this or is there a better way for this

matt.fellows
2020-04-24 03:50
No probs!

matt.fellows
2020-04-24 03:51
So I don?t fully appreciate the authentication layers going on in the app, but what you?re doing there looks fine to me

matt.fellows
2020-04-28 01:15
How?d you go @bheemreddy181?

bheemreddy181
2020-04-28 01:18
It is going good just that the examples were slightly confusing - ruby implementation was quite straight forward compared to Go, same with setup as well

matt.fellows
2020-04-28 06:13
what?s confusing about the examples? Happy to update them

marko.justinek
2020-04-29 02:06
has joined #pact-go

bheemreddy181
2020-04-30 01:38
Mainly interms of spinning up the application for running pact tests , major Go Application just serve the HTTP requests user mux router they don?t spin up the app on local host.

bheemreddy181
2020-04-30 01:39
we don?t have file structure like this ```go test -count=1 -tags=integration http://github.com/pact-foundation/pact-workshop-go/provider -run "TestPactProvider"``` how do we run tests when the file structure is really flat ? and we all use GO MODS

matt.fellows
2020-04-30 01:48
> Mainly interms of spinning up the application for running pact tests , major Go Application just serve the HTTP requests user mux router they don?t spin up the app on local host. (edited) I would like to add support for that. It shouldn?t actually be very hard, but at the moment, starting it up shouldn?t be terribly difficult

matt.fellows
2020-04-30 01:48
> how do we run tests when the file structure is really flat ? and we all use GO MODS That?s up to you. I can?t answer how you want to structure your tests. It?s very common to use build tags, if you don?t want to use build tags, remove the tags

bheemreddy181
2020-04-30 01:50
Even Developers are taking longer time for setting up pact either on provider and consumer the examples help a lot but more documentation should help

matt.fellows
2020-04-30 01:52
The workshop using `go mod`, so that shouldn?t be an issue - have you looked at that?

matt.fellows
2020-04-30 01:52
We?ve found that more documentation doesn?t necessarily help, it would be great to know what challenges they have specifically, and then we can address that

matt.fellows
2020-04-30 01:52
I?d very much suggest they all run the workshop first

matt.fellows
2020-04-30 01:52
It?s very detailed, and covers of 99% of what you normally need to do

bheemreddy181
2020-04-30 01:55
Sounds good we are giving our best to understand the tests , the setup is slightly different from Examples to our Applications. I will ask my dev to ask questions here

bheemreddy181
2020-04-30 01:56
Does holding a go protobuf registry ( which holds all the schema for multiple services ) as a library for a group of services eliminate Contract Tests ?

bheemreddy181
2020-04-30 01:58
The Schema defined in the library is used by multiple services , typically everyone should use the same package and import schema from it and fill the data and emit messages out

matt.fellows
2020-04-30 02:07
See https://pact.canny.io/feature-requests/p/support-grpc and the protobufs feature. Keen for more feedback (but the short answer I think is ?no?)

bheemreddy181
2020-04-30 20:58
Is there a way we can read request headers in State Handlers for Go Implementation ? Our use case is more like we want session passed in as header for an API and store that in the DB ( for Authorization ) before verifying the request

matt.fellows
2020-04-30 22:04
Request filter is the only opportunity to read from or modify a request. Can't you create the session header from a state handler, and then inject it using a request filter?

matt.fellows
2020-04-30 22:05
If not, I'd recommend just not including authorization in your tests because it is sounding like you're making it too complicated. It shouldn't be the case

bheemreddy181
2020-04-30 23:01
the idea was we want to keep a session sitting in thee contract file and then use that session in the state handlers to persist in the db , as you said it is getting complicated

matt.fellows
2020-04-30 23:05
when you say ?session in the contract files? what do you mean? A long lived session? How long will the session be valid for?

matt.fellows
2020-04-30 23:05
It all sounds like a recipe for confusion and unmaintainable tests, if you ask me

matt.fellows
2020-04-30 23:05
I?d start to question the value of including auth in pact tests if you can?t make it more simple (and also, if your auth need be this complicated in the first place)

matt.fellows
2020-04-30 23:06
presumably, auth is common to all of your services. So in that case, you could fallback to other types of tests (good functional coverage on the provider, and any synthetic/smoke tests for consumers)

matt.fellows
2020-04-30 23:07
FWIW it usually isn?t this hard, so my instincts are telling me something else is wrong - e.g. the code base isn?t modular enough to deal with it etc.

bheemreddy181
2020-04-30 23:17
makes sense , i will move away the auth from contract and just handle them directly in state handlers

bheemreddy181
2020-04-30 23:17
Another Question @matt.fellows

bheemreddy181
2020-04-30 23:18
is this a right matcher for matching on string ? ``` }, "response": { "status": 200, "headers": { "Content-Type": "application/json; charset=utf-8" }, "body": { "request": { "id": "4c8e646e-2e19-4796-81ea-c1ec5f45d156" }, "matchingRules": { "$.body.request.id": { "match": "type" } } } } } ], "metadata": { "pactSpecification": { "version": "2.0.0" } }```

bheemreddy181
2020-04-30 23:19
like the response body.request.id needed to be a string and can be anything assume my consumer has written some wrong matchers i feel

matt.fellows
2020-04-30 23:27
Yep, that is a string matcher in this case. Is the request id supposed to be a string or something else?

bheemreddy181
2020-04-30 23:27
string only

bheemreddy181
2020-04-30 23:29
Error ```Description of differences -------------------------------------- * Expected a Hash (like {"request"=>{"id"=>"4c8e646e-2e19-4796-81ea-c1ec5f45d156"}, "matchingRules"=>{"$.body.request.id"=>{"match"=>"type"}}}) but got a String ("{\"request\":{\"id\":\"e8393004-8b37-11ea-9596-dca90488bbb8\",\"type\":\"access\",\"status\":\"initial\",\"error\":\"\"}}") at $```

bheemreddy181
2020-04-30 23:29
Ah i think a header is missing for this

matt.fellows
2020-04-30 23:29
I think you need to set the `content-type` header

bheemreddy181
2020-04-30 23:32
i have that actually

matt.fellows
2020-05-01 00:04
What?s the response type from the API?

matt.fellows
2020-05-01 00:04
The matching library is getting a content type that?s not JSON, so it?s interpreting the result as a string

matt.fellows
2020-05-01 00:05
so maybe just check that

bheemreddy181
2020-05-01 00:06
ok will check that

bheemreddy181
2020-05-01 00:07
Another question when ever we have multiple clients using the same API , does that mean we write multiple TestProvider https://github.com/pact-foundation/pact-go/blob/master/examples/provider_test.go#L22 each with its own provider consumer config and its own request filters ?

bheemreddy181
2020-05-01 00:08
I mean more like multiple Consumer Combination

matt.fellows
2020-05-01 00:11
No, just one provider test is all that is required, and you fetch all contracts registered for that provider

matt.fellows
2020-05-01 00:11
Haven?t you done this with Ruby already?

kaypee90
2020-05-01 00:19
has joined #pact-go

bheemreddy181
2020-05-01 00:19
For ruby we have done only one combo , but we provide the consumer name as part of the rake JOB

bheemreddy181
2020-05-01 00:20
I see that we provider the combo like this while doing the setup ```suite.pact = &dsl.Pact{ Consumer: os.Getenv("CONSUMER_NAME"), Provider: os.Getenv("PROVIDER_NAME"), LogLevel: "INFO", }```

bheemreddy181
2020-05-01 00:20
does this mean i do the same for other combinations ?

matt.fellows
2020-05-01 00:31
the consumer is not required on the provider side verification

matt.fellows
2020-05-01 00:33
I?ll update the readme, that?s not very clear I?m sorry

bheemreddy181
2020-05-01 00:44
Oh cool thanks

bheemreddy181
2020-05-01 00:46
Here is an issue what i am seeing @matt.fellows , for some reason i have to append and header while writing response thats ok i will check with dev why thats happening . but if you look at the below response even with a matcher it is trying to match the exact value ``` { "request": { - "id": "4c8e646e-2e19-4796-81ea-c1ec5f45d156" - }, - "matchingRules": { - "$.body.request.id": { - "match": "type" - } + "id": "87eb23f8-8b44-11ea-9602-dca90488bbb8" } } Description of differences -------------------------------------- * Expected "4c8e646e-2e19-4796-81ea-c1ec5f45d156" but got "87eb23f8-8b44-11ea-9602-dca90488bbb8" at $.request.id * Could not find key "matchingRules" (keys present are: request) at $```

matt.fellows
2020-05-01 00:47
hangon, how did the matching rules get added to the `body`? Are you hand coding the pact?

bheemreddy181
2020-05-01 00:48
nope thats not the body let me share the pact file

bheemreddy181
2020-05-01 00:48
```{ "consumer": { "name": "consumer" }, "provider": { "name": "provider" }, "interactions": [ { "description": "a request for request creation", "providerState": "a session exists for requests API", "request": { "method": "post", "path": "/public-api/requests", "headers": { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "4c8e646e-2e19-479s6-81ea-c1ec5f45d156" }, "body": { "request_type": "access" } }, "response": { "status": 200, "headers": { "Content-Type": "application/json; charset=utf-8" }, "body": { "request": { "id": "4c8e646e-2e19-4796-81ea-c1ec5f45d156" }, "matchingRules": { "$.body.request.id": { "match": "type" } } } } } ], "metadata": { "pactSpecification": { "version": "2.0.0" } } }```

matt.fellows
2020-05-01 00:50
the error message above is 100% looking for a field called `matchingRules` in the body.

matt.fellows
2020-05-01 00:50
it?s also a child of `body` in the message you just pasted

matt.fellows
2020-05-01 00:51
It seems to me somebody has manually modified that Pact file, or is using a broken pact consnumer code

bheemreddy181
2020-05-01 00:51
Oh ok which is weird let me generate a new PACT file then and test with that

matt.fellows
2020-05-01 00:54
I?m in meetins for the next few hours - good luck!

bheemreddy181
2020-05-01 00:54
thanks for helping

bheemreddy181
2020-05-01 12:42
i assume there is an issue with `pact-support gem 1.14.3` where it is not able to read the pact file with a matcher from pact broker ```2020/05/01 07:37:56 [DEBUG] executing after hook 2020/05/01 07:37:56 [DEBUG] teardown --- FAIL: TestFunctionalTestSuite (3.40s) --- FAIL: TestFunctionalTestSuite/TestProvider (3.39s) contract_test.go:59: Error Trace: contract_test.go:59 Error: Expected nil, but got: &errors.errorString{s:"error verifying provider: exit status 1\n\nSTDERR:\nINFO: Fetching pacts for provider_name from http://pact-broker-poc.dev.com for tags: latest master\nINFO: Reading pact at http://pact-broker-poc.dev.com/pacts/provider/provider_name/consumer/consumer_name/version/1.0.0\nError reading file from \nNo such file or directory @ rb_sysopen - /Users/bvennapureddy/pact/lib/vendor/ruby/2.2.0/gems/pact-support-1.14.3/lib/pact/consumer_contract/pact_file.rb:51:in `read'\n/Users/bvennapureddy/pact/lib/vendor/ruby/2.2.0/gems/pact-support-1.14.3/lib/pact/consumer_contract/pact_file.rb:51:in `get_local'\n/Users/bvennapureddy/pact/lib/vendor/ruby/2.2.0/gems/pact-support-1.14.3/lib/pact/consumer_contract/pact_file.rb:41:in `render_pact'\n/Users/bvennapureddy/pact/lib/vendor/ruby/2.2.0/gems/pact-support-1.14.3/lib/pact/consumer_contract/pact_file.rb:22:in `read'\n/Users/bvenn``` the same pact file works when i reference it from my local using PACT_URL?s , correct me if i am wrong

bheemreddy181
2020-05-01 12:45
i am using CURL command to push contracts to broker manually which is something like this ```curl -v -XPUT \-H "Content-Type: application/json" -d@consumer_name-provider_name.json http://pact-broker-poc.dev.com/pacts/provider/provider_name/consumer/consumer_name/version/1.0.0```

bheemreddy181
2020-05-01 12:53
below is how my provider setup looks like ```// Verify the Provider - Tag-based Published Pacts for any known consumers _, err := suite.pact.VerifyProvider(suite.T(), types.VerifyRequest{ AfterEach: func() error { suite.pact.Teardown() return nil }, ProviderBaseURL: fmt.Sprintf("http://127.0.0.1:%d", port), PactURLs: []string{os.Getenv("PACT_URL")}, Tags: []string{"master"}, FailIfNoPactsFound: true, BrokerURL: fmt.Sprintf(os.Getenv("PACT_BROKER_URL")), PublishVerificationResults: canIPublishResultsToBroker(suite), ProviderVersion: os.Getenv("TRAVIS_PULL_REQUEST_SHA"), StateHandlers: suite.getPactStateHandlers(), RequestFilter: updateIncomingRequestHeaders, })```

matt.fellows
2020-05-01 12:56
You need to configure the test to use the broker properties, not pact URLs

matt.fellows
2020-05-01 12:56
See examples in repo

bheemreddy181
2020-05-01 12:57
without matcher in the pact file this works fine for some reason

bheemreddy181
2020-05-01 12:57
will check that

matt.fellows
2020-05-01 12:57
That doesn't sound right to me

bheemreddy181
2020-05-01 12:58
Actually i am using both

bheemreddy181
2020-05-01 12:59
the reason you see PACT_URL above is my consumer triggered provider CI build will pass a PACT_URL where as provider PR verification will directly pull master contract from pact broker

bheemreddy181
2020-05-01 12:59
using broker properties like the BROKER_URL

bheemreddy181
2020-05-01 13:00
the setup is done this way because we want to use the same configuration for both ( Consumer initiated CI build vs PROVIDER initiated CI build )

bheemreddy181
2020-05-01 13:01
if there is PACT_URL pull that pact file else pull the master PACT from the broker for all consumers

bheemreddy181
2020-05-01 13:03
if i use the pact file from local ( bare metal ) reference this setup works fine , i see a problem only when i am pulling this pact file from the broker

matt.fellows
2020-05-01 13:03
Seems highly unlikely, but if you can prove that that needs to be fixed!

bheemreddy181
2020-05-01 13:22
either the error logging is not correct i feel , hard to debug whats wrong here , i tried a pact file from broker without a matcher i see the below logs ```2020/05/01 08:15:50 [DEBUG] teardown --- FAIL: TestFunctionalTestSuite (3.06s) --- FAIL: TestFunctionalTestSuite/TestProvider (2.96s) --- FAIL: TestFunctionalTestSuite/TestProvider/has_a_matching_body (0.00s) pact.go:622: Verifying a pact between consumer_name and provider_name Given a session exists for requests API request to create a request with POST /public-api/requests returns a response which has a matching body pact.go:628: Verifying a pact between consumer_name and provider_name Given a session exists for requests API request to create a request with POST /public-api/requests returns a response which has a matching body Actual: {"request":{"id":"e0e0b432-8bad-11ea-b94f-dca90488bbb8","type":"access","status":"initial","error":""}} Diff -------------------------------------- Key: - is expected + is actual Matching keys and values are not shown { "request": { - "id": "4c8e646e-2e19-4796-81ea-c1ec5f45d156" + "id": "e0e0b432-8bad-11ea-b94f-dca90488bbb8" } } Description of differences -------------------------------------- * Expected "4c8e646e-2e19-4796-81ea-c1ec5f45d156" but got "e0e0b432-8bad-11ea-b94f-dca90488bbb8" at $.request.id contract_test.go:60: Error Trace: contract_test.go:60 Error: Expected nil, but got: &errors.errorString{s:"error verifying provider: exit status 1\n\nSTDERR:\nINFO: Fetching pacts for datacompliance from http://pact-broker-poc.dev.com for tags: latest master\nINFO: Reading pact at http://pact-broker-poc.dev.com/pacts/provider/provider_name/consumer/consumer_name/version/1.0.0\nError reading file from \nNo such file or directory @ rb_sysopen - /Users/bvennapureddy/pact/lib/vendor/ruby/2.2.0/gems/pact-support-1.14.3/lib/pact/consumer_contract/pact_file.rb:51:in `read'\n/Users/bvennapureddy/pact/lib/vendor/ruby/2.2.0/gems/pact-support-1.14.3/lib/pact/consumer_contr```

bheemreddy181
2020-05-01 13:23
which also has ```Reading pact at http://pact-broker-poc.dev.com/pacts/provider/provider_name/consumer/consumer_name/version/1.0.0\nError reading file from \nNo such file or directory @ rb_sysopen - /Users/bvennapureddy/pact/lib/vendor/ruby/2.2.0/gems/pact-support-```

matt.fellows
2020-05-01 13:34
Can you please set log level to debug and share that? I suspect a configuration issue

matt.fellows
2020-05-01 13:34
It is confusing tho getting a response and that error

bheemreddy181
2020-05-01 13:35
Can i DM you the logs or paste it here ?

matt.fellows
2020-05-01 13:45
What happens if you comment out pact_urls ?

matt.fellows
2020-05-01 13:45
I think you're passing in an empty string

matt.fellows
2020-05-01 13:47
Hence why it's says can't read file <blank>

matt.fellows
2020-05-01 13:47
(sorry I'm on a mobile)

bheemreddy181
2020-05-01 13:48
giving a try

bheemreddy181
2020-05-01 13:50
Ah that worked , is there a way we can support this ?

matt.fellows
2020-05-01 13:53
What do you mean?

matt.fellows
2020-05-01 13:53
Don't supply an empty string in that value

matt.fellows
2020-05-01 13:54
I.e. Ensure PACT_URLS slice is empty

matt.fellows
2020-05-01 13:54
Have to run but sounds like you're back on track

bheemreddy181
2020-05-01 13:59
Can we improve the logging when there are errors ?

dan.h.lee329
2020-05-02 01:54
has joined #pact-go

bheemreddy181
2020-05-03 15:23
I was able to successfully do a pact provider setup for one of our GO applications thanks a ton Matt for the help

bheemreddy181
2020-05-03 18:29
while publishing the results from the CI , i don?t see the provider tags are being set correctly , we are passing in the branch names as a reference , but the broker UI doesn?t show up anything

bheemreddy181
2020-05-03 19:03
this is how verify provider looks like ```// Verify the Provider - Tag-based Published Pacts for any known consumers _, err := suite.pact.VerifyProvider(suite.T(), types.VerifyRequest{ AfterEach: func() error { suite.pact.Teardown() return nil }, ProviderBaseURL: fmt.Sprintf("http://127.0.0.1:%d", port), // Consumer initiated CI build will have PACT URL with a specific pact PactURLs: setPACTURL(), Tags: []string{"master"}, FailIfNoPactsFound: true, BrokerURL: fmt.Sprintf(os.Getenv("PACT_BROKER_URL")), PublishVerificationResults: canIPublishResultsToBroker(), ProviderVersion: getProviderVersion(), StateHandlers: suite.getPactStateHandlers(), RequestFilter: updateIncomingRequestHeaders, ProviderTags: []string{os.Getenv("BRANCH")}, })``` i could see there is BRANCH variable on my CI as well


matt.fellows
2020-05-03 23:16
The docs there could probably be updated, but that file is for internal use only anyway

matt.fellows
2020-05-03 23:16
The flag is passed in `types/verify_request.go`

matt.fellows
2020-05-03 23:17
In `debug` log level, you should see the arguments passed to the standalone CLI. If `--provider-version-tag` is not being said, there may be an issue (or latest standalone tools not installed)

bheemreddy181
2020-05-04 00:04
i don?t see that in the debug log level ``` starting verification service with args: [--format json --provider-base-url http://localhost:63819 --provider-states-setup-url http://localhost:63819/__setup --pact-broker-base-url http://pact-broker-poc.dev.com --provider_app_version 1.0.0 --provider providername --consumer-version-tag master]```

bheemreddy181
2020-05-04 00:10
Do you know which standalone had this issue and in which version it was fixed

matt.fellows
2020-05-04 00:34
ok so something else is amisse

matt.fellows
2020-05-04 00:34
can you please print out `os.Getev("BRANCH")`

matt.fellows
2020-05-04 00:34
it doesn?t look to be an issue with the standalone, it looks like an issue with pact go

bheemreddy181
2020-05-04 00:35
yes i did the value exists

matt.fellows
2020-05-04 00:36
:thought_balloon:

bheemreddy181
2020-05-04 00:43
I even tried with a hardcoded value i see the same issue

matt.fellows
2020-05-04 00:43
which version of pact go?

bheemreddy181
2020-05-04 00:44
```v1.3.0```

matt.fellows
2020-05-04 00:51
ta

matt.fellows
2020-05-04 01:16
I?ve found the issue - just pushed up a change now. Can you pull latest (not tagged) to see if that works?

bheemreddy181
2020-05-04 01:19
i just saw a new commit , Sure will check that

bheemreddy181
2020-05-04 01:26
Perfecto that worked :slightly_smiling_face:

bheemreddy181
2020-05-04 01:27
why is verbose variable deprecated

matt.fellows
2020-05-04 01:40
It?s a long answer, but basically because it?s incompatible with the way the current Go package works

matt.fellows
2020-05-04 01:41
It?s been deprecated for at least a year I think

matt.fellows
2020-05-04 01:41
released `1.4.0`

bheemreddy181
2020-05-04 01:51
thanks :slightly_smiling_face:

matt.fellows
2020-05-04 01:51
no probs! Thanks for picking up the issue

bheemreddy181
2020-05-04 15:28
How do we do a no_op in state handlers in go similar to ruby ? https://github.com/pact-foundation/pact-ruby/wiki/Provider-states#provider-codebase

dan.h.lee329
2020-05-04 16:53
I've notice that `GraphQLInteraction` is implemented for `pact-js`, but not `pact-go`. No one has submitted an enhancement request so far, is there a roadmap to bring this feature into `pact-go` ? I can submit the request if not planned yet, thanks!

matt.fellows
2020-05-04 21:49
Just pass in a function that doesn't return an error

matt.fellows
2020-05-04 21:49
PR/feature request welcome!

bheemreddy181
2020-05-04 22:00
Is there any documentation about Work in progress pacts , i couldn?t find it

matt.fellows
2020-05-04 22:01
It's documented on the readme

bheemreddy181
2020-05-04 22:07
Sorry i missed that

bheemreddy181
2020-05-06 02:34
Quick Question Team , understanding pending pacts https://github.com/pact-foundation/pact-go/blob/master/README.md#pending-pacts what does this mean ? ```It does so by flagging the contract as "unverified" in the Pact Broker the first time a contract is published``` Do we need to manually unverify the pact using an API ?

matt.fellows
2020-05-06 02:36
> It does so by flagging the contract as ?unverified? in the Pact Broker *the first time a contract is published* does that answer your question?

matt.fellows
2020-05-06 02:36
I?ve bolded the part that should answer it :wink:

matt.fellows
2020-05-06 02:37
(short answer is no)

bheemreddy181
2020-05-06 02:41
you mean tagging the contract as `unverified` rather than tagging it as `master` ? i am slightly confused

matt.fellows
2020-05-06 02:42
you don?t do anything, when the pact is published the broker automatically detects that the contract has or hasn?t been seen before and internally marks it as ?pending? or not

matt.fellows
2020-05-06 02:43
when provider verificaction happens, if the verification passes it transitions out of pending and is now a real contract that will break builds (see the original article that talks about the caveats around tagging etc.)

matt.fellows
2020-05-06 02:44
if the verification fails, the `can-i-deploy` check for the consumer will fail, because the provider has not yet verified it

bheemreddy181
2020-05-06 02:48
Ah ok , that depends on if provider enabled `EnablePending: true` which will automatically set the verifications results to true even though the contract is failed / not verified - we are not using `can-i-deploy` actually

bheemreddy181
2020-05-06 02:57
thanks for the explanation

matt.fellows
2020-05-06 02:58
> verifications results to true No, the verification results are still sent back to the broker that the verification failed, and the reasons why (so in Pactflow you can see why the verification failed, which fields were impacted etc.). It just returns a local exit status of `0`

matt.fellows
2020-05-06 02:59
So if you?re not using `can-i-deploy` you?ll need a way to check if the consumer is compatible with the provider - otherwise you might release something the provider does not yet support

bheemreddy181
2020-05-06 03:00
We are using http://blog.pact.io/2018/07/16/publishing-pact-verification-statuses-to-github/ feature actually which will replace `can-i-deploy`

bheemreddy181
2020-05-06 03:02
```if the verification fails, the can-i-deploy check for the consumer will fail, because the provider has not yet verified it``` this more looks like feature branch based implementation

matt.fellows
2020-05-06 03:02
why?

bheemreddy181
2020-05-06 03:02
we don?t want the consumer build to be blocked until the provider actually implements the feature

matt.fellows
2020-05-06 03:03
sure, so how do you have a feature in master that is going to production that relies on an API that doesn?t yet exist?

bheemreddy181
2020-05-06 03:06
Steps we are following now is 1. Consumer pushes contracts first to branch and then pushes them to master ( Typically only writes tests first ) feature is switched off 2. Provider implements the feature by looking at the contracts ( Test Driven Development ) may be 3. Once Provider successfully implements the feature thats when we will ask the Consumer to Switch on the feature and we will enable the Git Status Checks

bheemreddy181
2020-05-06 03:07
I assume here for time being if we don?t enable Git Status Checks that should fill this use case , but correct me if i am wrong

morten.hekkvang
2020-05-07 10:25
has joined #pact-go

pyasi
2020-05-08 13:48
has joined #pact-go

morten.hekkvang053
2020-05-10 08:40
has joined #pact-go

bheemreddy181
2020-05-10 21:09
I don?t see this happening i still see the jobs exits with a status `1` this is how my provider setup looks like ```// Verify the Provider - Tag-based Published Pacts for any known consumers _, err := suite.pact.VerifyProvider(suite.T(), types.VerifyRequest{ AfterEach: func() error { suite.pact.Teardown() return nil }, ProviderBaseURL: fmt.Sprintf("http://127.0.0.1:%d", port), // Consumer initiated CI build will have PACT URL with a specific pact //PactURLs: setPACTURL(), PactURLs: []string{"pact.json"}, //Tags: []string{"master"}, FailIfNoPactsFound: true, //BrokerURL: fmt.Sprintf(os.Getenv("PACT_BROKER_URL")), PublishVerificationResults: canIPublishResultsToBroker(), StateHandlers: suite.getPactStateHandlers(), RequestFilter: updateIncomingRequestHeaders, // https://github.com/pact-foundation/pact-go/blob/master/README.md#pending-pacts // even if we get new contracts which is not implemented in case as we are doing parallel development. This flag will mark Provider CI Green EnablePending: true, // These below two are used to tag the provider version and the reference branch for each verification ProviderVersion: getProviderVersion(), ProviderTags: setProviderTags(), })```

bheemreddy181
2020-05-10 21:12
Another thing i spotted here is if i have local pact which i am referring to , with `BrokerURL`it doesn?t pick the local pact rather refers to the broker

bheemreddy181
2020-05-10 21:13
Doesn?t pactUrl array takes the precedence over the brokerURL ?

bheemreddy181
2020-05-10 23:29
I don?t think this works as expected more details in the thread

matt.fellows
2020-05-10 23:31
So two things. You currently need to be using Pactflow for pending pacts (we often test out new features this way). It was mentioned previously but not clear in the readme. I'll update that

matt.fellows
2020-05-10 23:32
The second part I'm not sure off the top of my head the precedence rules. I would just set the right properties dynamically rather than specifying both

bheemreddy181
2020-05-10 23:37
Another quick question , go test suite only tells that there are only two things getting validated when ever i run my test 1. has a matching body 2. validating the headers Does this mean it is not validating the status code( like whether its 200 or not ) of the response , Can we output the logs when the validation is successful which we don?t do right now

matt.fellows
2020-05-10 23:57
hmm that doesn?t look right to me

matt.fellows
2020-05-11 00:02
I?ll check the example output in the project, it should definitely show all assertions, including status codes

bheemreddy181
2020-05-11 00:08
when you pactflow does that mean we should use broker instance of pact flow ?

matt.fellows
2020-05-11 00:09
Correct, if you?re self hosting a broker it won?t yet work

bheemreddy181
2020-05-11 00:10
hmmm :disappointed: is there any other way we can achieve this with self hosted broker ? this will not work even with a local pact ?

matt.fellows
2020-05-11 00:11
local pact?

matt.fellows
2020-05-11 00:11
Not yet I?m afraid. Let me find the public issue/feature request

matt.fellows
2020-05-11 01:17
@bheemreddy181 https://pact.canny.io/feature-requests/p/pending-pacts-prevent-consumers-being-able-to-break-provider-builds-with-changed. Apologies it wasn?t clear earlier. People seemed to know about the pending/WIP pacts but from other sources so assumed everyone knew we were rolling it out slowly

bheemreddy181
2020-05-11 01:23
Thanks for supporting and maintaining the open source version. By when in general I can expect this feature I assumed so it is available and we planned things accordingly but ya have to change those now

matt.fellows
2020-05-11 01:29
Thanks Bheem

matt.fellows
2020-05-11 01:30
I?m not sure I understand the question. Is there a few parts - when will it be generally available? I can?t answer that yet, but once we have fully support across languages and we?ve ironed out any basic kinks, we?ll roll it into the OSS broker for broad consumption

matt.fellows
2020-05-11 01:31
This might be a month or so, but can?t say for sure. We roll things out to Pactflow first, because we can see logs, diagnose issues faster etc.

bheemreddy181
2020-05-11 03:50
Makes sense you answered it :)

matt.fellows
2020-05-11 04:20
All that being said - please feel free to comment on the issue above. Feedback is helpful

matt.fellows
2020-05-11 04:20
welcome to signup to a free dev account and put test data in their if you?d like to prove out the workflow ahead of time

matt.fellows
2020-05-12 01:07
@bheemreddy181 you can enable wip/pending

matt.fellows
2020-05-12 01:07
using `PACT_BROKER_FEATURES=pacts_for_verification` env var

bheemreddy181
2020-05-12 01:07
Ah with the current version of pact_go ?

matt.fellows
2020-05-12 01:08
yep, should work

bheemreddy181
2020-05-12 01:08
oh cool will give a try

bheemreddy181
2020-05-12 01:08
Do we still need `enable_pending` ?

matt.fellows
2020-05-12 01:13
yes


bheemreddy181
2020-05-12 01:14
i mean the `PACT_BROKER_FEATURES` variable

bheemreddy181
2020-05-12 01:17
I tried passing that as a variable to my test command like this `PACT_BROKER_FEATURES=pacts_for_verification go test -tags=contract`

bheemreddy181
2020-05-12 01:17
that still didn?t help

bheemreddy181
2020-05-12 01:18
i am not sure if this is the correct way though

matt.fellows
2020-05-12 01:36
What version of the broker are you using?

matt.fellows
2020-05-12 01:36
Oh, it needs to be set _on the pact broker instance_

matt.fellows
2020-05-12 01:39
i.e. the pact broker process itself must have that environment variable set

bheemreddy181
2020-05-12 03:02
Ah got it will do that thanks :)

bheemreddy181
2020-05-13 03:55
this thing still didn?t work , i still see exit status `1` is there a way i can debug this

bheemreddy181
2020-05-13 04:00
And also i observed that tests run more than once when they fail is there a retry functionality in built for this by default if so any peculiar reason why it was built that way ?

matt.fellows
2020-05-13 04:01
There is no retry built into pact go

matt.fellows
2020-05-13 04:02
Can you please show me what you mean

bheemreddy181
2020-05-13 04:02
Ah weird i see the failed logs twice which i assumed tests are running twice

bheemreddy181
2020-05-13 04:05
Ya here are the logs

bheemreddy181
2020-05-13 04:05
```2020/05/12 22:53:50 [DEBUG] pact setup logging 2020/05/12 22:53:50 [DEBUG] pact setup 2020/05/12 22:53:50 [DEBUG] checking CLI compatability 2020/05/12 22:53:50 [INFO] checking pact-mock-service within range >= 3.5.0, < 4.0.0 2020/05/12 22:53:50 [DEBUG] running binary pact-mock-service 2020/05/12 22:53:50 API starting: port 61027 ([::]:61027) 2020/05/12 22:53:51 [DEBUG] checking version for binary pact-mock-service version 3.6.1 2020/05/12 22:53:51 [DEBUG] checking if version 3.6.1 within semver range >= 3.5.0, < 4.0.0 2020/05/12 22:53:51 [DEBUG] 3.6.1 satisfies constraints 3.6.1 >= 3.5.0, < 4.0.0 2020/05/12 22:53:51 [INFO] checking pact-provider-verifier within range >= 1.30.0, < 2.0.0 2020/05/12 22:53:51 [DEBUG] running binary pact-provider-verifier 2020/05/12 22:53:52 [DEBUG] checking version for binary pact-provider-verifier version 1.30.1 2020/05/12 22:53:52 [DEBUG] checking if version 1.30.1 within semver range >= 1.30.0, < 2.0.0 2020/05/12 22:53:52 [DEBUG] 1.30.1 satisfies constraints 1.30.1 >= 1.30.0, < 2.0.0 2020/05/12 22:53:52 [INFO] checking pact-broker within range >= 1.22.3 2020/05/12 22:53:52 [DEBUG] running binary pact-broker 2020/05/12 22:53:52 [DEBUG] checking version for binary pact-broker version 1.26.0 2020/05/12 22:53:52 [DEBUG] checking if version 1.26.0 within semver range >= 1.22.3 2020/05/12 22:53:52 [DEBUG] 1.26.0 satisfies constraints 1.26.0 >= 1.22.3 2020/05/12 22:53:52 [DEBUG] setting up a service manager 2020/05/12 22:53:52 [DEBUG] setting up a service manager 2020/05/12 22:53:52 [DEBUG] starting service removal monitor 2020/05/12 22:53:52 [DEBUG] starting service creation monitor 2020/05/12 22:53:52 [DEBUG] setting up a service manager 2020/05/12 22:53:52 [DEBUG] starting service creation monitor 2020/05/12 22:53:52 [DEBUG] starting service removal monitor 2020/05/12 22:53:52 [DEBUG] setting up a service manager 2020/05/12 22:53:52 [DEBUG] starting service creation monitor 2020/05/12 22:53:52 [DEBUG] starting service removal monitor 2020/05/12 22:53:52 [DEBUG] starting service creation monitor 2020/05/12 22:53:52 [DEBUG] starting service removal monitor 2020/05/12 22:53:52 [DEBUG] starting new proxy with opts {http 127.0.0.1:61027 0 [0x4715270 0x4715790 0x47831c0] /__setup <nil>} 2020/05/12 22:53:52 [DEBUG] starting reverse proxy on port 61041 2020/05/12 22:53:52 [DEBUG] waiting for port 61041 to become available 2020/05/12 22:53:52 [DEBUG] pact provider verification 2020/05/12 22:53:52 [DEBUG] client: verifying a provider 2020/05/12 22:53:52 [DEBUG] waiting for port 61041 to become available 2020/05/12 22:53:52 [DEBUG] starting verification service with args: [/Users/bvennapureddy/8b/apps/portfolio/spec/pacts/brazil_portal-datacompliance.json --format json --provider-base-url http://localhost:61041 --provider-states-setup-url http://localhost:61041/__setup --pact-broker-base-url http://pact-broker-poc.dev.com --provider_app_version 1.0.0 --provider data --enable-pending] 2020/05/12 22:53:53 [WARN] state handler not found for state: creating a session 2020/05/12 22:53:53 [DEBUG] skipping state handler for request /sessions 2020/05/12 22:53:53 [DEBUG] http reverse proxy received connection from [::1]:61048 on path /sessions 2020/05/12 22:53:53 [DEBUG] setting proxy to target 2020/05/12 22:53:53 [DEBUG] incoming request /sessions 2020/05/12 22:53:53 [DEBUG] outgoing request http://127.0.0.1:61027/sessions (/Users/bvennapureddy/datacompliance/session_handler.go:89) [2020-05-12 22:53:53] pq: value too long for type character varying(2) (/Users/bvennapureddy/datacompliance/session_handler.go:89) [2020-05-12 22:53:53] pq: value too long for type character varying(2) 2020/05/12 22:53:53 [DEBUG] executing after hook 2020/05/12 22:53:53 [DEBUG] teardown 2020/05/12 22:53:53 [DEBUG] skipping state handler for request /public-api/requests 2020/05/12 22:53:53 [DEBUG] http reverse proxy received connection from [::1]:61053 on path /public-api/requests 2020/05/12 22:53:53 [DEBUG] setting proxy to target 2020/05/12 22:53:53 [DEBUG] incoming request /public-api/requests 2020/05/12 22:53:53 [DEBUG] outgoing request http://127.0.0.1:61027/public-api/requests 2020/05/12 22:53:53 [DEBUG] executing after hook 2020/05/12 22:53:53 [DEBUG] teardown 2020/05/12 22:53:53 [WARN] state handler not found for state: creating a session 2020/05/12 22:53:53 [DEBUG] skipping state handler for request /sessions 2020/05/12 22:53:53 [DEBUG] http reverse proxy received connection from [::1]:61056 on path /sessions 2020/05/12 22:53:53 [DEBUG] setting proxy to target 2020/05/12 22:53:53 [DEBUG] incoming request /sessions 2020/05/12 22:53:53 [DEBUG] outgoing request http://127.0.0.1:61027/sessions (/Users/bvennapureddy/datacompliance/session_handler.go:89) [2020-05-12 22:53:53] pq: value too long for type character varying(2) (/Users/bvennapureddy/datacompliance/session_handler.go:89) [2020-05-12 22:53:53] pq: value too long for type character varying(2) 2020/05/12 22:53:53 [DEBUG] executing after hook 2020/05/12 22:53:53 [DEBUG] teardown 2020/05/12 22:53:53 [DEBUG] skipping state handler for request /public-api/requests 2020/05/12 22:53:53 [DEBUG] http reverse proxy received connection from [::1]:61059 on path /public-api/requests 2020/05/12 22:53:53 [DEBUG] setting proxy to target 2020/05/12 22:53:53 [DEBUG] incoming request /public-api/requests 2020/05/12 22:53:53 [DEBUG] outgoing request http://127.0.0.1:61027/public-api/requests 2020/05/12 22:53:53 [DEBUG] executing after hook 2020/05/12 22:53:53 [DEBUG] teardown```

matt.fellows
2020-05-13 04:28
What makes you think it's repeating?

matt.fellows
2020-05-13 04:30
Print verbose pact output from go. It will tell you if the server is able to support the pending pacts feature

matt.fellows
2020-05-13 04:31
Also, I think the server (broker) will print a notice but can't verify. I'll check when back at my desk later

matt.fellows
2020-05-13 04:31
Are you running the latest server version?

bheemreddy181
2020-05-13 04:41
I think so , I can check that will let you know tomorrow

bheemreddy181
2020-05-13 04:43
Will i see the request twice out there I had more logs which also prints ther errors twice and there is a dB check which is failing for one request and that?s printed twice too all this routed me there

matt.fellows
2020-05-13 04:59
Can you share the pact file?

matt.fellows
2020-05-13 04:59
Or the test

matt.fellows
2020-05-13 05:04
I'm wondering if it's because you've provided a broker option and a local option if it's reading both. The output should show this in the tests results, can you please share the full log output including test results?

matt.fellows
2020-05-13 05:04
It should say which pacts it's reading and from where

bheemreddy181
2020-05-13 11:13
Sure Matt I will check that

bheemreddy181
2020-05-13 12:28
this is working as expected , once i pulled that latest broker. thanks

matt.fellows
2020-05-13 12:57
Just a general note Bheem - new features generally require newer versions of software :wink:

bheemreddy181
2020-05-13 14:00
yes true , i agree :slightly_smiling_face:

bheemreddy181
2020-05-13 14:00
is there a way we can emit failure logs with pending flag ?

bheemreddy181
2020-05-13 14:07
it was reading from broker alone and for only failures they are running twice not sure how else i can explain this

bheemreddy181
2020-05-13 14:12
Usecase : for people running these tests on the bare metal or even for the tests running on CI , rather than visiting the broker it would be great if we can emit the logs for understanding what is not implemented or what is failing for which API

matt.fellows
2020-05-14 23:27
The output should contain these failures already one way or another, you could use those

bheemreddy181
2020-05-15 14:50
One more observation from my testing , when ever the broker is not reachable verification job emits logs saying `pact.go:413: No pacts found to verifify. Check the tags provided (master) for your broker` which seems little odd for investigation - rather can we emit logs saying `connection refused or couldn't connect`

bheemreddy181
2020-05-15 14:51
i didn?t really get you

matt.fellows
2020-05-16 00:25
Thanks Bheem that's not ideal. You can't fail on no pacts found but a dead broker should error

matt.fellows
2020-05-16 00:25
I'll make a reminder to follow this up Monday

dan.h.lee329
2020-05-18 23:47
@matt.fellows I haven't forgotten about this item, I'll plan to get to this sometime this week, thanks!

dan.h.lee329
2020-05-18 23:47
Yepp, that's my account

matt.fellows
2020-05-19 00:12
Thanks!

sankalan13
2020-05-22 08:57
has joined #pact-go

sankalan13
2020-05-22 09:11
Hey @matt.fellows I was going through the workshop for pact-go and I am unable to run any commands via the `make` command like `make unit` and `make consumer`. I keep getting the following error. ```make: "/bin/bash": Command not found make: *** [Makefile:4: install] Error 127``` This might be a very trivial question. Sorry for my ignorance but I wasn't able to find anything in the internet. I installed build-essentials as I am running the latest Ubuntu. I am not sure what is going wrong.

matt.fellows
2020-05-22 09:52
Is bash installed?

sankalan13
2020-05-22 09:56
Yes it is

sankalan13
2020-05-22 09:57
If I run the go commands defined in the Makefile manually, the commands run but some comands exit with a panic state.

matt.fellows
2020-05-22 10:07
Are you using docker? If you could pop an issue against the repo with your docker image that's enough for me to find/fix. It's only been tested on a Mac, so it's possible it doesn't work on Linux. I might add a Travis build for each step

matt.fellows
2020-05-22 11:29
Also, can you try please removing the `SHELL` variable in the `http://config.mk` file

matt.fellows
2020-05-22 11:30
```# SHELL = "/bin/bash"``` It actually should work without that, and it may cause issues

sankalan13
2020-05-22 13:16
I am not using docker. I will go through the workshop and pop an issue when I find it!

sankalan13
2020-05-22 13:16
Yep that was the problem! Thanks Matt!!

dom.udall
2020-05-22 13:33
has joined #pact-go

matt.fellows
2020-05-22 13:40
Would you mind raising an issue? I'll fix it

sankalan13
2020-05-22 14:20
Okay will do!

sairsule
2020-05-25 06:29
has joined #pact-go

sairsule
2020-05-27 15:53
Hi All, are there any examples of message-driven pacts tests in GO?

dom.udall
2020-05-27 15:58
Hey, there's an example in the pact-go repo with some good supporting docs, though I haven't tried it myself yet! https://github.com/pact-foundation/pact-go/tree/master/examples/messages

sairsule
2020-05-27 16:01
thanks, I'll checkout

morten.hekkvang
2020-06-02 07:59
Hi! Just wondering why the go implementation relies on the ruby-standalone version of pact? I would much rather see a pure golang module for this. The reason I think like this is that a lot of CI/CD implementations would require the user to install and properly config both ruby and go before being able to build and run the test suite. An alternative would be to compile the ruby-standalone into a shared object library and use that. Instead of relying on having ruby installed correctly on the machines.

ramfjordm
2020-06-02 08:00
has joined #pact-go

matt.fellows
2020-06-02 09:47
You don't need Ruby installed on the machine

matt.fellows
2020-06-02 09:47
Or are you just referring to the standalone?

matt.fellows
2020-06-02 09:47
Either way you have to download a dependency.

matt.fellows
2020-06-02 09:47
I'm also working on integrating to a that shared binary which is the long term objective

matt.fellows
2020-06-02 09:53
So just in case it's not clear. Any CI runtime does not require Ruby to run Pact (albeit a pure implementation would be ideal). We need to publish updated info on our strategy, but pact is very very complex now and having 12 languages implement all of the features and capabilities is a tall ask. So we've moved to a shared engine to do it. Ruby was the old, rust is the new

bheemreddy181
2020-06-03 01:37
probably i missed followup on this i didn?t really understand what you mean?t by ```The output should contain these failures already one way or another, you could use those``` you mean as they already show up on pact broker we should look at broker rather than the CI itself

matt.fellows
2020-06-03 01:38
I mean the output of `go test ?` type thing. Any failures will be in there

ramfjordm
2020-06-04 11:11
Hello, I am struggling to pull down and verify pacts from my self-hosted broker. I followed the examples on https://github.com/pact-foundation/pact-go and the following works when I use a local broker running on my machine: ```pact.VerifyProvider(t, types.VerifyRequest{ BrokerURL: "http://localhost:9292", ProviderVersion: "1.0.0", ProviderBaseURL: "https://provider-base-url", RequestFilter: fixBearerToken, })``` Setting "PublishVerificationResults: true" works as well using the local broker. But it fails if I use the self-hosted broker: ```pact.VerifyProvider(t, types.VerifyRequest{ BrokerURL: "https://self-hosted-broker-url", ProviderVersion: "1.0.0", ProviderBaseURL: "https://provider-base-url", RequestFilter: fixBearerToken })``` Using the self-hosted broker I just get an error saying "No pacts found to verify", although the same pact has been published to both brokers. Not sure where to go from here. I cannot find any relevant logs for the self-hosted broker. Any help would be appreciated :slightly_smiling_face:

matt.fellows
2020-06-04 12:38
Is the self hosted broker using a self signed certificate?

matt.fellows
2020-06-04 12:39
To connect to a Pact Broker that uses custom SSL cerificates, set the environment variable $SSL_CERT_FILE or $SSL_CERT_DIR to a path that contains the appropriate certificate

ramfjordm
2020-06-04 13:16
The self hosted broker is using a certificate signed by Entrust. It is running in GKE and nginx though, so I'm starting to wonder if adding these headers mentioned here would help - at least I'll give it a try: https://github.com/pact-foundation/pact_broker/wiki/Configuration#running-the-broker-behind-a-reverse-proxy

matt.fellows
2020-06-04 22:49
Golang aside, can you login to the broker and poke around?

ramfjordm
2020-06-05 06:41
Yes, I can view the pacticipants/pacts/matrix etc, but the API browser does not work properly. None of the endpoints are displayed there. Not sure how relevant it is, but I see this error in the console in Chrome when I open the API browser: ```Uncaught TypeError: HAL.normalizeUrl is not a function at eval (eval at _.template (underscore.js:1157), <anonymous>:58:13) at Function._.each._.forEach (underscore.js:87) at child.eval (eval at _.template (underscore.js:1157), <anonymous>:6:4) at child.template (underscore.js:1165) at child.render (links.js:52) at child.render (resource.js:28) at Object.<anonymous> (resource.js:8) at triggerEvents (backbone.js:96) at Object.trigger (backbone.js:181) at Object.success (client.js:13)```

matt.fellows
2020-06-05 07:04
interesting

matt.fellows
2020-06-05 07:04
that seems like JS isn?t being loaded properly, which indicates a configuration issue

matt.fellows
2020-06-05 07:05
if you were to curl the `/` endpoint on your broker, sharing the hostname you hit and the results that might help (DM me if you like)

bheemreddy181
2020-06-05 16:16
So one of our contracts only looks for a 200 status and doesn?t care about the response but in cases where we get a 400 response doesn?t user needs to know why there is a 400 what is missing ? pact tests only tell you expected 200 and you got a 400 thats all

matt.fellows
2020-06-06 01:26
It's an interesting point, there may be more detail on your app logs, but having more context would be helpful

bheemreddy181
2020-06-06 22:01
Yes looking for more context for such cases

matt.fellows
2020-06-07 00:11
Usually with a failed test, you would print out context of the API responses anyway. Do you not log what your API is doing in those cases?

bheemreddy181
2020-06-07 19:46
i assume we do i am still looking into this why we are not seeing logs from applications side.

bheemreddy181
2020-06-08 22:48
Question : Is there a way we can re-use statehandlers between two different states in PACT go ?

matt.fellows
2020-06-08 23:34
Of course, a state handler is just a function

matt.fellows
2020-06-09 00:44
@bheemreddy181 FYI if you set log level to `TRACE` you will get full request/response logging.

matt.fellows
2020-06-09 00:45
That should help you diagnose why you are getting `400` when you expect `200`

sairsule
2020-06-09 11:50
example here doesn't work .https://github.com/pact-foundation/pact-go/tree/master/examples/messages. I get following error ``` FAIL: TestExampleMessageConsumer_UserExists (5.45s) pact.go:762: VerifyMessageConsumer failed: error creating message: exit status 255 STDERR: 'controller' is not recognized as an internal or external command, operable program or batch file.```

matt.fellows
2020-06-09 13:42
Are you on windows?

matt.fellows
2020-06-09 13:42
It is run as part of our ci so it at least works there

bheemreddy181
2020-06-09 14:50
My question was more like clubbing two states like below ```"User jmarie exists","User jmarie is unauthenticated": func() error { userRepository = jmarieExists return nil },```

bheemreddy181
2020-06-09 14:51
like a comma separated ones

sairsule
2020-06-09 15:12
yes, I am on windows.

sairsule
2020-06-09 15:20
whats different on windows? and how shall I get it work on windows?

bheemreddy181
2020-06-09 15:48
this does but it doesn?t show if any error json response is returned

matt.fellows
2020-06-09 23:32
Thanks for clarifying

matt.fellows
2020-06-09 23:32
there shouldn?t be, it should ?just work? but looks like there might be an issue

matt.fellows
2020-06-09 23:32
I?ll take a look today

matt.fellows
2020-06-09 23:35
```state1 := func() error { ... } "User jmarie exists": state1, "User jmarie is unauthenticated": state1,```

matt.fellows
2020-06-09 23:36
I?d just do that

matt.fellows
2020-06-09 23:36
so short answer is no

sairsule
2020-06-10 08:58
format of my message is ```{ "foo":{ "bar":"baz", } "name": "test", }``` its not the map[string]interface{} format, like in example. how can I use this?

matt.fellows
2020-06-10 09:28
I'm unsure of your problem, sorry. It is of type map[string] interface {}

matt.fellows
2020-06-10 09:28
Can you share your test that you're trying to get it into?

matt.fellows
2020-06-10 09:30
If there is a type for that you can use tags on the fields (see docs)

sairsule
2020-06-11 04:43
Thanks @matt.fellows, I realised my mistake. It had to do with adding map[string]interface{} for inner object too. something like ```WithContent(map[string]interface{}{ "id": like(127), "name": "Baz", "address": map[string]interface{}{ "city": "pune", "zip": "411045", }, }). AsType(&User{})```

sairsule
2020-06-11 08:18
When pact.json file is not provider-test still return "ok". How can we make sure weather tests were "ok" or its returning "ok" because pact file is not found?

zbintliff
2020-06-11 21:02
has joined #pact-go

zbintliff
2020-06-11 21:03
Hey all, its been a really long time since we gave our pact some TLC. We are version 0.0.12 and looking to upgrade to latest and great. Happy to shed the ruby daemon too! I thought I saw an upgrade doc somewhere but can't seem to find it. Does anyone have a link?

matt.fellows
2020-06-11 22:29
Hey - welcome back!

matt.fellows
2020-06-12 02:22
There is no guide, but the API should be pretty similar to before. There is at least one deprecated field (`Verbose`) but I don?t think we removed any stable APIs

matt.fellows
2020-06-12 02:22
The big difference is that you now need to install the CLI tools manually, and then you can do the usual `go get` , using mod etc.

zbintliff
2020-06-12 12:57
Ok cool. We have a crazy docker compose set up that has ruby and the deamon in it. Super excited to slim down that container

zbintliff
2020-06-12 12:58
The one thing I get is "Port" is not there any more bu twill dig in and see if i can actually do anything other than speculate :slightly_smiling_face:

zbintliff
2020-06-12 18:42
Lots of breaking changes. All the matcher requests now take custom dsl types instead of just string and map (for headers)

zbintliff
2020-06-12 18:42
not huge deal just a lot of small changes that are hard to sed

zbintliff
2020-06-12 18:59
Hmm i seem to be confused. I thought the big change for version 0.0.12 to 1.0.0 is that we no longer rely on ruby.

zbintliff
2020-06-12 19:00
The installation instructions are unclear. It says : > See below for how to automate this: Is that onlyk referring to the step3 ? on installation? Do we still need the cli tools separately?

zbintliff
2020-06-12 20:34
WOw i just found the autogeneration. That is _awesome_ and I want to use it. IS there a way though to isolate it per request? For example, the DTO's fields may change per request (i.e. we expect a slice of size 0 in one request and size >= 1 in another)

zbintliff
2020-06-12 20:36
Is something like that possible? We have massive payloads and the old version (0.0.12) was string based and new version iss struct based (i.e. sprintf("%", dsl.EachLike)) and converting our iant json payloads to `map[string]interface` doesnt seem appealing to me. so would love a way to auto gen as much as possible

zbintliff
2020-06-12 20:46
BTW :point_up: is super dope and saved me a ton of time

zbintliff
2020-06-12 20:50
Ths is my only concern now but honestly all of our returns are objects, i'm happy to make "dummy" ones with proper values on sizes per request

zbintliff
2020-06-12 22:29
I answered this myself. Yes! I got it all working in a `strech-slim` docker container

matt.fellows
2020-06-13 08:47
Thanks for all of this feedback Zach. I'll make a reminder to read thru all of it and address it. Thanks so much!

matt.fellows
2020-06-13 09:09
Ruby will be removed in next major version. The big change here was removing the daemon because people hated it. It still needs the standalone

matt.fellows
2020-06-13 09:09
But in case it's not clear. You didn't, and still don't, need to install Ruby to run Pact. We always bundled a runtime

matt.fellows
2020-06-13 09:10
Obviously those doc's aren't clear enough. I'll fix that thx

matt.fellows
2020-06-13 09:11
It's a good idea. Any thoughts on how to do so nicely? I don't want the tags to he overly complicated. They are ultimately probably going to link to a provider state so that could be an approach

matt.fellows
2020-06-13 09:12
Perhaps point to externalised data sources? E.g. a YAML/JSON file with all of the states and data variants?

matt.fellows
2020-06-13 09:12
Sorry which part are you referring to?

zbintliff
2020-06-15 02:32
> They are ultimately probably going to link to a provider state so that could be an approach Not a bad idea. I think i can minimize the number of objects will report back

zbintliff
2020-06-15 02:33
The auto generation part. Haven't fully proofed it out but its _really_ nice.

zbintliff
2020-06-15 02:33
Sorry for the word vommit. The lib is in an awesome place btw the new features are _really_ nice

matt.fellows
2020-06-15 03:40
oh yeah, we can thank one of the Alex?s for that contribution

matt.fellows
2020-06-15 03:40
thanks, that?s awesome to hear!

matt.fellows
2020-06-15 03:40
I won?t make you upset by saying _literally_ this week, I have restarted the PoC to remove the Ruby stuff

matt.fellows
2020-06-15 03:42
My goal is to preserve as much of the 1.x.x API as possible, but there are some clunky things in the API I?d really like to address. There is implementation code, and the ergonomics of the public facing API. It will take some time to get to a v2.x.x anyway (so don?t be too worried about that upgrade)

matt.fellows
2020-06-15 03:42
If you?re keen to get your hands on early draft, let me know - i?ll post here anyway

zbintliff
2020-06-15 21:06
Happy monday! Back with more questions. I found that in the autogeneration if the struct has a field that is a pointer and has omit empty tag the `min=1` tag is ignored. For example: ```type Example struct { FeldOne []*string `json:"fieldOne,omitempty" pact:"min=1"` }``` My tests were failing because the field was nil. When i removed the `omitempty` it seemed to work. I was digging through code it _seems_ like it's because it relies heavily on `json.Marshal` . I don't think this is a bug, but wanted to verify the behavior. I can also 100% open a GH issue. I'm not sure where the best place to interact on things like this.

bernardoguerr
2020-06-18 18:07
has joined #pact-go

bheemreddy181
2020-06-23 01:43
Is there good documentation for contract testing Go lambdas?

matt.fellows
2020-06-23 11:34
Not that I?m aware of. Is there a particular issue you?re having?

matt.fellows
2020-06-23 11:34
Is it a direct lambda invocation? Is it at the end of a queue? is it used in an HTTP context? You can see how writing a guide for this could be difficult, because lambda is just one of the runtimes

bheemreddy181
2020-06-23 17:00
makes sense

matt.fellows
2020-06-23 21:39
But what issues are you having? Happy to help!

matt.fellows
2020-06-30 06:45
Sorry Zach, I somehow missed this

matt.fellows
2020-06-30 06:46
Somebody raised a PR related to this today - https://github.com/pact-foundation/pact-go/issues/140. I?ll look into it later in the week, but thought I?d get it in front of you in case it?s helpful

jonathan-pact
2020-06-30 07:00
has joined #pact-go

oscar821210
2020-07-21 04:50
has joined #pact-go

abdul.hussain
2020-07-21 15:31
has joined #pact-go

abdul.hussain
2020-07-21 15:37
Should pacts tests sit alongside unit tests (my gin api handler unit tests are under `pkg/api/v1/..` ) or alongside integration tests at the top level?

matt.fellows
2020-07-22 00:24
On the consumer side, I would have them sit as a unit test

matt.fellows
2020-07-22 00:24
on the provider side it?s up to you. I usually run them as unit tests, because often you?re going to stub out a layer that requires access to code (e.g. you might stub out your repository etc.)

david025
2020-07-28 15:07
has joined #pact-go

damianattademo
2020-08-19 01:48
has joined #pact-go

alexfdz
2020-08-19 13:18
has joined #pact-go

heytaco
2020-08-25 03:57
has joined #pact-go

heytaco
2020-08-25 03:57
Hi there! My name is HeyTaco!, and you can use me to give people tacos to show your appreciation. My tacos will spread joy through Slack!

mark.doppelfeld
2020-09-30 07:44
has joined #pact-go

nazar.khmil
2020-10-05 10:34
has joined #pact-go

xandebianchi
2020-10-05 13:05
has joined #pact-go

dorin.enache
2020-10-05 15:01
has joined #pact-go

ledinhcuong99
2020-10-06 12:53
has joined #pact-go

dothetan.040490
2020-10-07 09:14
has joined #pact-go

dagostino.remy
2020-10-07 23:03
has joined #pact-go

dothetan.040490
2020-10-08 04:05
Hi everyone, I got a problem that cannot download pact from pactflow for provider test. I attached configuration screenshot. Please help me to solve this problem.

matt.fellows
2020-10-08 04:11
It's saying there are no pacts to verify because it can't find any in the broker. have you published pacts to the broker already and if so what tags have you used?

matt.fellows
2020-10-08 04:11
See howtolearn for a ci/cd workshop that goes thru this and the docs on tags

2020-10-08 04:11
Here are a number of useful hands-on labs that teach all of the key concepts https://docs.pact.io/implementation_guides/workshops

dothetan.040490
2020-10-08 04:28
I have published to pactflow already.

dothetan.040490
2020-10-08 04:28
I checked the version or even tags are correct.

matt.fellows
2020-10-08 05:11
Can you please share the tags you have published and/or screenshot of the pact you're expecting to verify? Also your provider is not currently specifying any tags. Can you please set loglevel to debug and share the output?

dothetan.040490
2020-10-08 05:37
Here is the published pact that I'm try to verify, and the log when execute provider test (I added tags in pact verify configuration) ```=== RUN TestPactProvider Come here 2020/10/08 12:30:19 [DEBUG] pact setup logging 2020/10/08 12:30:19 [DEBUG] pact setup 2020/10/08 12:30:19 [DEBUG] setting up a service manager 2020/10/08 12:30:19 [DEBUG] setting up a service manager 2020/10/08 12:30:19 [DEBUG] setting up a service manager 2020/10/08 12:30:19 [DEBUG] setting up a service manager 2020/10/08 12:30:19 [DEBUG] starting service creation monitor 2020/10/08 12:30:19 [DEBUG] starting service removal monitor 2020/10/08 12:30:19 [DEBUG] starting service creation monitor 2020/10/08 12:30:19 [DEBUG] starting service removal monitor 2020/10/08 12:30:19 [DEBUG] starting service removal monitor 2020/10/08 12:30:19 [DEBUG] starting service creation monitor 2020/10/08 12:30:19 [DEBUG] starting service creation monitor 2020/10/08 12:30:19 [DEBUG] starting service removal monitor 2020/10/08 12:30:19 [DEBUG] starting new proxy with opts {http 127.0.0.1:59744 0 [] /__setup } 2020/10/08 12:30:19 [DEBUG] starting reverse proxy on port 59746 2020/10/08 12:30:19 [DEBUG] waiting for port 59746 to become available on localhost after 10s 2020/10/08 12:30:19 [DEBUG] pact provider verification 2020/10/08 12:30:19 [DEBUG] client: verifying a provider 2020/10/08 12:30:19 [DEBUG] waiting for port 59746 to become available on localhost after 10s 2020/10/08 12:30:19 [DEBUG] starting verification service with args: [--format json --provider-base-url http://localhost:59746 --pact-broker-base-url https://VALID-DOMAIN.pactflow.io --broker-token {VALID_TOKEN} --provider_app_version 1.0-SNAPSHOT --provider Our Provider - edited --publish_verification_results true --consumer-version-tag master] pact.go:413: No pacts found to verify. Check the tags provided (master) for your broker (https://VALID-DOMAIN.pactflow.io) are correct --- FAIL: TestPactProvider (1.15s)```

marko.justinek
2020-10-08 05:38
so `VALID-DOMAIN` is valid?

dothetan.040490
2020-10-08 05:38
yes, I just hide it

dothetan.040490
2020-10-08 05:39
```=== RUN TestPactProvider Come here 2020/10/08 12:37:28 [DEBUG] pact setup logging 2020/10/08 12:37:28 [DEBUG] pact setup 2020/10/08 12:37:28 [DEBUG] setting up a service manager 2020/10/08 12:37:28 [DEBUG] setting up a service manager 2020/10/08 12:37:28 [DEBUG] setting up a service manager 2020/10/08 12:37:28 [DEBUG] setting up a service manager 2020/10/08 12:37:28 [DEBUG] starting service creation monitor 2020/10/08 12:37:28 [DEBUG] starting service removal monitor 2020/10/08 12:37:28 [DEBUG] starting service removal monitor 2020/10/08 12:37:28 [DEBUG] starting service removal monitor 2020/10/08 12:37:28 [DEBUG] starting service creation monitor 2020/10/08 12:37:28 [DEBUG] starting service creation monitor 2020/10/08 12:37:28 [DEBUG] starting service creation monitor 2020/10/08 12:37:28 [DEBUG] starting service removal monitor 2020/10/08 12:37:28 [DEBUG] starting new proxy with opts {http 127.0.0.1:59970 0 [] /__setup <nil>} 2020/10/08 12:37:28 [DEBUG] starting reverse proxy on port 59972 2020/10/08 12:37:28 [DEBUG] waiting for port 59972 to become available on localhost after 10s 2020/10/08 12:37:28 [DEBUG] pact provider verification 2020/10/08 12:37:28 [DEBUG] client: verifying a provider 2020/10/08 12:37:28 [DEBUG] waiting for port 59972 to become available on localhost after 10s 2020/10/08 12:37:28 [DEBUG] starting verification service with args: [--format json --provider-base-url http://localhost:59972 --pact-broker-base-url https://VALID_DOMAIN.pactflow.io --broker-token {VALID_TOKEN} --provider_app_version 1.0-SNAPSHOT --provider Our Provider - edited --publish_verification_results true] pact.go:413: No pacts found to verify --- FAIL: TestPactProvider (0.95s)``` here is the log without tags configuration.

abhi.nandan
2020-10-08 06:38
has joined #pact-go

matt.fellows
2020-10-08 12:23
OK, I hope it?s not the case - but could you please remove all spaces from your provider name and see if that fixes it? If so, could you also please raise a bug?

matt.fellows
2020-10-08 12:23
I?m wondering if _that?s_ the issue

przemyslaw.dabrowski
2020-10-08 12:36
has joined #pact-go

emiliano.righi
2020-10-08 13:25
has joined #pact-go

cariaga.bh
2020-10-08 21:03
has joined #pact-go

campellcl
2020-10-09 00:06
has joined #pact-go

dothetan.040490
2020-10-09 02:45
```=== RUN TestPactProvider Come here 2020/10/09 09:41:58 [DEBUG] pact setup logging 2020/10/09 09:41:58 [DEBUG] pact setup 2020/10/09 09:41:58 [DEBUG] setting up a service manager 2020/10/09 09:41:58 [DEBUG] setting up a service manager 2020/10/09 09:41:58 [DEBUG] starting service creation monitor 2020/10/09 09:41:58 [DEBUG] starting service creation monitor 2020/10/09 09:41:58 [DEBUG] setting up a service manager 2020/10/09 09:41:58 [DEBUG] setting up a service manager 2020/10/09 09:41:58 [DEBUG] starting service creation monitor 2020/10/09 09:41:58 [DEBUG] starting service removal monitor 2020/10/09 09:41:58 [DEBUG] starting service removal monitor 2020/10/09 09:41:58 [DEBUG] starting service removal monitor 2020/10/09 09:41:58 [DEBUG] starting service removal monitor 2020/10/09 09:41:58 [DEBUG] starting service creation monitor 2020/10/09 09:41:58 [DEBUG] starting new proxy with opts {http 127.0.0.1:61568 0 [] /__setup } 2020/10/09 09:41:58 [DEBUG] starting reverse proxy on port 61570 2020/10/09 09:41:58 [DEBUG] waiting for port 61570 to become available on localhost after 10s 2020/10/09 09:41:58 [DEBUG] pact provider verification 2020/10/09 09:41:58 [DEBUG] client: verifying a provider 2020/10/09 09:41:58 [DEBUG] waiting for port 61570 to become available on localhost after 10s 2020/10/09 09:41:58 [DEBUG] starting verification service with args: [--format json --provider-base-url http://localhost:61570 --pact-broker-base-url https://VALID_DOMAIN.pactflow.io --broker-token VALID_TOKEN --provider_app_version 1.0-SNAPSHOT --provider sample_provider --publish_verification_results true] pact.go:413: No pacts found to verify --- FAIL: TestPactProvider (1.39s)``` I changed names of consumer & provider, but issue still occurs :disappointed:

matt.fellows
2020-10-09 02:56
Can you please re-share your code here? (as a code snippet preferably)

dothetan.040490
2020-10-09 02:58
here is the code ```// Configuration / Test Data var dir, _ = os.Getwd() var pactDir = fmt.Sprintf("%s/../../pacts", dir) var logDir = fmt.Sprintf("%s/log", dir) var port, _ = utils.GetFreePort() // The Provider verification func TestPactProvider(t *testing.T) { fmt.Println("Come here") //go startInstrumentedProvider(t) pact := dsl.Pact{ Provider: "Our Provider - edited", LogDir: logDir, PactDir: pactDir, DisableToolValidityCheck: true, LogLevel: "DEBUG", } // Verify the Provider - Tag-based Published Pacts for any known consumers _, err := pact.VerifyProvider(t, types.VerifyRequest{ ProviderBaseURL: fmt.Sprintf("http://127.0.0.1:%d", port), Tags: []string{"master"}, FailIfNoPactsFound: true, // Use this if you want to test without the Pact Broker // PactURLs: []string{filepath.FromSlash(fmt.Sprintf("%s/goadminservice-gouserservice.json", os.Getenv("PACT_DIR")))}, BrokerURL: "https://VALID_DOMAIN.pactflow.io", BrokerToken: "VALID_TOKEN", PublishVerificationResults: true, ProviderVersion: "1.0-SNAPSHOT", PactLogDir: logDir, Provider: "sample_provider", }) if err != nil { t.Fatal(err) } }```

matt.fellows
2020-10-09 03:03
OK, sorry for the pain

matt.fellows
2020-10-09 03:03
can you please execute the `pact-provider-verifier` binary directly with the args ```--format json --provider-base-url http://localhost:61570 --pact-broker-base-url https://VALID_DOMAIN.pactflow.io --broker-token VALID_TOKEN --provider_app_version 1.0-SNAPSHOT --provider sample_provider --publish_verification_results true --verbose```

matt.fellows
2020-10-09 03:03
obviously replacing your specific tokens

matt.fellows
2020-10-09 03:27
if you can DM me, I can also try and reproduce locally and check pactflow logs. lemme know

elenitsaa043
2020-10-09 10:00
has joined #pact-go

matt.fellows
2020-10-09 10:39
:wave:hey friends

adriangabrieloros
2020-10-09 11:05
has joined #pact-go

sh.ilgam_pact
2020-10-11 16:12
has joined #pact-go

anastasiia.bielik
2020-10-12 11:13
has joined #pact-go

deepika.krishnakumar
2020-10-12 15:03
has joined #pact-go

anbansal27
2020-10-12 23:02
has joined #pact-go

prabhakar.thippa
2020-10-13 04:58
has joined #pact-go

giadinhluong
2020-10-13 06:24
has joined #pact-go

pavank
2020-10-13 08:41
has joined #pact-go

stephane.meng
2020-10-13 09:06
has joined #pact-go

abirlal.bose
2020-10-13 09:45
has joined #pact-go

dothetan.040490
2020-10-14 05:19
I was successful to get contracts from pactflow in provider side. However, I just started 1 service, it depends on others. Thus, provider test was fail because of others services not started. What should I to solve the problem now? Should I start whole system or just start 1 service and mock all dependencies?

matt.fellows
2020-10-14 05:27
Have a look at http://docs.pact.io and search for ?downstream systems?, there?s a whole thing on it

dothetan.040490
2020-10-14 05:28
thank you @matt.fellows. I read it now.

mateusz.mrzyglod
2020-10-14 09:32
has joined #pact-go

cathleen.yuan
2020-10-14 11:16
has joined #pact-go

ramana.jaladurgam
2020-10-14 16:10
has joined #pact-go

alik.berezovsky
2020-10-14 18:38
has joined #pact-go

a.robecke
2020-10-14 19:24
has joined #pact-go

mikahchapman
2020-10-14 21:47
has joined #pact-go

hem_kec
2020-10-15 00:44
has joined #pact-go

marco.cordeiro
2020-10-15 10:54
has joined #pact-go

betty.he
2020-10-15 14:32
has joined #pact-go

tamer
2020-10-16 09:08
has joined #pact-go

mario.gioiosa
2020-10-16 18:57
has joined #pact-go

alik.berezovsky
2020-10-18 17:59
@alik.berezovsky has left the channel

lior.baber
2020-10-19 07:33
has joined #pact-go

jeffbdye
2020-10-19 17:10
has joined #pact-go

jace
2020-10-19 19:22
has joined #pact-go

almaak
2020-10-20 09:35
has joined #pact-go

andra.moraru
2020-10-20 14:13
has joined #pact-go

camila.coder91
2020-10-20 17:06
has joined #pact-go

julzelements
2020-10-21 05:25
has joined #pact-go

kapil.mathur
2020-10-21 06:40
has joined #pact-go

mark.hudson
2020-10-21 10:45
has joined #pact-go

cluu
2020-10-21 17:16
has joined #pact-go

camila.campos
2020-10-21 21:35
has joined #pact-go

longlevan
2020-10-22 09:15
has joined #pact-go

justin.garfield
2020-10-22 16:15
has joined #pact-go

guppy0356.nakira
2020-10-23 00:34
has joined #pact-go

ercalbwar
2020-10-24 19:24
has joined #pact-go

andrewshtamburg
2020-10-25 13:04
has joined #pact-go

siad.ardroumli
2020-10-25 18:16
has joined #pact-go

srikanthpmailid
2020-10-26 01:02
has joined #pact-go

greg.tyler
2020-10-26 12:22
has joined #pact-go

photesthesis_geospiza
2020-10-26 15:10
has joined #pact-go

jackbwheatley
2020-10-27 21:02
has joined #pact-go

carlosalmeida.xon
2020-10-27 22:06
has joined #pact-go

nasir.amin
2020-10-28 11:07
has joined #pact-go

jimish.shah.-nd
2020-10-28 11:26
has joined #pact-go

adam_figgins
2020-10-28 14:20
has joined #pact-go

aperdomobo
2020-10-28 15:42
has joined #pact-go

diazguerra2
2020-10-28 16:06
has joined #pact-go

xsamore
2020-10-28 19:52
has joined #pact-go

simon
2020-10-28 20:49
has joined #pact-go

ruben.cagnie
2020-10-29 01:24
has joined #pact-go

272939217
2020-10-29 05:33
has joined #pact-go

driloni92
2020-10-29 09:05
has joined #pact-go

pauloavra
2020-10-29 12:33
has joined #pact-go

jikogay728
2020-10-30 17:20
has joined #pact-go

blmlcu
2020-10-31 14:51
has joined #pact-go

jamescourtoy
2020-11-02 21:04
has joined #pact-go

telmo.ferreira.costa
2020-11-03 11:32
has joined #pact-go

sergii.kopovskyi
2020-11-03 12:35
has joined #pact-go

silverton.gimenes
2020-11-03 17:58
has joined #pact-go

colber16
2020-11-03 18:34
has joined #pact-go

cvoong
2020-11-03 18:55
has joined #pact-go

jamescourtoy
2020-11-05 17:16
:wave: I'm currently evaluating using Pact at my company. We're a Node (JS) and Go shop, primarily, and I work on a team focused on AuthN / AuthZ. I've found using Pact to be pretty painless so far, but I'm running into issues with provider state. Now, I _believe_ that most of my pain points can be solved with 3.0 support for multiple provider states, and have worked that out on the NodeJS side already; however, I'm struggling on the Go side. While using the external provider verification CLI tooling will work for verifying consumer contracts written from a JS consumer, I am not aware of a way to write Go consumer 3.0 Pact files. Is there a solution I'm not aware of for this, or is it on the near-term roadmap at all ? It's hard to determine what current priorities are for various features / languages...

matt.fellows
2020-11-07 03:45
So I?m currently working on pact v3 support (see https://github.com/pact-foundation/pact-go/issues/142) however the bad news is that things are still experimental. I?m aiming to have a beta by Q4 2020.

matt.fellows
2020-11-07 03:45
If it?s just the provider side you need, I may be able to prioritise that to unblock you

matt.fellows
2020-11-07 03:46
> Now, I _believe_ that most of my pain points can be solved with 3.0 support for multiple provider states This is usually worked around fairly easily. Could you please elaborate on why you think that will solve your issue? Multiple states is more of a convenience thing if any

pbobba
2020-11-09 23:03
has joined #pact-go

jun.li
2020-11-09 23:05
has joined #pact-go

douweicai
2020-11-10 04:11
has joined #pact-go

christian.huber
2020-11-10 09:20
has joined #pact-go

vuttithatkrongyot
2020-11-10 10:57
has joined #pact-go

jamescourtoy
2020-11-10 16:59
> If it?s just the provider side you need, I may be able to prioritise that to unblock you It's actually the consumer-side that I'm more interested in since it would allow me to generate 3.0 contracts from a Go consumer. With the external provider verifier CLI I could run the provider-side tests against a running set of images with provider state endpoints, but need a way to generate the contracts themselves. At our company we have a majority of Go services with a smattering of Node services, and several separate SPA UI's which are JS. Go is a big part of our path to adoption of Pact. At any rate, thanks for even considering prioritization! Having consumers generate 3.0 spec files would make it much easier for me to promote adoption of Pact as our company's contract testing standard :slightly_smiling_face: > Could you please elaborate on why you think that will solve your issue? Sure! It's entirely possible that I'm not thinking about things in the right way, or leveraging everything available in 2.0. In one case, we aggregate responses from various downstream services (API gateways & BFF's). During my spike, I found it increasingly difficult to use bespoke strings for every permutation that results in a different contract. For instance, we have a "team join" permissions endpoint which aggregates information from "invites", "open-enrollment", and other services in order to make a decision on what sort of UX we send a user through. Thinking about this now, though, I could think about this in terms of user flow which would result in fewer "states". I could see the multiple provider states as more of a convenience here so that we could share them across interactions. In another case, we actually have an intermediary "edge" which is mostly invisible to providers, but provides headers which are necessary. A good example of this is with authorized sessions. The edge gateway is responsible for verifying any individual request's headers and adding user identity headers to a request. From the consumer's perspective, this data is typically sent in the form of a cookie which then translates to a valid user ID in the edge gateway headers that the provider consumes. I've dealt with this case by introducing a special header state in the Pact file such as "a valid session exists for the current user". The provider verification step can then translate that into the expected edge headers. However, now I'm stuck duplicating this in every interaction ? varying it periodically to deal with "session invalid" status codes.

jamescourtoy
2020-11-10 17:00
Apologies for the wall of text @matt.fellows , but I hope that gives you better context.

dan.iosif
2020-11-10 17:06
has joined #pact-go

rodrigo.costa20
2020-11-12 00:59
has joined #pact-go

matt.fellows
2020-11-12 03:43
no worries at all. I somehow missed your response too

matt.fellows
2020-11-12 03:52
I?ve just taken a look at the Pact Go code

matt.fellows
2020-11-12 03:53
Technically, message pacts is a v3 thing - so the current Go package does sort of support this. I need to confirm that multiple states will propagate for (1) (I think they will). The next issue is verifying on the provider side, which is JS (also not fully v3 compatible yet, or rather, we haven?t added support for messages in the v3 branch).

matt.fellows
2020-11-12 03:54
It may be the case that the current implementation will actually invoke all of the provider states, in which case, we can get that fairly quickly into the current ecosystem

matt.fellows
2020-11-12 03:54
Otherwise, even if I get the Go consumer code updated for you, you?ll still suffer from needing to actually _verify_ it in JS!

matt.fellows
2020-11-12 03:54
Leave it with me, i?ll look into it tonight

yong.gong188
2020-11-12 09:13
has joined #pact-go

anandhadeepak
2020-11-12 13:03
has joined #pact-go

david.dias
2020-11-12 20:04
has joined #pact-go

david.dias
2020-11-12 20:12
Hello, how I can make a matcher like /resource/:uuid ?

marko.justinek
2020-11-12 21:54
Could you use a regex matcher?

billal.patel
2020-11-13 10:31
has joined #pact-go

david.dias
2020-11-13 12:33
Sure, I think is the easiest one. The go package has dsl.UUID but I don't know how to combine matchers

matt.fellows
2020-11-13 12:45
Matchers can be nested. If you show us how you're wanting to use and I can help.

david.dias
2020-11-13 13:24
```WithRequest(dsl.Request{ Method: http.MethodGet, Path: dsl.Term("/v1/accounts/1", `\d+`), }).``` I want to switch this /1 and \d+ with the dsl.UUID(), all my endpoints are using UUID as id

david.dias
2020-11-13 16:20
Another strange thing is `Expected header "Content-Type" to match /application\/json/, but was nil`

david.dias
2020-11-13 16:20
but send the same request as pact is sending to provider api I'm getting the Content-Type header

louis.oliver
2020-11-16 10:33
has joined #pact-go

billal.patel
2020-11-16 14:45
@billal.patel has left the channel

ashishkujoy
2020-11-16 15:08
has joined #pact-go

pradeepchoube
2020-11-17 03:49
has joined #pact-go

meng-lingtao
2020-11-17 14:39
has joined #pact-go

pabvidcal
2020-11-17 15:30
has joined #pact-go

magesh.nagamani
2020-11-18 05:15
has joined #pact-go

jstoebel
2020-11-18 13:53
has joined #pact-go

daniel.sayer89
2020-11-19 10:33
has joined #pact-go

art.ptushkin
2020-11-19 10:34
has joined #pact-go

pact457
2020-11-19 10:36
has joined #pact-go

ajerthan.sivayoganath
2020-11-19 10:38
has joined #pact-go

philipchardwick
2020-11-19 11:05
has joined #pact-go

tanzmann
2020-11-19 11:09
has joined #pact-go

olivier.quere
2020-11-19 12:10
has joined #pact-go

wilfried.vandenberghe
2020-11-19 12:19
has joined #pact-go

alan.hanafy
2020-11-19 19:28
has joined #pact-go

michael.deutscher
2020-11-19 21:39
has joined #pact-go

gerry.power
2020-11-20 03:31
has joined #pact-go

alex900
2020-11-20 05:08
has joined #pact-go

tomas.panik
2020-11-20 08:28
has joined #pact-go

marc.ferland
2020-11-20 14:43
has joined #pact-go

sebastien.crapoulet
2020-11-20 15:24
has joined #pact-go

adutrillaux
2020-11-20 15:28
has joined #pact-go

he
2020-11-20 15:59
has joined #pact-go

ivgeni.slabkovski
2020-11-20 21:52
has joined #pact-go

serhatburakyildirim
2020-11-21 21:57
has joined #pact-go

alnasl
2020-11-22 18:46
has joined #pact-go

ashutosh23802
2020-11-23 06:20
has joined #pact-go

leonty
2020-11-23 10:33
has joined #pact-go

dariusz.piwko
2020-11-23 11:34
has joined #pact-go

praneeth.kumar
2020-11-23 16:18
has joined #pact-go

mark.white
2020-11-24 09:03
has joined #pact-go

ufuk.ozcelik
2020-11-24 14:58
has joined #pact-go

stefanos.varsanis
2020-11-24 16:48
has joined #pact-go

lalexander2810
2020-11-24 16:53
has joined #pact-go

sivaprasad9
2020-11-24 20:46
has joined #pact-go

scyr
2020-11-25 14:56
has joined #pact-go

timotheus.ruprecht
2020-11-25 22:12
has joined #pact-go

manali.mogre
2020-11-26 11:44
has joined #pact-go

erik.terpstra
2020-11-26 12:08
has joined #pact-go

kjayachandra2000
2020-11-26 20:40
has joined #pact-go

kjayachandra2000
2020-11-26 22:00
@kjayachandra2000 has left the channel

sushil.kumar
2020-11-27 01:45
has joined #pact-go

zhujian
2020-11-27 07:54
has joined #pact-go

h.octavian
2020-11-27 14:08
has joined #pact-go

noel
2020-11-28 23:12
has joined #pact-go

muraalee
2020-11-30 01:56
has joined #pact-go

pooja.sharma
2020-11-30 08:52
has joined #pact-go

mo
2020-11-30 09:24
has joined #pact-go

david.greene
2020-11-30 21:47
has joined #pact-go

bas
2020-12-01 09:00
has joined #pact-go

wainstead
2020-12-01 14:57
has joined #pact-go

jamescourtoy
2020-12-01 17:42
@matt.fellows Not a huge rush on our part, but I'm curious if you had a chance to look into the Go consumer-side code? I'm ok with verifying the Pacts using the Rust-based CLI verifier as well, so long as we can generate the consumer-side Pact files from a Go client.

jamescourtoy
2020-12-01 17:43
Also, I would love to be able to monitor progress on that in some way. I didn't notice it in the public roadmap anywhere.

zbintliff
2020-12-01 17:49
Hello! We have a _ton_ of code still on pact v0.0.13 and the migration to v1 is a pretty big effort since we need to touch every pact. Are there any migration scripts that can help us here?

jerobinson
2020-12-01 20:32
has joined #pact-go

matt.fellows
2020-12-01 20:39
:wave: Hi Zach!

matt.fellows
2020-12-01 20:40
Not yet, but you may want to avoid that migration - I?m not far away from having a native v3 version built

matt.fellows
2020-12-01 20:41
I?m aiming to have a beta out by xmas, but so far I?ve been able to get in 95% of the existing functionality across, plus all of the new v3 goodness

matt.fellows
2020-12-01 20:41
I?ll definitely write a migration guide from 1, i?ll have a look for 0.0.13 also (put on my list now)

zbintliff
2020-12-01 20:48
Ok, thanks! Its half our fault for letting it rot so long but we have a _ton_ jof pacts and a single "clients" repo. So all of our clients of our microservies are in there. meaning we have to migrate all or nothing

matt.fellows
2020-12-01 20:55
:wave:

matt.fellows
2020-12-01 20:55
So the main issue tracking the v3 upgrade is https://github.com/pact-foundation/pact-go/issues/142

matt.fellows
2020-12-01 20:56
My first pass was getting the basic end to end working - which happily is almost complete. I?ve got a PR for the Rust library (the shared engine for our languages) almost ready to ship for the provider side bindings

matt.fellows
2020-12-01 21:30
How far off are you from considering a spike to see how the new framework works? And also, what OS do you use?

matt.fellows
2020-12-01 21:31
The main activities for me at this point: ? Get the framework automatically downloading/installing the shared lib ? Tests for the new core engine (I was able to largely find a way to migrate existing bits and pieces) ? Release as beta

matt.fellows
2020-12-01 21:32
So I have actually added consumer message tests there, and it?s possibly/maybe workable

zbintliff
2020-12-01 21:32
run all our tests in deb stretch

zbintliff
2020-12-01 21:32
its not huge priorit for us. but getting bigger and bigger debt

matt.fellows
2020-12-01 21:33
It?s quite possible you could use just that specific bit of functionality now, because it doesn?t rely on the shared library - and the installation/version management of the lib is the last key bit of work before I can release a beta

matt.fellows
2020-12-01 21:33
Understand

matt.fellows
2020-12-01 21:33
is your whole code base homogenous as far as languages go?

zbintliff
2020-12-01 21:33
yep!

zbintliff
2020-12-01 21:33
with a makefile

matt.fellows
2020-12-01 21:34
cool, then I?d wait until early next year when this is out - this is first big move to our rust shared library, which is the strategic long term direction

zbintliff
2020-12-01 21:36
Oh, awesome

matt.fellows
2020-12-01 21:46
as an aside, have you ran into any ?I wish this feature existing? type thing with Pact Go yet?

zbintliff
2020-12-01 21:52
We need an overhaul and simplify everythinng. Which I think the project has done well we just can't get to it quite yet

zbintliff
2020-12-01 21:53
We have new engineers come in and pact is always hard to explain to them. But I think it gets better in new versions. just need to get there

jamescourtoy
2020-12-01 22:31
Nice! Excellent news, and thanks for the update :slightly_smiling_face:

matt.fellows
2020-12-01 23:37
When do you think you could test it out? I could provide an alpha tag and example for you to follow (but specifically for the message pact consumer)

matt.fellows
2020-12-01 23:37
That could be done in the next day or so

sumedhagamage
2020-12-02 03:33
has joined #pact-go

fealaer
2020-12-02 11:40
has joined #pact-go

fealaer
2020-12-02 11:58
@fealaer has left the channel

patrick.hendron
2020-12-02 14:44
has joined #pact-go

lpratt
2020-12-02 18:19
has joined #pact-go

sandragnzalez
2020-12-03 11:04
has joined #pact-go

kristian
2020-12-03 14:34
has joined #pact-go

me1466
2020-12-03 23:42
has joined #pact-go

wenfeng.li
2020-12-04 11:42
has joined #pact-go

jamescourtoy
2020-12-04 17:20
@matt.fellows I'm going to try and slot it into our next sprint ? we're doing sprint planning today. We typically do two-week sprints, so hopefully we will have time to do some testing either next week or the week after.

matt.fellows
2020-12-05 06:28
Cool! I'll get something out this week then, aim for the second week if you can

cdambo
2020-12-05 11:59
has joined #pact-go

gayatree.eee
2020-12-08 04:50
has joined #pact-go

c.pavan1986
2020-12-09 04:18
has joined #pact-go

william.pritchard
2020-12-09 15:28
has joined #pact-go

parveshchaudhary111
2020-12-09 17:54
has joined #pact-go

bheemreddy181
2020-12-09 18:52
Happy Holiday folks - Are there any examples around pact-go middleware for handling authorization ( Adding to incoming headers on the provider side )

jamescourtoy
2020-12-09 19:14
Thanks, @matt.fellows! The Go dev lead on my team is going to take a look at testing this out (when it's available) during some of our 20% "engineering time".

matt.fellows
2020-12-09 21:29
The go workshop has an example of that

matt.fellows
2020-12-10 02:20
Awesome, I?ll be looking at it tonight and will have something for you for next week :thumbsup:

w.sobasik
2020-12-10 10:39
has joined #pact-go


matt.fellows
2020-12-11 12:33
Few caveats worth noting: 1. The package is currently http://github.com/pact-foundation/pact-go/v3. It is likely to change, but should be a simple refactor down the track for you when its stable 2. The DSL is based on the current v2 one, so it will track fairly closely where possible to simplify upgrades etc. The new v3 matchers introduced are just an extension of the current ones, so there shouldn?t be many surprises. 3. The documentation is still all over the place - so if things aren?t clear let?s discuss here 4. The other HTTP interfaces (consumer/providers) are currently working, but the process to install the shared lib is currently manual (so basically, don?t use those features yet)

matt.fellows
2020-12-11 12:35
You?ll need to pin your go module to the specific versions for now, until I get a release process setup

jamescourtoy
2020-12-11 14:55
Thanks, Matt! I've forwarded this to my Go teammates and I'll get back with you in the next week or so on our experience :bow:

thanuxxxx
2020-12-12 22:41
has joined #pact-go

ian.hamilton
2020-12-13 06:53
has joined #pact-go

colm.j.murphy91
2020-12-13 07:02
has joined #pact-go

victoria.kruczek
2020-12-13 14:13
has joined #pact-go

wuddarwin
2020-12-14 05:23
has joined #pact-go

connor.aird
2020-12-14 15:52
has joined #pact-go

arman.najafian
2020-12-14 15:52
has joined #pact-go

praveen.lakkaraju
2020-12-14 16:12
has joined #pact-go

alejandro.germain
2020-12-14 16:26
has joined #pact-go

alejandro.germain
2020-12-14 16:30
(solved)

josh.ellinger
2020-12-15 01:22
has joined #pact-go

ufuk.ozcelik
2020-12-15 08:22
@ufuk.ozcelik has left the channel

nikitsenka
2020-12-15 09:35
has joined #pact-go

hibahawes
2020-12-15 09:53
has joined #pact-go

sarvar
2020-12-15 14:24
has joined #pact-go

suruchipatidar14
2020-12-16 05:35
has joined #pact-go

smatheson
2020-12-16 06:33
has joined #pact-go

olayemifolakemi
2020-12-16 15:23
has joined #pact-go

ania.kovalchuk
2020-12-17 00:09
has joined #pact-go

writetojoshma
2020-12-17 05:52
has joined #pact-go

rejeesh.g
2020-12-17 11:07
has joined #pact-go

lukas.kempec
2020-12-17 12:45
has joined #pact-go

vikas543
2020-12-17 16:28
has joined #pact-go

bpugh
2020-12-17 17:05
has joined #pact-go

jeff.burmood
2020-12-19 17:45
has joined #pact-go

kyle.florence
2020-12-19 19:21
has joined #pact-go

ankurmalik22
2020-12-19 21:14
has joined #pact-go

vsukumaran
2020-12-20 01:56
has joined #pact-go

omer.morad
2020-12-20 08:10
has joined #pact-go

ringo
2020-12-20 10:51
has joined #pact-go

omer.moradd
2020-12-20 18:01
has joined #pact-go

bheemreddy181
2020-12-20 19:41
Quick question on writing contract tests, are these good contract tests like if i have a request body like below - Can i write contracts for different request_types as they have different functionality on my provider side - but the response for each request type will look the same ? ```"body": { "request_type": "access" }```

matt.fellows
2020-12-20 23:25
Without more context, I would probably use a regex on that field (e.g. treat it as an enum), and have tests for different HTTP status codes (if necessary)

matt.fellows
2020-12-20 23:26
There is some guidance around this at https://docs.pact.io/consumer

bheemreddy181
2020-12-21 00:20
What kind of context you are looking at ? The problem is upto extent I go with writing these tests

matt.fellows
2020-12-21 00:23
I suppose without deep domain insight we can only go with general advice

matt.fellows
2020-12-21 00:23
If the only difference in that field is functional behaviour, I?d say it?s gone past ?contract? and into ?functional? testing, in which case those should be tests in the provider?s own code base

bheemreddy181
2020-12-21 00:31
I agree - there is some context where consumer says that what if tomorrow you drop one of those request-types or broken request types how will consumer know about these ? I felt the same where we are actually entering into functional testing

matt.fellows
2020-12-21 06:00
Well, that is contractually important: > Only make assertions about things that will affect the consumer if they change from those docs above. If indeed the values there are significant, then you do want to capture the various scenarios. I don?t know the context in which the API is used, but you could have various scenarios such as: _?when the request type is ?access? ??_ _?when the request type is ?logout? ??_

matt.fellows
2020-12-21 06:00
so in a way, they are right. There is a grey line between contract-testing and functional tests (much in the way that most tests types tend to have overlapping regions of others)

souravsen1
2020-12-21 11:28
has joined #pact-go

bheemreddy181
2020-12-21 17:10
At times it is hard to figure out the grey line around are going really above the grey line or are we really right near the grey line

andoni.arroyo
2020-12-21 17:51
has joined #pact-go

bheemreddy181
2020-12-21 23:03
I think go example workshop needs to have a middleware due of this authentication https://github.com/pact-foundation/pact-workshop-go/blob/master/consumer/client/client_pact_test.go#L21

bheemreddy181
2020-12-22 00:22
Or am i reading this wrong ?

matt.fellows
2020-12-22 00:27
yep, it does have middleware - do you need some pointers?

bheemreddy181
2020-12-22 00:27
when ever i run `make run-consumer` i get 401 error ```? pact-workshop-go git:(master) ? make run-consumer 2020/12/21 18:24:28 unauthorized exit status 1 make: *** [run-consumer] Error 1```

bheemreddy181
2020-12-22 00:28
i am not sure if i need to modify something or if i am missing something from documentation

matt.fellows
2020-12-22 00:28
right

matt.fellows
2020-12-22 00:28
which step are you in?

bheemreddy181
2020-12-22 00:30
step 4

matt.fellows
2020-12-22 00:36
you shouldn?t be able to get that error in step 4

matt.fellows
2020-12-22 00:36
are you in the branch `step4`?

matt.fellows
2020-12-22 00:37
(there is no token in step 4 yet, we introduce that in https://github.com/pact-foundation/pact-workshop-go/tree/step8)

matt.fellows
2020-12-22 00:38
Perhaps you still have the provider running from when you were in `master`?

matt.fellows
2020-12-22 00:42
(I did just noticed though that the consumer from step8 onwards was producing a bad actual bearer token value, and just pushed that up)

bheemreddy181
2020-12-22 00:42
Ah make sense got it

matt.fellows
2020-12-22 00:44
After the first few steps, you don?t really need to run those commands anymore (but still good for them to be working of course!)

theovanessen
2020-12-22 10:47
has joined #pact-go

stuart3166
2020-12-22 12:35
has joined #pact-go

winfante
2020-12-22 22:51
has joined #pact-go

lars.bonnes
2020-12-23 13:05
has joined #pact-go

eungjun.yi
2020-12-25 14:25
has joined #pact-go

ebanster
2020-12-27 13:18
has joined #pact-go

onur.baskirt
2020-12-28 10:48
has joined #pact-go

bheemreddy181
2020-12-28 18:27
I using the make file from Go workshop still see error with cli tool versions ```2020/12/28 12:20:22 [DEBUG] 3.6.2 satisfies constraints 3.6.2 >= 3.5.0, < 4.0.0 2020/12/28 12:20:22 [INFO] checking pact-provider-verifier within range >= 1.31.0, < 2.0.0 2020/12/28 12:20:22 [DEBUG] running binary pact-provider-verifier 2020/12/28 12:20:23 [DEBUG] checking version for binary pact-provider-verifier version 1.30.1 2020/12/28 12:20:23 [DEBUG] checking if version 1.30.1 within semver range >= 1.31.0, < 2.0.0 2020/12/28 12:20:23 [ERROR] CLI tools are out of date, please upgrade before continuing``` Am i missing something - this is install config i am using https://github.com/pact-foundation/pact-workshop-go/blob/step4/Makefile#L5

bheemreddy181
2020-12-28 20:47
^ this message can be ignored - my PATH was referring to an older version

bheemreddy181
2020-12-28 23:29
Quick question on dsl.match in go - As per the workshop test here https://github.com/pact-foundation/pact-workshop-go/blob/master/consumer/client/client_pact_test.go#L67 it looks like it looks for all fields in User struct , what if one of the field is optional ? how do we handle such cases do we need to be explicit for such cases or just say `Omitempty` on the struct

matt.fellows
2020-12-28 23:35
`Match` is really a simplified version of the usual matchers. If you have variations on the contract, Match is not going to be flexible enough.

matt.fellows
2020-12-28 23:36
But yes, we should be compliant with `omitempty` , but that won?t test both when it is and is not present

massimo.daros
2020-12-29 13:18
has joined #pact-go

chris.fullinwider
2020-12-29 18:15
has joined #pact-go

bheemreddy181
2020-12-29 20:29
Pact Header Matchers error out even if there is a header in the response ```2020/12/29 14:24:06 [TRACE] proxied server response HTTP/1.1 204 No Content Content-Type: application/json Date: Tue, 29 Dec 2020 20:24:06 GMT``` Sample response i see in the logs but the matcher fails ```Expected header "Content-Type" to match /application\/json/, but was nil``` Am i missing something here

bheemreddy181
2020-12-29 20:37
Or is the idea is to ignore headers when there is no content response ?

matt.fellows
2020-12-29 21:13
Looks like the regex is wrong. Can you please share the pact file or consumer test matcher?

bheemreddy181
2020-12-29 22:32
Here is the interaction ```{ "description": "blah", "providerState": "user does not exist", "request": { "method": "GET", "path": "/v1/snail_mail", "headers": { "Accept": "application/json; charset=utf-8", "Content-Type": "application/json; charset=utf-8" }, "matchingRules": { "$.headers.Accept": { "match": "regex", "regex": "application\\/json" }, "$.headers.Content-Type": { "match": "regex", "regex": "application\\/json" } } }, "response": { "status": 204, "headers": { "Content-Type": "application/json; charset=utf-8" }, "matchingRules": { "$.headers.Content-Type": { "match": "regex", "regex": "application\\/json" } } } }```

bheemreddy181
2020-12-29 22:38
And consumer matcher here ```pact. AddInteraction(). Given("user does not exist"). UponReceiving("blah"). WithRequest(request{ Method: "GET", Path: dsl.String("/v1/snail_mail"), Headers: requestCommonHeaders, }). WillRespondWith(dsl.Response{ Status: 204, Headers: responseCommonHeaders, })```

bheemreddy181
2020-12-29 22:38
```var responseCommonHeaders = dsl.MapMatcher{ "Content-Type": term("application/json; charset=utf-8", `application\/json`), }```

bheemreddy181
2020-12-29 22:38
This is taken from go workshop examples

matt.fellows
2020-12-30 01:04
:thinking_face:

matt.fellows
2020-12-30 01:05
Could be a framework thing. Let's face it, 204 literally means no content. So matching on that header is useless

matt.fellows
2020-12-30 01:05
I'd drop it from the consumer test altogether because it is meaningless

bheemreddy181
2020-12-30 01:50
Interestingly this doesn?t happen for 200 response codes so I assumed it is because of 204 no content

piotr.soltysiak
2020-12-30 16:55
has joined #pact-go

adrian.przybyla
2021-01-04 13:41
has joined #pact-go

dcorrales
2021-01-04 22:06
has joined #pact-go

jokubas.lekevicius
2021-01-04 22:10
has joined #pact-go

matt195
2021-01-05 16:35
has joined #pact-go

rafael.manzoni
2021-01-05 17:56
has joined #pact-go

animesh2712
2021-01-05 19:29
has joined #pact-go

info
2021-01-06 01:55
has joined #pact-go

pascal.libenzi
2021-01-06 10:57
has joined #pact-go

brett
2021-01-06 18:55
has joined #pact-go

josh.rosenfeld
2021-01-06 19:39
has joined #pact-go

carlo
2021-01-07 13:24
has joined #pact-go

andrewshtamburg
2021-01-07 16:03
@andrewshtamburg has left the channel

danny.porrello
2021-01-07 16:48
has joined #pact-go

dawood.abbas
2021-01-08 07:00
has joined #pact-go

victoria.kruczek
2021-01-10 16:36
@victoria.kruczek has left the channel

cksharma122
2021-01-10 17:19
has joined #pact-go

caiquedpfc
2021-01-11 04:05
has joined #pact-go

henrik.rudstrom
2021-01-11 18:30
has joined #pact-go

eric
2021-01-12 10:23
has joined #pact-go

fnguyen
2021-01-13 00:39
has joined #pact-go

pollet_22
2021-01-13 16:04
has joined #pact-go

dshattuck
2021-01-13 20:49
has joined #pact-go

thomas.rosati
2021-01-13 21:58
has joined #pact-go

rahulsmalpani
2021-01-14 07:56
has joined #pact-go

sacha.camfferman768
2021-01-14 09:42
has joined #pact-go

brandonbeard86
2021-01-14 22:10
has joined #pact-go

geetishnayak
2021-01-15 01:02
has joined #pact-go

shettyg
2021-01-15 14:18
has joined #pact-go

natarajang1
2021-01-15 15:29
has joined #pact-go

michel.neufeglise
2021-01-18 08:55
has joined #pact-go

bart.boersma
2021-01-18 10:48
has joined #pact-go

monica.wu
2021-01-19 06:25
has joined #pact-go

makobernal
2021-01-19 08:23
has joined #pact-go

jibrail.idris
2021-01-19 10:11
has joined #pact-go

jmvb.registros
2021-01-19 11:01
has joined #pact-go

tpham
2021-01-19 22:36
has joined #pact-go

vishal.grover
2021-01-20 03:12
has joined #pact-go

priya.saraf
2021-01-20 08:43
has joined #pact-go

fahad.aj.khan
2021-01-20 08:58
has joined #pact-go

nicole.jaenchen
2021-01-20 09:38
has joined #pact-go

dinakaran.ulaganathan
2021-01-20 13:59
has joined #pact-go

ptsiakos77
2021-01-20 21:55
has joined #pact-go

mhdtouban
2021-01-21 01:58
has joined #pact-go

veeraprathap.n
2021-01-21 04:10
has joined #pact-go

tsiakos
2021-01-21 09:24
has joined #pact-go

oleg
2021-01-21 13:05
has joined #pact-go

zbintliff
2021-01-21 20:55
Hello Again. We finally are prioritizing upgrading our pact from v0.12 to XXX. Wondering what you recommedn the XXX be? I see 1.12 is commongly used and I heard there is a v3 coming. Is there anywhere I can see about the new features of v3 and potential timelien?

matt.fellows
2021-01-22 06:53
:wave:

matt.fellows
2021-01-22 06:53
Hello!

matt.fellows
2021-01-22 06:54
I was hoping to have the v3 features live by xmas, but didn?t get the time in front of the computer (apparently it?s anti-social family behaviour)

matt.fellows
2021-01-22 06:54
I have an OSS day coming up in the next week or two, and I should be able to get a beta release of the new stuff out.

matt.fellows
2021-01-22 06:54
I would suggest moving straight to it, because why do it more than once.

matt.fellows
2021-01-22 06:55
How would you prioritise the need between combinations of: ? consumer ? provider ? http ? message

thomas.powell
2021-01-22 10:18
has joined #pact-go

zbintliff
2021-01-22 14:37
That is awesome, thank you. To make sure we are on the same page this is just a library upgrade and not a spec upgrade? So we can upgrade the consumers first and still work with existing contracts? We are coming from an old version so we've really only interacted with consumers and providers. Where the consumers defined the message. (we are still even using the ruby mock server for verification). I think we may wait for a bit look at everything and redesign our entire approach to pact so we can start anywhere but being able to see the whole picture may help with design and implimentation.

stefan.selent
2021-01-23 01:54
has joined #pact-go

matt.fellows
2021-01-23 02:03
Yes, it's a just a new version of Pact Go and you can stick with V2 or move to v3 spec when the time is appropriate.

matt.fellows
2021-01-23 02:04
I'll get the provider side done first because I think that will be easier for you to test and swap

matt.fellows
2021-01-23 02:04
It's also less effort I think on my side

paulo
2021-01-25 11:37
has joined #pact-go

kmckeever
2021-01-25 14:38
has joined #pact-go

robert.land
2021-01-25 19:25
has joined #pact-go

aparnachaudhari
2021-01-25 21:34
has joined #pact-go

aparnachaudhari
2021-01-25 21:36
Hello all! I am starting to look at pact-go to implement contract based testing on our existing microservices (I know thats not ideal - but we have to start somewhere!).. I am fairly new to golang and to pact. What would be a good place to start ?

matt.fellows
2021-01-25 22:14
Start with a consumer test :slightly_smiling_face:


matt.fellows
2021-01-25 22:14
We have a golang workshop if you have time. See howtolearn

2021-01-25 22:14
Here are a number of useful hands-on labs that teach all of the key concepts https://docs.pact.io/implementation_guides/workshops

matt.fellows
2021-01-25 22:15
Takes a couple of hours, but it?s worth it because you can self guide through all of the key concepts

gwhill7
2021-01-25 23:23
has joined #pact-go

bibinc99
2021-01-26 14:37
has joined #pact-go

luisc.barretog
2021-01-27 00:42
has joined #pact-go

laxmi.somni508
2021-01-27 10:27
has joined #pact-go

ryanding16
2021-01-27 20:25
has joined #pact-go

athurner
2021-01-28 13:55
has joined #pact-go

alex.mcnair
2021-01-28 18:35
has joined #pact-go

mailinglistsspammedme
2021-01-28 23:30
has joined #pact-go

steven.beaver.retail
2021-01-29 15:34
has joined #pact-go

ekberli.elbrus
2021-01-30 16:33
has joined #pact-go

matt.fellows
2021-02-01 01:28
For anybody interesting in testing strategies for APIs written in Go (not sure if Pact will be part of the talk, but Anton?s a smart guy!)

george.south
2021-02-01 21:12
has joined #pact-go

aparnachaudhari
2021-02-03 02:09
I am trying to install pact for go locally but am running into errors

aparnachaudhari
2021-02-03 02:11
```go get http://gopkg.in/pact-foundation/pact-go.v1 Error: # cd /Users/<username>/Projects/golang/src/github.com/pact-foundation/pact-go; git pull --ff-only There is no tracking information for the current branch. Please specify which branch you want to merge with. See git-pull(1) for details. git pull <remote> <branch> If you wish to set tracking information for this branch you can do so with: git branch --set-upstream-to=origin/<branch> master package http://github.com/pact-foundation/pact-go/command: exit status 1```

aparnachaudhari
2021-02-03 02:11
am I missing something here?

matt.fellows
2021-02-03 02:20
:man-shrugging:

matt.fellows
2021-02-03 02:20
looks like an issue with git?

aparnachaudhari
2021-02-03 02:22
am I needing to set upstream to https://github.com/pact-foundation/pact-go.git here?

matt.fellows
2021-02-03 02:23
It looks like maybe the existing package you have is corrupted or something


matt.fellows
2021-02-03 02:24
so one option could be to remove whatever is already there and try again

aparnachaudhari
2021-02-03 02:29
:disappointed: that did not help

matt.fellows
2021-02-03 02:33
what does `git remote -v` show in the pact-go directory show?

matt.fellows
2021-02-03 02:34
anyway, seems like a strange git problem

matt.fellows
2021-02-03 02:35
try this in the pact-go dir: ```git branch --set-upstream-to=origin/master master```

matt.fellows
2021-02-03 02:44
Those instructions could probably also be updated now that `go mod` is the defacto

twierzchowski
2021-02-03 07:05
has joined #pact-go

yassin.hajaj
2021-02-03 10:35
has joined #pact-go

dany.marques90
2021-02-03 12:48
has joined #pact-go

marcelo
2021-02-03 13:11
has joined #pact-go

aparnachaudhari
2021-02-03 16:43
Sorry had to stop last night, but considering I am still fairly new to go, I am trying to figure this out.

aparnachaudhari
2021-02-03 16:43
Will update here if I do

aparnachaudhari
2021-02-03 17:09
So it looks like I already had a corrupt package that I had to remove ```rm -rf src/gopkg.in/pact-foundation/pact-go.v1```

aparnachaudhari
2021-02-03 17:10
and then did a `go get` again.

aparnachaudhari
2021-02-03 17:10
Also, using the module name for `go get` make more sense I think ```go get http://github.com/pact-foundation/pact-go```

sandeeparthur
2021-02-03 19:46
has joined #pact-go

aparnachaudhari
2021-02-03 23:20
I am having a really hard time getting started off with writing a simple POC pact test between 2 of our existing microservices.. I am looking at https://docs.pact.io/implementation_guides/go/readme and https://github.com/pact-foundation/pact-workshop-go but it looks like it skims over a lot of stuff.. please bear in mind I am new to go .. which is not helping either

aparnachaudhari
2021-02-03 23:20
anyone know of any other resources - real world implementations I can look at ?

aparnachaudhari
2021-02-04 00:14
`2021/02/03 16:00:17 [ERROR] CLI tools are out of date, please upgrade before continuing` I am seeing this error locally when trying to run `go test -v -run TestProvider` from the pact-go examples folder

matt.fellows
2021-02-04 01:22
I?d say the workshop is going to be a better starting point. If you don?t know Go well, then that?s obviously another barrier. What language do you know well?

matt.fellows
2021-02-04 01:23
have a look at https://docs.pactflow.io/docs/tutorials/. There is a JS and Java tutorial there you can run in the browser. This should help with the basics of Pact, without needing to run anything on your laptop. It takes 15-20mins to run through in a browser

matt.fellows
2021-02-04 01:23
On your specific issue, this means you haven?t installed the binary dependencies required by Pact

matt.fellows
2021-02-04 01:24
Step (1) is downloading the CLI tools and adding to your `PATH` (https://github.com/pact-foundation/pact-go/#installation)

matt.fellows
2021-02-04 01:24
The error you?re seeing, is that Pact cannot find these tools. So you have either a) not downloaded and added them to the path or b) incorrectly set the PATH, and the process you are executing Pact within can?t find them

matt.fellows
2021-02-04 01:25
never fear, we?ll get you going

aparnachaudhari
2021-02-04 02:15
Python is my strong suite

matt.fellows
2021-02-04 02:22
hmm not sure if we have a python workshop/tutorial

matt.fellows
2021-02-04 02:22
howtoexamples


matt.fellows
2021-02-04 02:22
:point_up: there is a python example there, but no tutorial to accompany it

aparnachaudhari
2021-02-04 02:28
That was it! I had my PATH going to the incorrect `pact/bin`

aparnachaudhari
2021-02-04 06:38
Leaving this here for later, I see the error below? ``` Error on Verify: Actual interactions do not match expected interactions for mock MockService.```

aparnachaudhari
2021-02-04 06:41
If I am understanding this correctly, what its saying is that the function that I called in the pact.Verify is not making the same call as what I have in the WithRequest section?

octoberclub
2021-02-04 16:27
has joined #pact-go

slavick
2021-02-04 17:21
has joined #pact-go

imran.settuba
2021-02-04 18:57
has joined #pact-go

christopher.roberts
2021-02-05 01:02
has joined #pact-go

aparnachaudhari
2021-02-05 04:54
I am trying to understand https://docs.pact.io/pact_broker/docker_images/pactfoundation if I have to spin up a packbroker in our local infra as a docker image, am I running the db instance separately? We host our services on k8's

matt.fellows
2021-02-05 05:06
I would have the database run separately for sure.

matt.fellows
2021-02-05 05:06
It's a persistent store so you need to backup etc

matt.fellows
2021-02-05 05:07
Otherwise there is http://Pactflow.io as a SaaS

aparnachaudhari
2021-02-05 05:24
gotcha, yea thats what I figured. Is there any information how to set up the needed database schema in documents? May be I am not seeing it?

matt.fellows
2021-02-05 05:25
Probably best asking in #pact-broker

aparnachaudhari
2021-02-05 05:25
will do, thank you

matt.fellows
2021-02-05 05:25
Should be there somewhere. Just needs a user with all privileges and a databases created. The broker will then bootstrap itself


matt.fellows
2021-02-05 05:26
That help?

aparnachaudhari
2021-02-05 05:28
Thank you, also interesting.. just setting up `psql postgres -c "CREATE DATABASE pact_broker;` I think I was looking for the db schema.. i.e. tables etc..

aparnachaudhari
2021-02-05 05:28
I think I need to dig more into the docs


matt.fellows
2021-02-05 06:59
yes. You don?t need to setup the schema, the broker will do it automatically

r.darcel
2021-02-05 09:15
has joined #pact-go

ashish.joshi
2021-02-06 01:07
has joined #pact-go

przemek.sech296
2021-02-08 23:18
has joined #pact-go

vplows
2021-02-09 06:00
has joined #pact-go

rodney.stromlund
2021-02-09 16:18
has joined #pact-go

nada
2021-02-09 19:00
has joined #pact-go

siddhardhan
2021-02-09 20:21
has joined #pact-go

lars.hisken916
2021-02-10 08:08
has joined #pact-go

pauligoe10
2021-02-10 08:19
has joined #pact-go

tusharvarm
2021-02-10 09:38
has joined #pact-go

igorsharf
2021-02-10 10:39
has joined #pact-go

kieran
2021-02-10 17:13
has joined #pact-go

poward
2021-02-10 18:17
has joined #pact-go

ckhadilkar
2021-02-10 21:16
has joined #pact-go

neild
2021-02-11 18:53
has joined #pact-go

painenigowthami
2021-02-11 22:32
has joined #pact-go

stephenkilbourn
2021-02-11 23:02
has joined #pact-go

tcarlson
2021-02-11 23:05
has joined #pact-go

fnguyen
2021-02-12 01:34
@fnguyen has left the channel

r.strauch
2021-02-12 10:15
has joined #pact-go

ztlboy05
2021-02-12 14:57
has joined #pact-go

smith260194
2021-02-12 15:22
has joined #pact-go

dabfleming
2021-02-12 20:34
has joined #pact-go

dabfleming
2021-02-12 21:56
Hey, so I'm having some difficulty getting a consumer test setup, I'm trying to build up to what I need starting with some basic example code. It works validating the method & path of the request, but as soon as I add `Request.Body` to the `WithRequest()` call I'm having trouble. I keep seeing a 500 response from the pact server with no additional information about what's going wrong.

matt.fellows
2021-02-12 22:26
What does the log file say?

matt.fellows
2021-02-12 22:29
Usually the log file will show the request and why it mismatched

matt.fellows
2021-02-12 22:29
Could you also please share the code? That might help too

prasanthp
2021-02-13 00:45
has joined #pact-go

bhardwajdiwakar
2021-02-14 22:38
has joined #pact-go

hiteshpatadia
2021-02-15 06:29
has joined #pact-go

vikrant.sarkaniya
2021-02-15 13:31
has joined #pact-go

lemitrou
2021-02-15 14:20
has joined #pact-go

helloraj
2021-02-16 08:09
has joined #pact-go

dabfleming
2021-02-16 17:05
Ok, so making some progress, especially looking at the log file to see the info on the difference between expected vs actual. Is there a way to get pact to *not* care about additional key/values in the json of a response? Ex Actual JSON response: ```{ "foo": "string1", "bar": "string2" }``` And in my code: ```Body: dsl.EachLike(map[string]interface{}{ "foo": "string1" }, 1),``` Then in my log: ```Description of differences -------------------------------------- * Did not expect the key "bar" to exist at $.body[0]``` I want to match the stuff that I specify, but I basically don't care if there are extra values.

jamesmlucas
2021-02-16 19:29
has joined #pact-go

gabe707
2021-02-16 20:31
has joined #pact-go

wangpei9679
2021-02-16 21:29
has joined #pact-go

matt.fellows
2021-02-16 23:02
so yes, Pact does not care about additional attributes (see documentation about our implementation of Postel?s Law)

matt.fellows
2021-02-16 23:02
what?s going on here is that you?re saying the root of the JSON response should be an array

matt.fellows
2021-02-16 23:03
i.e. ```[ { "foo": "string1" } ]```

geir
2021-02-16 23:03
has joined #pact-go

matt.fellows
2021-02-16 23:05
is that right?

dabfleming
2021-02-16 23:05
My bad in trying to simplify my example... also I think I'm mixing request and response a bit.. I'll try and get a cleaner example in a bit.

matt.fellows
2021-02-16 23:05
ok thanks

matt.fellows
2021-02-16 23:05
it should be possible, if you can share the code I?m sure we can get to the bottom of it

soruma.net
2021-02-17 05:58
has joined #pact-go

therimpact
2021-02-17 12:30
has joined #pact-go

dabfleming
2021-02-17 15:24
Ok, so to try and clear this up... here's a better copy of what's going on... The request coming from my consumer: ```[ { "important": "foo", "unimportant": null } ]``` Go Code: ```pact. AddInteraction(). UponReceiving("This request"). WithRequest(dsl.Request{ Method: "POST", Path: dsl.String("/path/to/endpoint"), Headers: dsl.MapMatcher{...}, Body: dsl.EachLike(map[string]interface{}{ "important": "foo", // --- "unimportant": nil, // We don't care about `unimportant` -- we don't even care if // it is in the request. But if we remove it from the spec // pact fails the test complaining `* Did not expect the key "unimportant" to exist at $.body[0]` }, 1), }). WillRespondWith(...)```

mark.doppelfeld
2021-02-17 19:34
Hi, in our company we are forced to run our own pact broker and due to network setup this is not reachable via our standard http_proxy but needs to be excluded via no_proxy. With that approach I do can get http access to it. When trying to do a ```pact.VerifyMessageProvider``` I do get an http 503 which I assume comes from handling the proxy/no_proxy not in the way I need it to be. Any chance to configure this settings somehow? A colleague of mine, sitting in another network segment without proxy has no issues doing the verification. I tried to search here and the google way, but couldn't find anything that seems to match my situation. Thanks & best

dabfleming
2021-02-17 21:33
I apologize if I've missed something, but is there a way to publish a pact to a broker without first writing the file to disk? Seems like you have to do: ```pact.WritePact() pub := dsl.Publisher{} pub.Publish(types.PublishRequest{...})``` It would make a lot more sense to me if I could just do something like `pact.PublishTo(brokerURL)`

andrzej.igielski
2021-02-17 21:41
has joined #pact-go

matt.fellows
2021-02-17 21:42
Ah, so pact won't let you ignore something in a request if your code actually sends it. You must either include it in the spec, or not have your code send it

matt.fellows
2021-02-17 21:42
Additional values in the real response from the provider is ok

matt.fellows
2021-02-17 21:42
We follow Postels law here: be conservative in what you send, be liberal in what you expect

dabfleming
2021-02-17 21:43
Ok, gotcha. That makes sense.

matt.fellows
2021-02-17 21:44
Otherwise we can't be sure that field doesn't change behaviour in some important way

matt.fellows
2021-02-17 21:44
It's not, but that's a fair enough idea

matt.fellows
2021-02-17 21:45
We could look to change in next major release

matt.fellows
2021-02-17 21:45
If you care enough, please raise a feature request and we can look

dabfleming
2021-02-17 21:46
Yeah, when dealing with a broker it's a little awkward to have to write a file to disk as a middle step.

matt.fellows
2021-02-17 23:19
hmmm that?s a good question

matt.fellows
2021-02-17 23:19
I believe the go client should respect proxy configuration by default


matt.fellows
2021-02-17 23:19
but perhaps it needs a way to configure the http client more completely?

mikewagner21
2021-02-18 03:15
has joined #pact-go

khandelwalbhushan
2021-02-18 08:10
has joined #pact-go

mark.doppelfeld
2021-02-18 09:19
It seems so . I had a look at the TLS config thing and passing proxy / no_proxy information might be helpful. How shall I proceed with this?

aniket.agarwal
2021-02-18 09:21
has joined #pact-go

matt.fellows
2021-02-18 09:40
I'm assuming you have the correct http proxy settings in the environment?

matt.fellows
2021-02-18 09:40
This seems to suggest the solution if Env Vara don't fix: https://stackoverflow.com/questions/44291191/bypassing-http-proxy-in-golang

matt.fellows
2021-02-18 09:41
Actually, scrap that

matt.fellows
2021-02-18 09:41
It will actually be a Ruby issue

matt.fellows
2021-02-18 09:41
Can you please print out any logs you have?

arpit.modani
2021-02-18 09:43
has joined #pact-go

byronth
2021-02-18 11:45
has joined #pact-go

isa.levine
2021-02-18 23:37
has joined #pact-go

r.strauch
2021-02-19 08:41
@r.strauch has left the channel

brian.pfretzschner
2021-02-19 10:15
has joined #pact-go

bheemreddy181
2021-02-19 17:48
Just curious when we ask provider to verify the pact with a give pact url i feel provider is verifying other versions of consumer as well

bheemreddy181
2021-02-19 17:51
if you look at when master pact was pusblished vs when the pact was verified i feel the provider is sending verification to all pact / it may be verifying all pacts

dabfleming
2021-02-19 19:32
From the Go lib... ```// PactFileWriteMode specifies how to write to the Pact file, for the life // of a Mock Service. // "overwrite" will always truncate and replace the pact after each run // "merge" will append to the pact file, which is useful if your tests // are split over multiple files and instantiations of a Mock Server // See https://github.com/pact-foundation/pact-ruby/blob/master/documentation/configuration.md#pactfile_write_mode PactFileWriteMode string``` But the linked docs are: > Default value: `:overwrite` Options: `:overwrite`, `:update`, `:smart`, `:none` No mention of `merge` as in the go docs. Merge seems to work when I tested, do the docs need an update? Since this is acting on the broker I'd assume these are standard across all implementations.

bheemreddy181
2021-02-19 20:11
Provider Implementation

bheemreddy181
2021-02-19 20:11
logs

bheemreddy181
2021-02-19 20:11
i feel like when there is an input pact_url the master tag should be completely ignored

matt.fellows
2021-02-19 22:47
It uses what you configure, so if you pass in both it's going to verify both

matt.fellows
2021-02-19 22:48
I'd suggest if you don't want that behaviour to guard against it. We usually use environment variables to toggle that behaviour e.g. if a Pact URL is present (for a triggered webhook) then we don't fetch

matt.fellows
2021-02-19 22:49
We can't assume any behaviour here, so that's why it validates all

matt.fellows
2021-02-19 22:52
It's actually a local operation in the pact file

matt.fellows
2021-02-19 22:53
Good question tho. Can you please raise an issue?

bheemreddy181
2021-02-19 22:53
i feel like if pact_url is set then it shouldn't pull the master tag or other tests

matt.fellows
2021-02-19 22:53
But why?

matt.fellows
2021-02-19 22:53
We can't infer why you'd like to do that. It's completely legitimate to do both and entirely in your control

bheemreddy181
2021-02-19 22:54
PACT_URL is present when webhook triggers that means it want only that pact to be verified

matt.fellows
2021-02-19 22:54
Sure, but you can also use it in many other contexts.

bheemreddy181
2021-02-19 22:54
why is this different from ruby vs go

matt.fellows
2021-02-19 22:55
Is it?

matt.fellows
2021-02-19 22:55
:thinking_face:

bheemreddy181
2021-02-19 22:55
see here for example

matt.fellows
2021-02-19 22:55
If Ruby does that, I disagree with it and am surprised if it's the case. Pact JS has the exact same behaviour as does Pact JVM

bheemreddy181
2021-02-19 22:56
may be we are running different tasks in ruby for each then

matt.fellows
2021-02-19 22:56
Is it causing a problem?

bheemreddy181
2021-02-19 22:56
you mean verifying all contracts ?

matt.fellows
2021-02-19 22:56
Yeah

bheemreddy181
2021-02-19 22:57
it is not giving proper insights on the UI and the slack notification tells we verified all contracts

matt.fellows
2021-02-19 22:57
In any case, all that is required to change is an if/else statement

matt.fellows
2021-02-19 22:57
What you mean by insights in the UI?

bheemreddy181
2021-02-19 22:58
So you mean if PACT_URL is present don't set the master tags ?

bheemreddy181
2021-02-19 23:02
Another question here


bheemreddy181
2021-02-19 23:02
from this why all three pacts were verified ?

bheemreddy181
2021-02-19 23:03
isn't it only verify the test pacts ?

bheemreddy181
2021-02-19 23:03
or is it sending verification_results to all ?

matt.fellows
2021-02-19 23:04
I can't tell why it's verifying from that. But if the contents are the same across versions then it will appear as though it verified multiple when in fact the result is applied to all

bheemreddy181
2021-02-19 23:06
i feel the results should be applied to the ones which are verified only rather than applying to all the pact with same content

bheemreddy181
2021-02-19 23:06
what do you think ?

matt.fellows
2021-02-20 01:29
That?s one of the biggest benefits though. If the contract content hasn?t changed, a consumer won?t be blocked next time they call `can-i-deploy`

matt.fellows
2021-02-20 01:30
conceptually, you think you?re publishing a new contract. But the broker doesn?t see it this way. It says ?I?ve seen this contract befor, so I?m just going to associate the consumer version with it?. Because the contract has been verified, any consumer version that has the same contract is deployable

matt.fellows
2021-02-20 01:30
Otherwise, each time a consumer goes to deploy and publishes a contract, it will have to wait for a provider to verify it, even though we know the contract is compatible with the deployed provider

matt.fellows
2021-02-20 02:07
Back on the original topic though, and for clarity - you're doing the right thing with respect to the flow

chitra.adikesavan
2021-02-20 15:50
has joined #pact-go

mark.doppelfeld
2021-02-20 18:23
That's all I got

mark.doppelfeld
2021-02-20 18:23
``` STDERR: Error reading file from http://pact-broker.xxxxx.yyyyy/pacts/provider/pao-ip-pool-manager/consumer/pao-switch-controller/version/1.2.0 HTTP request failed: status=503 /home/mdoppelfeld/development/pact/lib/vendor/ruby/2.2.0/gems/pact-support-1.15.1/lib/pact/consumer_contract/pact_file.rb:67:in `block in get_remote_with_retry' /home/mdoppelfeld/development/pact/lib/vendor/ruby/2.2.0/gems/pact-support-1.15.1/lib/pact/consumer_contract/pact_file.rb:60:in `times' /home/mdoppelfeld/development/pact/lib/vendor/ruby/2.2.0/gems/pact-support-1.15.1/lib/pact/consumer_contract/pact_file.rb:60:in `get_remote_with_retry' /home/mdoppelfeld/development/pact/lib/vendor/ruby/2.2.0/gems/pact-support-1.15.1/lib/pact/consumer_contract/pact_file.rb:41:in `render_pact' /home/mdoppelfeld/development/pact/lib/vendor/ruby/2.2.0/gems/pact-support-1.15.1/lib/pact/consumer_contract/pact_file.rb:22:in `read' /home/mdoppelfeld/development/pact/lib/vendor/ruby/2.2.0/gems/pact-1.51.1/lib/pact/provider/pact_source.rb:16:in `pact_json' /home/mdoppelfeld/development/pact/lib/vendor/ruby/2.2.0/gems/pact-1.51.1/lib/pact/provider/pact_spec_runner.rb:115:in `collect' /home/mdoppelfeld/development/pact/lib/vendor/ruby/2.2.0/gems/pact-1.51.1/lib/pact/provider/pact_spec_runner.rb:115:in `pact_jsons' /home/mdoppelfeld/development/pact/lib/vendor/ruby/2.2.0/gems/pact-1.51.1/lib/pact/provider/pact_spec_runner.rb:78:in `configure_rspec' /home/mdoppelfeld/development/pact/lib/vendor/ruby/2.2.0/gems/pact-1.51.1/lib/pact/provider/pact_spec_runner.rb:32:in `run' /home/mdoppelfeld/development/pact/lib/vendor/ruby/2.2.0/gems/pact-1.51.1/lib/pact/cli/run_pact_verification.rb:69:in `run_with_pact_uri_object' /home/mdoppelfeld/development/pact/lib/vendor/ruby/2.2.0/gems/pact-1.51.1/lib/pact/cli/run_pact_verification.rb:50:in `run_specs' /home/mdoppelfeld/development/pact/lib/vendor/ruby/2.2.0/gems/pact-1.51.1/lib/pact/cli/run_pact_verification.rb:21:in `call' /home/mdoppelfeld/development/pact/lib/vendor/ruby/2.2.0/gems/pact-1.51.1/lib/pact/cli/run_pact_verification.rb:13:in `call' /home/mdoppelfeld/development/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.32.1/lib/pact/provider_verifier/app.rb:171:in `verify_pact' /home/mdoppelfeld/development/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.32.1/lib/pact/provider_verifier/app.rb:43:in `block in call' /home/mdoppelfeld/development/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.32.1/lib/pact/provider_verifier/app.rb:42:in `collect' /home/mdoppelfeld/development/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.32.1/lib/pact/provider_verifier/app.rb:42:in `call' /home/mdoppelfeld/development/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.32.1/lib/pact/provider_verifier/app.rb:34:in `call' /home/mdoppelfeld/development/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.32.1/lib/pact/provider_verifier/cli/verify.rb:47:in `verify' /home/mdoppelfeld/development/pact/lib/vendor/ruby/2.2.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run' /home/mdoppelfeld/development/pact/lib/vendor/ruby/2.2.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command' /home/mdoppelfeld/development/pact/lib/vendor/ruby/2.2.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch' /home/mdoppelfeld/development/pact/lib/vendor/ruby/2.2.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start' /home/mdoppelfeld/development/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.32.1/lib/pact/provider_verifier/cli/custom_thor.rb:17:in `start' /home/mdoppelfeld/development/pact/lib/app/pact-provider-verifier.rb:33:in `<main>' /home/mdoppelfeld/development/pact/lib/vendor/ruby/2.2.0/gems/pact-support-1.15.1/lib/pact/consumer_contract/pact_file.rb:67:in `block in get_remote_with_retry': HTTP request failed: status=503 (Pact::PactFile::HttpError) from /home/mdoppelfeld/development/pact/lib/vendor/ruby/2.2.0/gems/pact-support-1.15.1/lib/pact/consumer_contract/pact_file.rb:60:in `times' from /home/mdoppelfeld/development/pact/lib/vendor/ruby/2.2.0/gems/pact-support-1.15.1/lib/pact/consumer_contract/pact_file.rb:60:in `get_remote_with_retry' from /home/mdoppelfeld/development/pact/lib/vendor/ruby/2.2.0/gems/pact-support-1.15.1/lib/pact/consumer_contract/pact_file.rb:41:in `render_pact' from /home/mdoppelfeld/development/pact/lib/vendor/ruby/2.2.0/gems/pact-support-1.15.1/lib/pact/consumer_contract/pact_file.rb:22:in `read' from /home/mdoppelfeld/development/pact/lib/vendor/ruby/2.2.0/gems/pact-1.51.1/lib/pact/provider/pact_source.rb:16:in `pact_json' from /home/mdoppelfeld/development/pact/lib/vendor/ruby/2.2.0/gems/pact-1.51.1/lib/pact/provider/pact_spec_runner.rb:115:in `collect' from /home/mdoppelfeld/development/pact/lib/vendor/ruby/2.2.0/gems/pact-1.51.1/lib/pact/provider/pact_spec_runner.rb:115:in `pact_jsons' from /home/mdoppelfeld/development/pact/lib/vendor/ruby/2.2.0/gems/pact-1.51.1/lib/pact/provider/pact_spec_runner.rb:78:in `configure_rspec' from /home/mdoppelfeld/development/pact/lib/vendor/ruby/2.2.0/gems/pact-1.51.1/lib/pact/provider/pact_spec_runner.rb:32:in `run' from /home/mdoppelfeld/development/pact/lib/vendor/ruby/2.2.0/gems/pact-1.51.1/lib/pact/cli/run_pact_verification.rb:69:in `run_with_pact_uri_object' from /home/mdoppelfeld/development/pact/lib/vendor/ruby/2.2.0/gems/pact-1.51.1/lib/pact/cli/run_pact_verification.rb:50:in `run_specs' from /home/mdoppelfeld/development/pact/lib/vendor/ruby/2.2.0/gems/pact-1.51.1/lib/pact/cli/run_pact_verification.rb:21:in `call' from /home/mdoppelfeld/development/pact/lib/vendor/ruby/2.2.0/gems/pact-1.51.1/lib/pact/cli/run_pact_verification.rb:13:in `call' from /home/mdoppelfeld/development/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.32.1/lib/pact/provider_verifier/app.rb:171:in `verify_pact' from /home/mdoppelfeld/development/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.32.1/lib/pact/provider_verifier/app.rb:43:in `block in call' from /home/mdoppelfeld/development/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.32.1/lib/pact/provider_verifier/app.rb:42:in `collect' from /home/mdoppelfeld/development/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.32.1/lib/pact/provider_verifier/app.rb:42:in `call' from /home/mdoppelfeld/development/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.32.1/lib/pact/provider_verifier/app.rb:34:in `call' from /home/mdoppelfeld/development/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.32.1/lib/pact/provider_verifier/cli/verify.rb:47:in `verify' from /home/mdoppelfeld/development/pact/lib/vendor/ruby/2.2.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run' from /home/mdoppelfeld/development/pact/lib/vendor/ruby/2.2.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command' from /home/mdoppelfeld/development/pact/lib/vendor/ruby/2.2.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch' from /home/mdoppelfeld/development/pact/lib/vendor/ruby/2.2.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start' from /home/mdoppelfeld/development/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.32.1/lib/pact/provider_verifier/cli/custom_thor.rb:17:in `start' from /home/mdoppelfeld/development/pact/lib/app/pact-provider-verifier.rb:33:in `<main>'```

andrzej.igielski
2021-02-20 19:28
@andrzej.igielski has left the channel

ankita.soni
2021-02-22 07:26
has joined #pact-go

jacek.helper
2021-02-22 08:03
has joined #pact-go

dany.marques90
2021-02-22 13:54
@dany.marques90 has left the channel

seanw122
2021-02-22 15:36
has joined #pact-go

akennedy
2021-02-22 15:54
has joined #pact-go

esimpson
2021-02-22 16:42
has joined #pact-go

dagrawal
2021-02-22 17:24
has joined #pact-go

venkata.pro
2021-02-22 21:47
has joined #pact-go

aparnachaudhari
2021-02-23 02:34
I am running into a race condition where my provider tests fail because the pact.test incoming connections need permissions when run locally.

aparnachaudhari
2021-02-23 02:35
*`Do you want the application "pacts.test" to accept incoming network connections?`* is what I am shown after ? My provider service spins up ? Pact test already runs and fails with `502`

aparnachaudhari
2021-02-23 02:35
any guidance?

matt.fellows
2021-02-23 03:25
I get that warning in one of my Mac's but it doesn't cause failures. Double check it is indeed the cause via trace logging

matt.fellows
2021-02-23 03:26
I think you can tell Mac to disable it, because I've somehow done it on my main one

jordan.levin
2021-02-23 19:13
has joined #pact-go

aparnachaudhari
2021-02-23 22:33
unfortunately our firewall permissions are blocked on our machines and I am unable to make any changes

aparnachaudhari
2021-02-23 22:34
I am trying to figure out what I can do to get around this

aparnachaudhari
2021-02-23 22:35
cause I run into 502 when running the pact-go example provider_test.go too

matt.fellows
2021-02-24 00:07
How does it work on the consumer side? The consumer side starts up a server as well which presumably has the same issue? Also, how do you test your provider code locally if you can?t start a port?

matt.fellows
2021-02-24 00:07
I can?t see how this is a Pact specific issue I?m sorry, so not sure how to help you from here

aparnachaudhari
2021-02-24 00:08
no my comment above was about that - this does not seem a pact related issue, this seems to be a firewall issue on my machine

matt.fellows
2021-02-24 00:08
yeah, unless I can reproduce it, the problem is very much related to your specific environment. Is there somebody who knows Go well enough to help you or a sysadmin you can speak with to understand the constraints? Once we know if it?s something we can do on our side, i?d be happy to have an issue raised and find an approach to fixing

francesco.latorre
2021-02-24 05:59
has joined #pact-go

aniket.g2185
2021-02-24 09:13
has joined #pact-go

aniket.g2185
2021-02-24 09:21
Hello @matt.fellows, firstly thanks for your amazing contributions to PACT :slightly_smiling_face: , wanted to check if `valueFromProviderState` is supported in Go's provider lib

matt.fellows
2021-02-24 09:38
Thank you!

matt.fellows
2021-02-24 09:39
Consumer or provider side?

matt.fellows
2021-02-24 09:39
It soon will be on provider side with a v3 branch almost ready for prime tine

matt.fellows
2021-02-24 09:39
Consumer will be a little while away

aniket.g2185
2021-02-24 09:40
As of now looking for provider side, consumer is JVM based but we have few Go based consumers as well

matt.fellows
2021-02-24 09:41
Ok cool, I should have something for you in next couple of days, just sorting out an osx linking issue

matt.fellows
2021-02-24 09:41
Can I ping you when it's ready for some testing?

aniket.g2185
2021-02-24 09:41
Absolutely, I would be able to test out some scenarios

sundaresank360
2021-02-24 12:12
has joined #pact-go

jhawthor
2021-02-24 15:18
has joined #pact-go

chris.r.thomas
2021-02-24 16:54
has joined #pact-go

peter.cook
2021-02-24 17:05
has joined #pact-go

jayeshguru81
2021-02-24 18:34
has joined #pact-go

ben.kirberger
2021-02-24 19:16
has joined #pact-go

m.stephkan
2021-02-25 05:30
has joined #pact-go

stephen.tjasink
2021-02-25 08:23
has joined #pact-go

beatrizwaclawek
2021-02-25 20:27
has joined #pact-go

zhoutianli1234
2021-02-25 21:09
has joined #pact-go

travis.day
2021-02-26 04:06
has joined #pact-go

andrew.cunningham
2021-02-26 11:13
has joined #pact-go

andrew.cunningham
2021-02-26 11:54
@andrew.cunningham has left the channel

brianmasschaele
2021-02-27 13:27
has joined #pact-go

pedroefajardo_pactio
2021-02-27 17:18
has joined #pact-go

dominic_herrmann
2021-03-01 06:54
has joined #pact-go

matthew.long
2021-03-02 14:08
has joined #pact-go

tmoncm
2021-03-02 17:17
has joined #pact-go

phoenixcampos01
2021-03-02 21:25
has joined #pact-go

hugh.paul.mcgowan
2021-03-03 17:52
has joined #pact-go

normanrs
2021-03-04 11:18
has joined #pact-go

jayson.bailey
2021-03-04 19:18
has joined #pact-go

mjsmcp
2021-03-08 23:46
has joined #pact-go

javier.garcia_cotado
2021-03-09 21:52
has joined #pact-go

akos.csurai
2021-03-10 13:39
has joined #pact-go

akos.csurai
2021-03-10 14:11
@akos.csurai has left the channel

testme2020testme
2021-03-10 14:12
has joined #pact-go

tommy.mirchandani
2021-03-10 17:13
has joined #pact-go

varinderjitkaur13
2021-03-11 01:46
has joined #pact-go

bheemreddy181
2021-03-11 03:23
Can we use pact when we have internal packages which are used as interfaces to interact with provider services from multiple consumer services ? I assume it we can?t

matt.fellows
2021-03-11 03:24
do you mean like client libs?

bheemreddy181
2021-03-11 03:58
Yes client libs ?

bheemreddy181
2021-03-11 04:00
I assume the idea is not to write client libs and write the interfaces directly in the application so that requests and responses are pretty much defined for each application uniquely


bheemreddy181
2021-03-11 04:01
So that it explains easier what requests are sent and responses are read

bheemreddy181
2021-03-11 04:08
Ah there is a trade off but can be done

bheemreddy181
2021-03-11 04:09
Is this the same case for Ruby client gems as well ?

matt.fellows
2021-03-11 04:10
I can?t think of a reason it wouldn?t

bheemreddy181
2021-03-11 04:10
Makes sense

bheemreddy181
2021-03-11 04:10
But the major benefit of contract testing is missing here I feel

bheemreddy181
2021-03-11 04:11
Something is better than nothing

matt.fellows
2021-03-11 04:12
yeah, the latter

matt.fellows
2021-03-11 04:12
Also search https://docs.pact.io/slack/general.html for ?client library?. The threads sadly don?t format well here, but you might find some useful historical conversations

bheemreddy181
2021-03-11 04:13
Any graphQL examples do you have handy for Ruby or Go ?

aniket.g2185
2021-03-11 04:13
Hey @matt.fellows, you have any updates on this by any chance?

matt.fellows
2021-03-11 04:14
hmmm no sorry

matt.fellows
2021-03-11 04:15
-> https://docs.pact.io/slack/general.html#1610034769.384400 is also useful. I think you could apply contract tests using this strategy: https://docs.pact.io/slack/general.html#1610103444.390600

matt.fellows
2021-03-11 04:15
Actually timing is good, I?m working on this today

matt.fellows
2021-03-11 04:16
I ran into an issue where the provider libs weren?t working with Mac. I figured it out

aniket.g2185
2021-03-11 04:16
Wow awesome :ok_hand:


aniket.g2185
2021-03-11 04:17
K cool, I will look for it

aniket.g2185
2021-03-11 04:18
So I need to use it as v3 right?

matt.fellows
2021-03-11 04:18
yeah


aniket.g2185
2021-03-11 04:19
Cool

matt.fellows
2021-03-11 04:19
Do note that the namespace/packages are likely to change, but the interface is unlikely to change significantly

aniket.g2185
2021-03-11 04:19
Ok sure

matt.fellows
2021-03-11 04:23
Let me know how you go. I?ll be offline for a bit, but back online later

aniket.g2185
2021-03-11 04:27
Yep, I would need some time as well

krcl.dev
2021-03-11 05:11
has joined #pact-go

aniket.g2185
2021-03-11 06:17
@matt.fellows, I did a go get on the latest commit from the branch you mentioned

aniket.g2185
2021-03-11 06:18
I am getting some `clang` error regarding mock server directory

aniket.g2185
2021-03-11 06:19
Sorry its about `libpact_verifier_ffi.dylib`

matt.fellows
2021-03-11 06:21
ok sorry

matt.fellows
2021-03-11 06:21
I think I know what it will be

matt.fellows
2021-03-11 06:21
maybe :stuck_out_tongue:

matt.fellows
2021-03-11 06:22
So basically, the new package needs to get the FFI bindings from https://github.com/pact-foundation/pact-reference/releases

aniket.g2185
2021-03-11 06:23
Another file is `libpact_mock_server_ffi.dylib`

matt.fellows
2021-03-11 06:23
yep, same problem

matt.fellows
2021-03-11 06:23
Originally, I wanted to do that at runtime - but alas, with CGO I don?t think I can make that work. The code won?t run unless the lib is there, but want the code to be able to fetch the lib

matt.fellows
2021-03-11 06:23
so I?ve briefly added a command to download and install the lib

matt.fellows
2021-03-11 06:23
This works locally, but I haven?t yet tested what this looks like when consumed

matt.fellows
2021-03-11 06:24
can you please post the error?

matt.fellows
2021-03-11 06:24
actually, is there a `pact-go` command now available on your path?

aniket.g2185
2021-03-11 06:25
Yes

matt.fellows
2021-03-11 06:25
cool

matt.fellows
2021-03-11 06:26
OK, here is where the fun begins :stuck_out_tongue:

aniket.g2185
2021-03-11 06:26
:grinning:

aniket.g2185
2021-03-11 06:26
Do you want me to download ffi artifacts from releases and place it manually?

matt.fellows
2021-03-11 06:26
(I should note, there is a simple workaround in the meantime, but I?m keen to know how this works as is)

matt.fellows
2021-03-11 06:27
that?s the workaround! :stuck_out_tongue:

aniket.g2185
2021-03-11 06:27
Yeah I might have to add that in my install tools section of makefile

matt.fellows
2021-03-11 06:27
first, could you please run `pact-go -l DEBUG install` from the base of your project?

aniket.g2185
2021-03-11 06:27
Ok

aniket.g2185
2021-03-11 06:28
Oh it seems this command did download those files

matt.fellows
2021-03-11 06:29
good, that was the plan

matt.fellows
2021-03-11 06:29
the question is.. is it in the right place!

aniket.g2185
2021-03-11 06:29
But it download under my project folder

aniket.g2185
2021-03-11 06:29
Not the path where pact says its missing

matt.fellows
2021-03-11 06:29
ok, where does pact say it wants it - relative to the pact-go project?

aniket.g2185
2021-03-11 06:29
Yep

aniket.g2185
2021-03-11 06:30
Under go pkg

matt.fellows
2021-03-11 06:30
ok cool

matt.fellows
2021-03-11 06:30
cd into that project base directory and try again :stuck_out_tongue:

aniket.g2185
2021-03-11 06:30
Sure

aniket.g2185
2021-03-11 06:32
It says your pact lib version is out of date

aniket.g2185
2021-03-11 06:32
Cos the version I pulled by go get is 1.4.4

matt.fellows
2021-03-11 06:32
can you please print the output?

aniket.g2185
2021-03-11 06:33
Also mkdir is permission denied

aniket.g2185
2021-03-11 06:33
It's not able to create lib folder

matt.fellows
2021-03-11 06:33
I?m wondering if it?s simpler to specify a path - e.g. `/opt/pact` and just ensure the libs are installed there, instead of trying to be too clever

matt.fellows
2021-03-11 06:34
or `/usr/local/pact` on Mac - I should confirm by the way, what OS are you using?

aniket.g2185
2021-03-11 06:34
It's weird though, go path is under my user, why should it say permission denied

aniket.g2185
2021-03-11 06:35
I am on mac

aniket.g2185
2021-03-11 06:36
There is no write permission to that dir

matt.fellows
2021-03-11 06:36
strange

matt.fellows
2021-03-11 06:37
ok

matt.fellows
2021-03-11 06:37
give me a moment, I?ll see if I can make the `/opt/pact` change

aniket.g2185
2021-03-11 06:38
Sure :+1:

matt.fellows
2021-03-11 06:41
OK, it now goes into `/opt/pact`

matt.fellows
2021-03-11 06:42
I know whatever directory I choose, someone will have an opinion about it. It might end up in `/tmp` despite it being ephemeral :grimacing:

aniket.g2185
2021-03-11 06:43
K let me get the latest

matt.fellows
2021-03-11 06:44
np

matt.fellows
2021-03-11 06:44
so I need to update the installer, so let?s just ignore that for now

matt.fellows
2021-03-11 06:44
Let me manually do the steps, and share with you

matt.fellows
2021-03-11 06:46
cool. So if I don?t have the libs installed, I get this: ```mkdir -p ./examples/v3/pacts # LOG_LEVEL=trace go test -v -tags=consumer -count=1 http://github.com/pact-foundation/pact-go/examples/v3/... LOG_LEVEL=trace go test -v -timeout=10s -tags=provider -count=1 http://github.com/pact-foundation/pact-go/examples/v3/... -run TestV3HTTPProvider # http://github.com/pact-foundation/pact-go/v3/internal/native/mock_server Apple clang version 12.0.0 (clang-1200.0.32.29) Target: x86_64-apple-darwin19.6.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin clang: error: no such file or directory: '/opt/pact/libpact_mock_server_ffi.dylib' # http://github.com/pact-foundation/pact-go/v3/internal/native/verifier Apple clang version 12.0.0 (clang-1200.0.32.29) Target: x86_64-apple-darwin19.6.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin clang: error: no such file or directory: '/opt/pact/libpact_verifier_ffi.dylib' FAIL http://github.com/pact-foundation/pact-go/examples/v3 [build failed] FAIL make: *** [pactv3] Error 2``` But then if I run the following: ```? pact-go git:(feat/v3-ffi-verifier) ? ./bin/pact-go -l DEBUG install <aws:cloudsploit-dev> 2021/03/11 17:46:44 [DEBUG] checking version for lib libpact_verifier_ffi semver range >= 0.0.2, < 1.0.0 2021/03/11 17:46:44 [DEBUG] package libpact_verifier_ffi not found 2021/03/11 17:46:44 [DEBUG] downloading library from https://github.com/pact-foundation/pact-reference/releases/download/pact_verifier_ffi-v0.0.2/libpact_verifier_ffi-osx-x86_64.dylib.gz to /opt/pact/libpact_verifier_ffi.dylib 2021/03/11 17:46:45 [DEBUG] downloading library from https://github.com/pact-foundation/pact-reference/releases/download/libpact_mock_server_ffi-v0.0.15/libpact_mock_server_ffi-osx-x86_64.dylib.gz to /opt/pact/libpact_mock_server_ffi.dylib 2021/03/11 17:46:46 [INFO] setting install_name on library libpact_verifier_ffi for osx 2021/03/11 17:46:46 [DEBUG] output from command [] 2021/03/11 17:46:46 [INFO] setting install_name on library libpact_mock_server_ffi for osx 2021/03/11 17:46:46 [DEBUG] output from command [] 2021/03/11 17:46:46 [DEBUG] checking version for lib libpact_verifier_ffi semver range >= 0.0.2, < 1.0.0 2021/03/11 17:46:46 [DEBUG] checking version for lib libpact_mock_server_ffi semver range >= 0.0.15, < 1.0.0```

matt.fellows
2021-03-11 06:47
and then my tests run

matt.fellows
2021-03-11 06:47
brb

aniket.g2185
2021-03-11 06:48
I believe the permission issue is specific to my machine

aniket.g2185
2021-03-11 06:49
Let me sort that out

aniket.g2185
2021-03-11 06:49
For now I had to use `sudo`

matt.fellows
2021-03-11 06:51
yeah, I must have `chown`?d my `/opt`

matt.fellows
2021-03-11 06:51
on linux it should be for users, but on a mac it seems not

matt.fellows
2021-03-11 06:52
I?m now leaning towards just adding it to home directories!

aniket.g2185
2021-03-11 06:53
Our CI runs on Linux, so should not be a problem there, but locally all devs would have to chown or use sudo

aniket.g2185
2021-03-11 06:54
Also pact-go seems to be creating libs folder , but now it's looking for libs under /opt/pact

aniket.g2185
2021-03-11 06:54
Not /opt/libs

matt.fellows
2021-03-11 06:56
it should be going into `/opt/pact`

aniket.g2185
2021-03-11 06:56
Now it says cannot open file for architecture x86_64

aniket.g2185
2021-03-11 06:57
Linker command failed

matt.fellows
2021-03-11 06:57
I have verbose linking on to help diagnose

matt.fellows
2021-03-11 06:57
so what does `ls -l /opt/pact` give you?

aniket.g2185
2021-03-11 06:59
Let me chown the files

aniket.g2185
2021-03-11 07:02
Let me sign in from my Mac to share with you the message

matt.fellows
2021-03-11 07:03
oh, are you on mobile or something?

aniket.g2185
2021-03-11 07:03
Yes

matt.fellows
2021-03-11 07:03
ah!

aniket.g2185
2021-03-11 07:07
```# http://github.com/pact-foundation/pact-go/v3/internal/native/mock_server Apple clang version 12.0.0 (clang-1200.0.32.28) Target: x86_64-apple-darwin19.6.0 Thread model: posix InstalledDir: /Users/aniket.gadre/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin "/Users/aniket.gadre/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Users/aniket.gadre/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch x86_64 -platform_version macos 10.15.0 10.15.6 -syslibroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -o $WORK/b462/_cgo_.o -L/usr/local/lib $WORK/b462/_cgo_main.o $WORK/b462/_x001.o $WORK/b462/_x002.o $WORK/b462/_x003.o /opt/pact/libpact_mock_server_ffi.dylib -lSystem /Users/aniket.gadre/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/lib/darwin/libclang_rt.osx.a # http://github.com/pact-foundation/pact-go/v3/internal/native/verifier Apple clang version 12.0.0 (clang-1200.0.32.28) Target: x86_64-apple-darwin19.6.0 Thread model: posix InstalledDir: /Users/aniket.gadre/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin "/Users/aniket.gadre/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Users/aniket.gadre/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch x86_64 -platform_version macos 10.15.0 10.15.6 -syslibroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -o $WORK/b463/_cgo_.o -L/usr/local/lib $WORK/b463/_cgo_main.o $WORK/b463/_x001.o $WORK/b463/_x002.o $WORK/b463/_x003.o /opt/pact/libpact_verifier_ffi.dylib -lSystem /Users/aniket.gadre/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/lib/darwin/libclang_rt.osx.a # http://gitlab.myteksi.net/dakota/customer-experience/handlers.test Apple clang version 12.0.0 (clang-1200.0.32.28) Target: x86_64-apple-darwin19.6.0 Thread model: posix InstalledDir: /Users/aniket.gadre/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin "/Users/aniket.gadre/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Users/aniket.gadre/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch x86_64 -platform_version macos 10.15.0 10.15.6 -syslibroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -o $WORK/b332/handlers.test -L/usr/local/lib -S -no_pie -pagezero_size 4000000 /var/folders/hf/s_d1x8qj3_78_gf6zm1gn3d40000gr/T/go-link-002309112/go.o /var/folders/hf/s_d1x8qj3_78_gf6zm1gn3d40000gr/T/go-link-002309112/000000.o /var/folders/hf/s_d1x8qj3_78_gf6zm1gn3d40000gr/T/go-link-002309112/000001.o /var/folders/hf/s_d1x8qj3_78_gf6zm1gn3d40000gr/T/go-link-002309112/000002.o /var/folders/hf/s_d1x8qj3_78_gf6zm1gn3d40000gr/T/go-link-002309112/000003.o /var/folders/hf/s_d1x8qj3_78_gf6zm1gn3d40000gr/T/go-link-002309112/000004.o /var/folders/hf/s_d1x8qj3_78_gf6zm1gn3d40000gr/T/go-link-002309112/000005.o /var/folders/hf/s_d1x8qj3_78_gf6zm1gn3d40000gr/T/go-link-002309112/000006.o /var/folders/hf/s_d1x8qj3_78_gf6zm1gn3d40000gr/T/go-link-002309112/000007.o /var/folders/hf/s_d1x8qj3_78_gf6zm1gn3d40000gr/T/go-link-002309112/000008.o /var/folders/hf/s_d1x8qj3_78_gf6zm1gn3d40000gr/T/go-link-002309112/000009.o /var/folders/hf/s_d1x8qj3_78_gf6zm1gn3d40000gr/T/go-link-002309112/000010.o /var/folders/hf/s_d1x8qj3_78_gf6zm1gn3d40000gr/T/go-link-002309112/000011.o /var/folders/hf/s_d1x8qj3_78_gf6zm1gn3d40000gr/T/go-link-002309112/000012.o /var/folders/hf/s_d1x8qj3_78_gf6zm1gn3d40000gr/T/go-link-002309112/000013.o /var/folders/hf/s_d1x8qj3_78_gf6zm1gn3d40000gr/T/go-link-002309112/000014.o /var/folders/hf/s_d1x8qj3_78_gf6zm1gn3d40000gr/T/go-link-002309112/000015.o /var/folders/hf/s_d1x8qj3_78_gf6zm1gn3d40000gr/T/go-link-002309112/000016.o /var/folders/hf/s_d1x8qj3_78_gf6zm1gn3d40000gr/T/go-link-002309112/000017.o /var/folders/hf/s_d1x8qj3_78_gf6zm1gn3d40000gr/T/go-link-002309112/000018.o /var/folders/hf/s_d1x8qj3_78_gf6zm1gn3d40000gr/T/go-link-002309112/000019.o /var/folders/hf/s_d1x8qj3_78_gf6zm1gn3d40000gr/T/go-link-002309112/000020.o /var/folders/hf/s_d1x8qj3_78_gf6zm1gn3d40000gr/T/go-link-002309112/000021.o /var/folders/hf/s_d1x8qj3_78_gf6zm1gn3d40000gr/T/go-link-002309112/000022.o /var/folders/hf/s_d1x8qj3_78_gf6zm1gn3d40000gr/T/go-link-002309112/000023.o /opt/pact/libpact_mock_server_ffi.dylib /opt/pact/libpact_verifier_ffi.dylib -lpthread -framework CoreFoundation -framework Security -lSystem /Users/aniket.gadre/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/lib/darwin/libclang_rt.osx.a dyld: Library not loaded: ../../libs/libpact_mock_server_ffi.dylib Referenced from: /var/folders/hf/s_d1x8qj3_78_gf6zm1gn3d40000gr/T/go-build392475533/b332/handlers.test Reason: image not found```

matt.fellows
2021-03-11 07:08
ah! I think I know what?s happening

matt.fellows
2021-03-11 07:08
did you copy those files there by any chance?

matt.fellows
2021-03-11 07:08
either way, delete those files and run the install step again


aniket.g2185
2021-03-11 07:09
I had to rename the folder cos `go-pact` created `lib` folder instead of `pact`

matt.fellows
2021-03-11 07:10
have you pulled the latest?

matt.fellows
2021-03-11 07:10
I just ran it here, and it creates them in `/opt/pact/`

aniket.g2185
2021-03-11 07:10
I hope it will come as part of `go get` ?

matt.fellows
2021-03-11 07:10
to the best of my knowledge, that?s not possible

aniket.g2185
2021-03-11 07:10
I pulled the latest commit from `go get`

matt.fellows
2021-03-11 07:11
if you know how though, I?m all ears

aniket.g2185
2021-03-11 07:11
`go get http://github.com/pact-foundation/pact-go@5f21f62` , instead of version , provide commit hash

matt.fellows
2021-03-11 07:12
> I hope it will come as part of `go get` ? Oh, sorry I thought you meant `go get` could download and install the lib deps. That would have been nice

aniket.g2185
2021-03-11 07:12
ah ok, haha

aniket.g2185
2021-03-11 07:14
how can I update `pact-go` ?

aniket.g2185
2021-03-11 07:14
its still pulling under libs

aniket.g2185
2021-03-11 07:15
`ls` tells me it was updated 30 mins back

matt.fellows
2021-03-11 07:16
mmm

matt.fellows
2021-03-11 07:16
the binary or the package?

aniket.g2185
2021-03-11 07:16
binary

matt.fellows
2021-03-11 07:17
good question

matt.fellows
2021-03-11 07:17
Strange that go get doesn?t do that?

matt.fellows
2021-03-11 07:17
`go build -a` seems to be the answer, but double check that :stuck_out_tongue:


aniket.g2185
2021-03-11 07:18
`go get` seems to be doing that but then I expect it to download libs under /opt/pact

matt.fellows
2021-03-11 07:20
maybe just do it by hand?

matt.fellows
2021-03-11 07:20
`go build <path to pact-go> -o pact-go`

matt.fellows
2021-03-11 07:22
I have to run in a second I?m afraid - dinner time and I?m pushing it uphill against wife and kids - but keen to get the install bit runnig

aniket.g2185
2021-03-11 07:22
no worries, I will get this sorted

matt.fellows
2021-03-11 07:23
kk

matt.fellows
2021-03-11 07:23
I?ll be back online a little later (couple of hours) to follow up

aniket.g2185
2021-03-11 07:23
sure

matt.fellows
2021-03-11 07:23
Sorry about the hassles, but you?re helping make this easier for others - so :pray:

matt.fellows
2021-03-11 07:23
it?s worth it!

matt.fellows
2021-03-11 07:23
(and I/we are very grateful)

aniket.g2185
2021-03-11 07:37
No worries mate

aniket.g2185
2021-03-11 07:37
btw I built the lib from source and its still trying to pull the files under `lib` folder

matt.fellows
2021-03-11 07:40
Gah!

aniket.g2185
2021-03-11 07:41
wow, my installer.go is not even showing updated code :smile:

aniket.g2185
2021-03-11 07:41
let me see whats happening

matt.fellows
2021-03-11 07:41
:thinking_face:

matt.fellows
2021-03-11 07:41
I was about to say open that file

matt.fellows
2021-03-11 07:41
Just also check it's in the v3 subfolder

aniket.g2185
2021-03-11 07:41
yes , it is in v3

aniket.g2185
2021-03-11 07:42
my bad

aniket.g2185
2021-03-11 07:42
:disappointed:

aniket.g2185
2021-03-11 07:42
I pulled a wrong commit

aniket.g2185
2021-03-11 07:51
I got the correct commit, I built the binary and its still pulling under `lib` , oh man

matt.fellows
2021-03-11 08:22
:exploding_head:

matt.fellows
2021-03-11 08:23
Have a look at the source, maybe I've got something wrong?

matt.fellows
2021-03-11 08:23
Maybe it's not detected the OS correctly

aniket.g2185
2021-03-11 09:17
yeah I suspect same thing, let me get back to you on this in sometime as I am stepping out

aniket.g2185
2021-03-11 12:08
@matt.fellows, I see you have created one more branch `feat-v3-ffi-verifier-tmp` which has one more commit setting path for OSX

aniket.g2185
2021-03-11 12:14
Its executing the tests now

matt.fellows
2021-03-11 12:21
ah, I?m mucking about with lib paths and things

matt.fellows
2021-03-11 12:21
are you using it or the other one?

aniket.g2185
2021-03-11 12:26
it worked when I got the latest commit from branch `feat-v3-ffi-verifier-tmp`

aniket.g2185
2021-03-11 12:26
btw logging looks pretty messed up

aniket.g2185
2021-03-11 12:27
```12:25:42 [INFO] Running provider state change handler 'a new user' for 'a request for onboarding configuration' Given a new user 2021/03/11 20:25:42 [INFO] executing state handler middleware```

aniket.g2185
2021-03-11 12:27
if you see , its logging in 2 diff formats

matt.fellows
2021-03-11 12:28
yes, one is coming from the library, and one from Pact Go

matt.fellows
2021-03-11 12:28
It?s on the list to find a way to amalgamate it

matt.fellows
2021-03-11 12:28
preferably, logging is disabled by the shared library, and we get back a response to log within the pact-go framework


matt.fellows
2021-03-11 12:29
(no diff yet!)

aniket.g2185
2021-03-11 12:33
oh then I was again pulling the wrong commit (2nd last one) :pensive:

matt.fellows
2021-03-11 12:34
:laughing:

aniket.g2185
2021-03-11 12:34
```12:25:42 [INFO] Sending request to provider at http://localhost:56808/```

aniket.g2185
2021-03-11 12:34
which url is this?

matt.fellows
2021-03-11 12:34
it?s a local proxy, same as the current `master` branch

matt.fellows
2021-03-11 12:34
it?s responsible for magic, for example, the provider state handlers and other hooks

matt.fellows
2021-03-11 12:35
it also allows us to use native go TLS/HTTP client features, which otherwise wouldn?t be available to us (because the request would be initiated from the underlying library code)

aniket.g2185
2021-03-11 12:35
ohh so it goes via this proxy to update request which then hits actual provider url

matt.fellows
2021-03-11 12:35
?it?s also responsible for the message pact handling

matt.fellows
2021-03-11 12:35
correct

matt.fellows
2021-03-11 12:36
it comes out as INFO now, as the rust lib we are using is not aware of the proxy, so thinks it?s actually the final target

matt.fellows
2021-03-11 12:36
again, hope to clean this up

matt.fellows
2021-03-11 12:36
but, it?s working???

aniket.g2185
2021-03-11 12:36
ok, it might confuse users in thinking they are hitting wrong port :smile:

matt.fellows
2021-03-11 12:37
correct, so more logging (to essentially prepare for that confusion) or less (hide the rust output and control from go) could solve it

aniket.g2185
2021-03-11 12:38
I haven't yet tried the parameterized state provider, was trying to get easy one working first

aniket.g2185
2021-03-11 12:39
which component is written in Rust ? The proxy ?

matt.fellows
2021-03-11 12:39
yep, that?s sensible

matt.fellows
2021-03-11 12:39
the core library that is being imported. In this case, the engine that reads the pact files, replays them against the service, and reports back the output

matt.fellows
2021-03-11 12:40
we have 12 languages to support, and that logic is actually quite complicated. So a shared core is the model we currently have (uses Ruby), but moving to a Rust one

matt.fellows
2021-03-11 12:40
much faster, and has a bunch of other benefits

matt.fellows
2021-03-11 12:40
I advocated for Go, but didn?t have the time to do it myself :stuck_out_tongue:

matt.fellows
2021-03-11 12:40
so I lost

matt.fellows
2021-03-11 12:40
but, it?s actually quite good

aniket.g2185
2021-03-11 12:41
Rust is awesome ! :smile: I think I should look for ways to contribute


aniket.g2185
2021-03-11 12:42
``` a request for onboarding configuration returns a response which has status code 200 (OK) includes headers "Content-Type" with value "application/json; charset=UTF-8" (OK) has a matching body (OK) 12:25:42 [ERROR] Failed to load pact - Failed to load pact '<MY_SERVICE_PATH>/handlers/../pacts/android-app-customer-experience.json' - Request failed - builder error: relative URL without a base```

aniket.g2185
2021-03-11 12:42
I see this weird thing, PACT test executed fine but later I see an error to load pact file, which was actually loaded fine

matt.fellows
2021-03-11 12:42
hmm

matt.fellows
2021-03-11 12:43
what?s the code look like?

aniket.g2185
2021-03-11 12:46
sorted, it originated from `pactUrls` field, not sure if in `v2` this field accepted file path as well

matt.fellows
2021-03-11 12:47
yep, it should take both I think.

aniket.g2185
2021-03-11 12:47
cos I see both `PactFiles` and `PactUrls` field for `VerifyRequest`

aniket.g2185
2021-03-11 12:47
along with `PactDirs`

matt.fellows
2021-03-11 12:48
Files -> actual local files Urls -> remote files Dirs -> directories containing files PactBrokerUrl -> find dynamically from a broker

matt.fellows
2021-03-11 12:48
it?s a bit more verbose, but that?s the library :man-shrugging:

matt.fellows
2021-03-11 12:48
it should be documented ? think

aniket.g2185
2021-03-11 12:48
makes sense, I believe in V2 local file path worked for Url as well, now it complains

aniket.g2185
2021-03-11 12:48
not sure though

matt.fellows
2021-03-11 12:50
yes, I think that?s right

aniket.g2185
2021-03-11 15:25
the provider state param I am receiving is `nil`

aniket.g2185
2021-03-11 15:26
```"a user whose application can be updated": func(s v3.ProviderStateV3) error { ... }```

aniket.g2185
2021-03-11 15:26
s is `nil` here

krishnaraoveera1294
2021-03-11 17:53
has joined #pact-go

matt.fellows
2021-03-11 22:14
hmm, what does the pact file look like?

raghavendra.kalakonda
2021-03-11 23:08
has joined #pact-go

aniket.g2185
2021-03-12 00:41
```{ "description": "a request to update the existing onboarding application", "request": { "method": "PUT", "path": "/onboarding/applications/1", "headers": { "Content-Type": "application/json; charset=UTF-8" }, "body": { "fields": [ { "value": "Alice", "key": "Name" } ] }, "matchingRules": { "body": { "$.fields": { "matchers": [ { "match": "type" } ], "combine": "AND" }, "$.fields[*].key": { "matchers": [ { "match": "type" } ], "combine": "AND" }, "$.fields[*].value": { "matchers": [ { "match": "type" } ], "combine": "AND" } } }, "generators": { "path": { "type": "ProviderState", "expression": "/onboarding/applications/${uuid}", "dataType": "STRING" } } }, "response": { "status": 200, "headers": { "Content-Type": "application/json; charset=UTF-8" }, "body": { "channel": "MY_INFO", "uuid": 1, "forms": [ { "name": "Personal Info", "fields": [ { "editable": true, "dataType": "a", "name": "Name", "value": "Alice", "key": "name", "required": true } ], "key": "personalInfo" } ] }, "matchingRules": { "body": { "$.uuid": { "matchers": [ { "match": "type" } ], "combine": "AND" }, "$.forms": { "matchers": [ { "match": "type" } ], "combine": "AND" }, "$.forms[*].key": { "matchers": [ { "match": "type" } ], "combine": "AND" }, "$.forms[*].name": { "matchers": [ { "match": "type" } ], "combine": "AND" }, "$.forms[*].fields": { "matchers": [ { "match": "type" } ], "combine": "AND" }, "$.forms[*].fields[*].name": { "matchers": [ { "match": "type" } ], "combine": "AND" }, "$.forms[*].fields[*].key": { "matchers": [ { "match": "type" } ], "combine": "AND" }, "$.forms[*].fields[*].value": { "matchers": [ { "match": "type" } ], "combine": "AND" }, "$.forms[*].fields[*].dataType": { "matchers": [ { "match": "regex", "regex": "[string|enum|date|bool]" } ], "combine": "AND" }, "$.forms[*].fields[*].editable": { "matchers": [ { "match": "type" } ], "combine": "AND" }, "$.forms[*].fields[*].required": { "matchers": [ { "match": "type" } ], "combine": "AND" } }, "header": { "Content-Type": { "matchers": [ { "match": "regex", "regex": "application/json(;\\s?charset=[\\w\\-]+)?" } ], "combine": "AND" } } }, "generators": { "body": { "$.uuid": { "type": "ProviderState", "expression": "uuid", "dataType": "INTEGER" }, "$.forms[*].fields[*].dataType": { "type": "Regex", "regex": "[string|enum|date|bool]" } } } }, "providerStates": [ { "name": "a user whose application is in draft state", "params": { "uuid": "1" } } ] }```

aniket.g2185
2021-03-12 00:42
Its a path param being parameterized with below code ``` .pathFromProviderState(applicationsEndpoint + "/${uuid}", applicationsEndpoint + "/1")```

aniket.g2185
2021-03-12 00:55
If I print s this is what I get ```2021/03/12 08:54:44 State invoked with s as {a user whose application is in draft state <nil>} ```

aniket.g2185
2021-03-12 00:55
so it seems params are nil

matt.fellows
2021-03-12 01:33
Thank you. Should hopefully be an easy fix

aniket.g2185
2021-03-12 02:48
Console logs generated by Pact in GO are overwhelming

matt.fellows
2021-03-12 02:50
which ones specifically?

matt.fellows
2021-03-12 02:50
I currently have the -v flag on for linking whilst we sort through that

matt.fellows
2021-03-12 02:50
you can specify the log level to reduce the noise of course

aniket.g2185
2021-03-12 03:23
This is from V2, I am back to V2 till V3 issue is sorted :smile: The logs I am talking about are the ones printing out every match for body, header , status

aniket.g2185
2021-03-12 03:23
```=== RUN TestCustomerExperienceServiceProvider/has_status_code_200#01 pact.go:629: Verifying a pact between android-app and customer-experience Given a user whose application is in draft state a request for onboarding configuration with GET /onboarding/configurations returns a response which has status code 200 === RUN TestCustomerExperienceServiceProvider/has_a_matching_body#02 pact.go:629: Verifying a pact between android-app and customer-experience Given a user whose application is in draft state a request for onboarding configuration with GET /onboarding/configurations returns a response which has a matching body === RUN TestCustomerExperienceServiceProvider/"Content-Type"_which_matches_/application\/json(;\s?charset=[\w\-]+)?/#02 pact.go:629: Verifying a pact between android-app and customer-experience Given a user whose application is in draft state a request for onboarding configuration with GET /onboarding/configurations returns a response which includes headers "Content-Type" which matches /application\/json(;\s?charset=[\w\-]+)?/ === RUN TestCustomerExperienceServiceProvider/has_status_code_200#02```

aniket.g2185
2021-03-12 03:23
These are being printed for test which ran fine, is there any way I can print logs only if it fails ?

aniket.g2185
2021-03-12 03:25
Also I do not see a good summary of which one fails and which one passed

matt.fellows
2021-03-12 03:29
I think by default go will only print logs if it fails, unless you pass `-v`

aniket.g2185
2021-03-12 03:29
Oh let me check on verbose setting

aniket.g2185
2021-03-12 06:55
@matt.fellows, are you planning to fix this anytime soon ?

andries.spies
2021-03-12 07:25
has joined #pact-go

matt.fellows
2021-03-12 07:42
It looks like it might be a downstream issue

matt.fellows
2021-03-12 07:43
Upstream, sorry

matt.fellows
2021-03-12 07:43
The values aren't coming thru

matt.fellows
2021-03-12 07:43
So, yes, but its a next week thing I'd say

aniket.g2185
2021-03-12 07:43
Sure , no worries

matt.fellows
2021-03-12 07:43
:+1:

aniket.g2185
2021-03-12 09:43
any idea about below error ? Not sure why is it complaining about having more elements despite using `minArrayLike` ```Diff -------------------------------------- Key: - is expected + is actual Matching keys and values are not shown { "fields": [ ... , - Pact::UnexpectedIndex, - Pact::UnexpectedIndex, + Hash, + Hash, ] } ] Description of differences -------------------------------------- * Actual array is too long and should not contain a Hash at $.forms[0].fields[1] * Actual array is too long and should not contain a Hash at $.forms[0].fields[2]```

aniket.g2185
2021-03-12 09:57
sorted

kamil.klima
2021-03-12 11:38
has joined #pact-go

matt.fellows
2021-03-13 02:36
OK i?ve fixed the issue. I?d like to address it in the upstream lib, but that should be transparent to you so it should be usable

matt.fellows
2021-03-13 02:36
one thing to note, is that the state setup signature has changed (now accepts a ?setup? boolean, so you can do a setup and teardown action on the specific state)

matt.fellows
2021-03-13 02:36
latest change pushed (also the installer should be better too)

aniket.g2185
2021-03-13 02:37
Awesome @matt.fellows, let me give it a try

matt.fellows
2021-03-13 02:51
No hurries. I had a little play this morning and got it to work. Needs tidying up, tests etc but the example works

aniket.g2185
2021-03-13 03:45
I am not so clear about this section ```// Optionally (if there are generators in the pact) return provider state values to be used in the verification (only ) return v3.ProviderStateV3Response{"id": "bar"}, nil```

matt.fellows
2021-03-13 03:45
Just return nil for now

matt.fellows
2021-03-13 03:46
Needs more docs, new feature in v3 pact

aniket.g2185
2021-03-13 03:47
ok

aniket.g2185
2021-03-13 03:49
can the `params` interface casted to `map[string]string` ?

matt.fellows
2021-03-13 03:49
Probably not safely, depends on the values

matt.fellows
2021-03-13 03:49
It's a JSON blob

matt.fellows
2021-03-13 03:49
Why?

aniket.g2185
2021-03-13 03:50
I tried to cast it into json, didn't work

aniket.g2185
2021-03-13 03:52
This is what I get when I print the interface value `value of s.Params map[uuid:1]`

aniket.g2185
2021-03-13 03:53
I tried casting it to ```type params struct { UUID string }```

aniket.g2185
2021-03-13 03:53
let me try again, I will get back in sometime

matt.fellows
2021-03-13 03:55
Maybe `interface` would be better, or the raw string/bytes

matt.fellows
2021-03-13 03:55
?

aniket.g2185
2021-03-13 03:56
I tried this ``` type params struct { UUID string `json:"uuid"` } if p, ok := s.Parameters.(params); ok { ... }```

matt.fellows
2021-03-13 04:12
Did it work?

matt.fellows
2021-03-13 04:12
If you like, hack the censored code locally to see what is the nicest experience and we can change it

matt.fellows
2021-03-13 04:43
Censored = vendored (autocorrect)

aniket.g2185
2021-03-13 06:42
`map[string]interface{}` works

aniket.g2185
2021-03-13 06:53
I am able to fetch value from provider state but it seems my call to API is failing

aniket.g2185
2021-03-13 06:56
I have this generator ```"generators": { "path": { "type": "ProviderState", "expression": "/applications/${uuid}", "dataType": "STRING" } }``` and it seems call to my API is made with `${uuid}` as the path param instead of actual UUID. Is this what you were talking about which needs to be returned from provider State?

matt.fellows
2021-03-13 07:46
Yes!

matt.fellows
2021-03-13 07:47
So I haven't actually used this feature so I'm a little hazy. I hope that you can just return a map with the `uuid` value to use in the actual API call

matt.fellows
2021-03-13 07:47
I'd love to know if it works!

aniket.g2185
2021-03-13 09:06
It doesn't

aniket.g2185
2021-03-13 09:11
I did return a map with uuid and its value but call is sill being made with `${uuid}`

matt.fellows
2021-03-13 09:18
Thx. I'll try and look tonight. I somewhat considered it but haven't tested it yet. Hopefully something simple tho. If you enable trace logging you might see more (bit can't guarantee that either)

aniket.g2185
2021-03-13 09:54
I will take a dig at it as well

aniket.g2185
2021-03-13 09:56
BTW V3 doesn't have a log file configuration like V2, has it been move to somewhere else or that kind of logging has been removed?

matt.fellows
2021-03-13 10:16
Found it. Needed an explicit content-type header - just pushed a minor fix for that

matt.fellows
2021-03-13 10:16
> BTW V3 doesn?t have a log file configuration like V2, has it been move to somewhere else or that kind of logging has been removed? I?d like to preserve that functionality, but need to work with the upstream lib to achieve it. As noted before, currently the library is also logging to stdout which I?d like to avoid

aniket.g2185
2021-03-13 10:17
When you say upstream lib is that the core lib being built in Rust ?

matt.fellows
2021-03-13 10:17
correct

aniket.g2185
2021-03-13 10:22
I am just going thru the code, is there any reason for exporting methods `BeforeEachMiddleware` and `AfterEachMiddleware` of `HttpVerifier` ?

matt.fellows
2021-03-13 10:23
no

matt.fellows
2021-03-13 10:23
lots of tidying up to do!

aniket.g2185
2021-03-13 10:25
also while appending middleware to the slice of middleware they have been appended in sequence `beforeEach` `afterEach` `StateHandlers` and `requestFilter` .. I believe `afterEach` should be added at last? or the sequence of execution is being taken care at some other place ?

matt.fellows
2021-03-13 10:27
ah, you?re testing my memory now!

aniket.g2185
2021-03-13 10:27
hahaha

aniket.g2185
2021-03-13 10:27
this is what comment says ```// Order of events: BeforeEach, stateHandlers, requestFilter(pre <execute provider> post), AfterEach``` but middleware are not added in that sequence

matt.fellows
2021-03-13 10:28
I believe they do run in the correct order. They run inside out, and only on the correct phase.

matt.fellows
2021-03-13 10:28
but? we can check!

aniket.g2185
2021-03-13 10:28
sure, I will check that

aniket.g2185
2021-03-13 10:28
let me try

aniket.g2185
2021-03-13 10:31
yep seems they are good :thumbsup:

matt.fellows
2021-03-13 10:31
phew

matt.fellows
2021-03-13 10:31
They do need tweaking for the new setup, because a state handler now also has 2 phases that needs to be considered

matt.fellows
2021-03-13 10:31
(setup, teardown)

aniket.g2185
2021-03-13 10:32
any specific reason to have setup , teardown for StateHandler ?

aniket.g2185
2021-03-13 10:32
I always saw stateHandler as setup

matt.fellows
2021-03-13 10:32
so, people ask for it


matt.fellows
2021-03-13 10:34
Sometimes, people want a specific state to setup, and then tear it down.

matt.fellows
2021-03-13 10:34
a general ?afterEach? hook doesn?t know what state is being used and isn?t local to the caller, so it makes for messier code

matt.fellows
2021-03-13 10:34
personally, I?ve never needed it

matt.fellows
2021-03-13 10:34
but :man-shrugging:

matt.fellows
2021-03-13 10:35
So in a way, the other lifecycle hooks might not be that useful!

matt.fellows
2021-03-13 10:36
This is the sequence I get

aniket.g2185
2021-03-13 10:37
yeah correct, the current `beforeEach` and `afterEach` are more generic and not specific to `stateHandler` , but I think it depends a bot on how you structure code and whether you can still make use of normal `afterEach` for teardown

aniket.g2185
2021-03-13 10:37
Yep, hooks are working fine, I tested as well

matt.fellows
2021-03-13 10:37
yep. So, we?ll give people the options and they can choose what makes most sense

matt.fellows
2021-03-13 10:37
I tend to use a standard ?afterEach? and just reset the table if needed, then specific states can do as they please

aniket.g2185
2021-03-13 10:39
What's the better way to do it, use actual DB or Mock it ?

matt.fellows
2021-03-13 10:39
It depends. If you have docker, that?s a good option

matt.fellows
2021-03-13 10:40
I tend to mock the DB because it?s faster. As long as you can preserve the interface to the db and have other tests for those layers, then it?s much simpler (IMO)

aniket.g2185
2021-03-13 10:40
for eg, u need lot of static tables loaded in DB before its useable, that would run all the SQL scripts every time you bring up a clean DB

matt.fellows
2021-03-13 10:40
In apps that maybe are harder to mock, externalise to Docker is my other goto

matt.fellows
2021-03-13 10:40
yeah

matt.fellows
2021-03-13 10:41
that?s where a specific state teardown might be useful, so you don?t have to clean the docker container each test

aniket.g2185
2021-03-13 10:42
As of now there is no global setup and teardown method right? which runs only once ? I think that can be handled the way normal Go test would do it

matt.fellows
2021-03-13 10:46
Yes, exactly why it?s not there :slightly_smiling_face:

aniket.g2185
2021-03-13 10:48
in V3 where can I set the log level ?

matt.fellows
2021-03-13 10:48
`v3.SetLogLevel("TRACE")`

aniket.g2185
2021-03-13 10:48
ah ok, thanks!

matt.fellows
2021-03-13 10:48
np

matt.fellows
2021-03-13 10:48
sorry I haven?t done docs yet

matt.fellows
2021-03-13 10:48
I also know the types are horrid e.g. `v3.ProviderStateV3` is not nice

matt.fellows
2021-03-13 10:49
Basically, I?ve been creating a side-by-side implementation of the existing one to keep things as close as possible to make migration easier - but that mean I needed to namespace things temporarily

aniket.g2185
2021-03-13 10:51
yep , but I think it should be ok if you have `ProviderState` type under v2 as well as v3, no ?

matt.fellows
2021-03-13 10:52
yeah, the new package will support v2 and v3 if that?s what you?re asking?

aniket.g2185
2021-03-13 10:52
yeah I mean even if it supports both, there shouldn't be conflict in types as they are under diff packages

aniket.g2185
2021-03-13 10:53
I mean it can just be `v3.ProviderState` than `v3.ProviderStateV3`

matt.fellows
2021-03-13 10:54
oh right, yes. I?m not sure they?ll be in separate sub-level packages yet, or typed explicitly (I?m leaning toward packages but there is a lot of overlapping code that I want to re-use)

matt.fellows
2021-03-13 10:54
we?ll see

aniket.g2185
2021-03-13 10:55
hmm, got it

matt.fellows
2021-03-13 10:56
of course, feedback would be helpful

matt.fellows
2021-03-13 10:56
I suspect some people will have the old package run in parallel with the new - so that could be a reason to namespace it

matt.fellows
2021-03-13 10:57
but really, I?d like to sunset the old package completely, but still support the v2 and v3 pacts

matt.fellows
2021-03-13 10:57
are you planning to run in parallel?

aniket.g2185
2021-03-13 10:57
I wanted to contribute to pact-go since long, now that I am fully working on Go, it should be a good time I guess

matt.fellows
2021-03-13 10:58
I better cleanup this code base then :wink:

matt.fellows
2021-03-13 10:58
where do you work, if you don?t mind me asking?

aniket.g2185
2021-03-13 10:58
My all micro-services are in Go, so if I can use consumer side v3 as well, I would prefer to stick to V3

matt.fellows
2021-03-13 10:58
3 hours behind Aus time, are you in southeast Asia somewhere? Singapore?

aniket.g2185
2021-03-13 10:58
the current one I am working on , consumer is android app, so I can use Java/Kotlin there

aniket.g2185
2021-03-13 10:59
Yeah I am based in SG

matt.fellows
2021-03-13 10:59
cool

aniket.g2185
2021-03-13 11:00
Where are you in AUS ?

matt.fellows
2021-03-13 11:06
Melbourne

matt.fellows
2021-03-13 11:07
where are you working in Singapore? I?ve never been, but have a bunch of friends/family that have been there for work

matt.fellows
2021-03-13 11:08
my best mate?s partner is from there

aniket.g2185
2021-03-13 11:08
I am working at `Grab` , started as Taxi hailing company , but are now in payments and lot of other domains

matt.fellows
2021-03-13 11:09
oh cool

matt.fellows
2021-03-13 11:09
do you know Kevin Littlejohn?

aniket.g2185
2021-03-13 11:10
I guess I attended one of his sessions, he works for APEX team

aniket.g2185
2021-03-13 11:10
I am pretty new to Grab, just 3 months in

matt.fellows
2021-03-13 11:10
APEX?

matt.fellows
2021-03-13 11:10
He used to work at DiUS (the company I work for) and we?ve worked / overlapped at other customers too (e.g. NAB - big 4 bank here)

matt.fellows
2021-03-13 11:10
really good guy though

aniket.g2185
2021-03-13 11:11
Wow thats nice, Didn't he promote PACT in Grab :smile: I am pushing for it , atleast for my project

aniket.g2185
2021-03-13 11:12
APEX - Is a developer/QA/SRE experience team, they build frameworks and other stuff for devs

aniket.g2185
2021-03-13 11:13
They use a lot of GRPC here, but I guess I have read your comments on how GRPC <> Contract and I agree to that

aniket.g2185
2021-03-13 11:23
```func (v *Verifier) Verify(args []string) int { log.Println("[DEBUG] executing verifier FFI with args", args) cargs := C.CString(strings.Join(args, "\n")) defer freeString(cargs) result := C.verify(cargs) return int(result) }``` Is this method calling the `Rust` code ?

matt.fellows
2021-03-13 11:23
yes!

matt.fellows
2021-03-13 11:23
thanks for advocating for us! If you?d like me to do a talk to the Grab engineering team I?d be more than happy to

matt.fellows
2021-03-13 11:24
as for gRPC, i?m not sure what you?ve read, but the current plan: 1. Create general https://github.com/pact-foundation/pact-specification/issues/83 for pact (requires projects to be using the rust core) 2. Create a gRPC and protobuf plugin(s)

matt.fellows
2021-03-13 11:25
It?s going to be a few months before good traction is made there, but I?m doing the work to get Go prepped into the Rust core so that adding the plugin interface should be a piece of cake

matt.fellows
2021-03-13 11:26
Ok my laptop battery just died. I'm off for the night, but appreciate your help here! Let me know how you get on and if you'd like me to chat with your team :pray:

aniket.g2185
2021-03-13 11:27
I am bit confused about this verifier thing, when does the hooks and Provider state execute ?

aniket.g2185
2021-03-13 11:27
No worries, GN mate

aniket.g2185
2021-03-13 12:47
Let me know if my understanding is correct about how verification process works 1. Pact core verification method makes the Rest call targeted at proxy 2. Call hits the proxy , which then executes Hooks, StateHandlers, RequestFilter 3. Call is forwarded to hit actual provider 4. Response comes back to proxy and after hook executes 5. Response goes back to core (and the required matchers are executed)

matt.fellows
2021-03-13 22:56
You got it

matt.fellows
2021-03-13 22:56
Or at least, that's the general gist of it

lswanborough
2021-03-15 00:50
has joined #pact-go

don.tobias
2021-03-15 19:35
has joined #pact-go

sagar.kathuria
2021-03-17 04:25
has joined #pact-go

shao.sum
2021-03-17 08:35
has joined #pact-go

riddhichopra
2021-03-18 01:28
has joined #pact-go

anu.de
2021-03-18 02:28
has joined #pact-go

sreyaslj
2021-03-18 04:25
has joined #pact-go

arvind1017
2021-03-18 22:48
has joined #pact-go

sushilvc84
2021-03-19 00:30
has joined #pact-go

tejakoshti7
2021-03-19 06:26
has joined #pact-go

mark.doppelfeld
2021-03-19 11:28
@aniket.g2185 I do get exactly the same error ... how did you solve it?

mark.doppelfeld
2021-03-19 11:29
I'm using a dsl.Like...

aniket.g2185
2021-03-19 11:30
do you have nested `Like`

mark.doppelfeld
2021-03-19 11:31
no, I have a json array cvontaining three elements

aniket.g2185
2021-03-19 11:31
can u post full DSL interaction

mark.doppelfeld
2021-03-19 11:32
``` pact.go:629: Verifying a pact between pao-switch-controller-http and pao-ip-pool-manager-http Given A list with all pools A request to get all pools with GET /api/v2/ip/pools returns a response which has a matching body pact.go:635: Verifying a pact between pao-switch-controller-http and pao-ip-pool-manager-http Given A list with all pools A request to get all pools with GET /api/v2/ip/pools returns a response which has a matching body Actual: [{"address":"192.168.0.0/19","addressPoolKind":"IPV4"},{"address":"2003:c3:f800::/37","addressPoolKind":"IPV6DHCP"},{"address":"2003:0:8000:5800::/53","addressPoolKind":"IPV6RA"}] Diff -------------------------------------- Key: - is expected + is actual Matching keys and values are not shown [ ... , - Pact::UnexpectedIndex, - Pact::UnexpectedIndex, + Hash, + Hash, ] Description of differences -------------------------------------- * Actual array is too long and should not contain a Hash at $[1] * Actual array is too long and should not contain a Hash at $[2] ```

aniket.g2185
2021-03-19 11:34
Do you have access to DSL defined at consumer side ?

mark.doppelfeld
2021-03-19 11:35
``` Body: dsl.Like(&[]pao.Fragment{ { Address: "192.168.0.0/22", LeafName: "testLeaf1", AddressPoolKind: pao.AddressPoolKindIPV4, }, { Address: "2003:c3:f800::/46", LeafName: "testLeaf1", AddressPoolKind: pao.AddressPoolKindIPV6DHCP, }, { Address: "2003:0:8000:5800::/54", LeafName: "testLeaf1", AddressPoolKind: pao.AddressPoolKindIPV6RA, }, }),```

aniket.g2185
2021-03-19 11:38
in the array , is consumer expecting atleast 1 address of each type or array can have any number of any type of IPs ?

mark.doppelfeld
2021-03-19 11:40
it can have any number of any type

mark.doppelfeld
2021-03-19 11:40
we are just starting with contracts tests...

mark.doppelfeld
2021-03-19 11:40
so I feel our contracts are not _good_

aniket.g2185
2021-03-19 11:40
then I believe the way its been written is wrong

mark.doppelfeld
2021-03-19 11:40
at the moment

mark.doppelfeld
2021-03-19 11:41
I think so too ...

aniket.g2185
2021-03-19 11:41
what `like` says is , every object in an array is `like` something and then you define only 1 example of something

aniket.g2185
2021-03-19 11:42
may be you can use `or`

aniket.g2185
2021-03-19 11:42
I haven't used it before, but it would be `like`(`A` or `B` or `C`)

mark.doppelfeld
2021-03-19 11:43
ok, I'll give it a try...

aniket.g2185
2021-03-19 11:45
you could have also just given one example and mentioned that `AddressPoolKind` should be either of three using a regex but that wont work, cos Pact will pass a test with response having IP4 AddressPoolKind containing a value of IP6 type IP, which ideally is a wrong response

aniket.g2185
2021-03-19 11:47
I am yet to write go consumer tests so I cannot help you with exact dsl

mark.doppelfeld
2021-03-19 11:49
Ok thanks for taking care of my problem :slightly_smiling_face:

yannick.adler
2021-03-19 12:44
has joined #pact-go

smith260194
2021-03-19 17:40
@smith260194 has left the channel

aelse
2021-03-19 23:54
has joined #pact-go

eric2323223
2021-03-20 01:35
has joined #pact-go

mark.doppelfeld
2021-03-20 12:21
We rewrote our consumer tests and got around the problem.

aniket.g2185
2021-03-20 12:24
:ok_hand:

jordan.r.stewart
2021-03-20 16:07
has joined #pact-go

tmorrison
2021-03-21 21:45
has joined #pact-go

a.chandrasekaran
2021-03-22 00:50
has joined #pact-go

maksym.motornyi
2021-03-22 11:50
has joined #pact-go

gareth.somerville
2021-03-22 12:10
has joined #pact-go

joseph.method
2021-03-22 19:55
has joined #pact-go

dennyg666
2021-03-22 20:54
has joined #pact-go

me1295
2021-03-23 00:15
has joined #pact-go

eric2323223
2021-03-23 02:21
For some reason, my service only accept headers begin with multiple uppercase letters, such as *TEST-Context*. Therefore I am having trouble in the PACT provider test because PACT change the header to *Test-Context*. May I know how to keep header casing in PACT provider test?

matt.fellows
2021-03-23 04:17
Hey!

eric2323223
2021-03-23 04:17
Hi Matt

matt.fellows
2021-03-23 04:17
So, I think you mentioned you tried `RequestFilter` - did that not work?

eric2323223
2021-03-23 04:18
No, it does not work

matt.fellows
2021-03-23 04:18
ok, the default Golang HTTP client will possibly standardise these

matt.fellows
2021-03-23 04:18
your provider code base is Golang?

eric2323223
2021-03-23 04:19
yes

matt.fellows
2021-03-23 04:19
hmm interesting

matt.fellows
2021-03-23 04:20
yes, so it seems golang messes with the headers (I know this is common in other languages too): https://dhdersch.github.io/golang/2016/08/11/golang-case-sensitive-http-headers.html

eric2323223
2021-03-23 05:57
Yes, that's the way I tried with RequestFilter, but doesn't work. I guess somewhere in PACT the headers were updated again with `request.Header.Set` ?

matt.fellows
2021-03-23 06:45
well, yes and no. The Golang HTTP client that is sending the request to your provider is likely doing this

matt.fellows
2021-03-23 06:45
I might need to do a little more digging

matt.fellows
2021-03-23 06:46
Not that I think you should necessarily change your code because its more convenient for a test framework, but it?s not very common practice to have case-sensitive header _keys_

matt.fellows
2021-03-23 06:46
Is that something that could be changed?

eric2323223
2021-03-23 06:48
I am afraid the header cannot be changed, it's used in many other services

matt.fellows
2021-03-23 06:51
Making it case insensitive is not a breaking change though, right?

matt.fellows
2021-03-23 06:51
so the other services can continue to send through the case-specific one

eric2323223
2021-03-23 06:55
My understanding the header should be case sensitive to other services as well, the service I am working on is the only service using PACT contract test.

matt.fellows
2021-03-23 06:56
fair enough then!

matt.fellows
2021-03-23 07:18
so I?m taking a look through the code, and I suspect it?s related to our use of the golang reverse proxy

matt.fellows
2021-03-23 07:19
it?s really wanting to canonicalise headers

eric2323223
2021-03-23 07:21
is it possible to add callback to update headers after the reverse proxy?

matt.fellows
2021-03-23 07:22
no, because the reverse proxy is the actual thing issuing the request to the target

eric2323223
2021-03-23 07:22
bad news

matt.fellows
2021-03-23 07:22
One option would be to vendor the current reverse proxy implementation, and making it parameterisable (or just adding our desired behaviour into it)

matt.fellows
2021-03-23 07:23
It?s a very edge casey thing, because HTTP request headers a case-insensitive.

matt.fellows
2021-03-23 07:24
so we?re working against the way they want to work (the intermediate Pact engine, currently Ruby and moving to Rust) also appear to canonicalise them too

matt.fellows
2021-03-23 07:24
I?m reaching the end of my train journey, but will have a think about a path forward here

eric2323223
2021-03-23 07:25
OK, I understand what you mean.

eric2323223
2021-03-23 07:25
Thank you very much for the help :smile:

anchit.99
2021-03-23 09:04
has joined #pact-go

joseph.method
2021-03-23 14:30
@joseph.method has left the channel

wola.adedeji
2021-03-23 16:25
has joined #pact-go

kenny.shobowale
2021-03-23 16:38
has joined #pact-go

anbu.pandian
2021-03-24 11:54
has joined #pact-go

rachel.barton
2021-03-24 19:12
has joined #pact-go

james522
2021-03-24 22:06
has joined #pact-go

anne.schuth320
2021-03-25 07:49
has joined #pact-go

james.shirtcliffe
2021-03-25 12:04
has joined #pact-go

serhii.makarenko
2021-03-25 12:55
has joined #pact-go

mashabudryte
2021-03-25 14:35
has joined #pact-go

matthew.simon.barnes_
2021-03-25 16:08
has joined #pact-go

jose.manzano
2021-03-26 14:27
has joined #pact-go

chris.faulkner
2021-03-26 16:13
has joined #pact-go

bryanw
2021-03-26 18:46
has joined #pact-go

kerem.durak
2021-03-29 08:34
has joined #pact-go

dave.clissold
2021-03-29 12:40
has joined #pact-go

sidhant.bhayana.15
2021-03-29 18:34
has joined #pact-go

crhawkins85
2021-03-30 21:02
has joined #pact-go

pranav.gore
2021-03-31 01:58
has joined #pact-go

harsha6988
2021-03-31 12:19
has joined #pact-go

leixu
2021-03-31 14:42
has joined #pact-go

matthew.brown
2021-03-31 15:15
has joined #pact-go

oleksandr.tryshchenko
2021-03-31 19:54
has joined #pact-go

phelantomas
2021-04-01 13:13
has joined #pact-go

jayeshdalal7
2021-04-01 17:43
has joined #pact-go

ktogias
2021-04-01 20:04
has joined #pact-go

ktogias
2021-04-01 21:36
@ktogias has left the channel

balaji.sivakumar
2021-04-02 05:41
has joined #pact-go

bheemreddy181
2021-04-02 21:49
if my provider has a dependency with other API - do i mock that api in my state handlers ?

matt.fellows
2021-04-03 21:50
I usually would yes

bheemreddy181
2021-04-04 03:49
do we need to convert those mocks into contract tests then ? ( create a contract workflow with other service ) or do we need to write different contract tests for that integration ?

bheemreddy181
2021-04-04 03:50
I am slightly worried about the keeping both mock response and contract tests in sync if i write different contract tests

uryadov212
2021-04-05 20:52
has joined #pact-go

soumya.aithal966
2021-04-05 22:45
has joined #pact-go

sheyan.rizfee
2021-04-06 00:55
has joined #pact-go

piotr
2021-04-06 09:24
has joined #pact-go

dmitry.korolev
2021-04-06 11:47
has joined #pact-go

dmitry.korolev
2021-04-06 11:49
@dmitry.korolev has left the channel

sravyavadrevu988
2021-04-06 20:40
has joined #pact-go

johnnycareer
2021-04-06 21:34
has joined #pact-go

johnnycareer
2021-04-06 21:41
@johnnycareer has left the channel

bheemreddy181
2021-04-06 22:35
Any examples around how we wan append JWT tokens in go middleware

matt.fellows
2021-04-07 01:00
I don?t have an example to hand, but on a previous client we did that, it was pretty straightforward, but they also already had a way of generating a JWT using a well known JWT library and so during the Pact tests we just added a filter that always added it. Are you having troubles with anything in particular?

bheemreddy181
2021-04-07 04:05
problem i have to setup the router to use the JWT config , its making things quite harder actually

matt.fellows
2021-04-07 04:07
If you use the standard dependency injection to stand up your routers, it should be easy to swap out the interface to a ?null check? or something, or depending on your test coverage, you might want to just drop JWT validation for Pact tests altogether.

bheemreddy181
2021-04-07 04:18
makes sense

bheemreddy181
2021-04-07 04:19
for dropping JWT for pact tests what should be the criteria ?

bheemreddy181
2021-04-07 04:19
And is testing a bad JWT token - A bad pact test ?

matt.fellows
2021-04-07 04:23
> for dropping JWT for pact tests what should be the criteria ? At the very least, you should have good replacement tests to ensure that it?s covered elsewhere. Especially if there is semantic information in the JWTs

matt.fellows
2021-04-07 04:23
but usually, these things are picked up fairly quickly through other means - you usually can?t explore a feature if it can?t auth, and usually, security related things are highly scrutinised

danil.nurgaliev
2021-04-07 12:26
has joined #pact-go

zbintliff
2021-04-07 13:14
Our plan on JWT is just to use the new header rules to seed our requests is a very long lived valid token

gtsifrikas
2021-04-08 08:53
has joined #pact-go

kanapuramamarnath
2021-04-08 09:18
has joined #pact-go

arnaud.dutrillaux
2021-04-09 10:59
has joined #pact-go

gsinghania
2021-04-09 15:40
has joined #pact-go

souravmohanty35
2021-04-09 16:34
has joined #pact-go

itzdavey
2021-04-09 17:23
has joined #pact-go

matt.fellows
2021-04-11 14:11
@aniket.g2185 I had a few hours this evening to do a little more on the verifier side. I think the installer is in decent shape at the moment and both message and HTTP pacts are working, with provider state value callbacks etc.

matt.fellows
2021-04-11 14:12
I?d like to release a beta soon - aside from what you shared already (specifically with logging) did you have any feedback on the package? Do you think it makes sense to remain in a `v3` sub package? How has it been ergonomically?

tmorrison
2021-04-12 00:19
@tmorrison has left the channel

laura.edington
2021-04-13 17:45
has joined #pact-go

liam.mcdermott
2021-04-13 22:38
has joined #pact-go

wedlaaa
2021-04-14 13:33
has joined #pact-go

dabfleming
2021-04-14 15:40
@matt.fellows So there's something that's really been bugging me about the pact-go api (as I've been working through proof-of-concept/demos/examples etc) Are you open to suggestions that would involve breaking changes? (cont...)

dabfleming
2021-04-14 15:45
Basically the way StateHandlers are done seems a little error-prone and not very idiomatic-Go-y. If one of my tests has `.Given("some-state")` I can pass in a StateHandlers map which doesn't contain the key ``"some-state"` , or even `nil` , and the pact-go framework doesn't produce any error. It would be nice to at least check that that key was present in the map. Even better would be implementing stateHandlers via an interface... I'm thinking something like: ```type StateHandlers interface{ SetState(key string) error }``` Similar to `http.Handler`, this would allow me to pass in my own type to manage the states: ? I can decide if a missing state is an error ? I could potentially implement this in my server struct, which can then modify its state directly, without using closures. This would seem to me to be potentially a lot cleaner.

wderksen
2021-04-14 22:26
has joined #pact-go

matt.fellows
2021-04-15 01:15
Hi @dabfleming! yes, definitely open to a breaking change. The v3 branch, which is close to beta, would be the place to try this.

matt.fellows
2021-04-15 01:15
Ideally, I?d like to make the migration from the current stable to the new branch as straightforward as possible. But also, if we?re going to introduce breaking changes, now would be the time

matt.fellows
2021-04-15 01:16
Would you like to put together an example test that shows your example in action? It doesn?t need to compile, just to show the concept?

mail_4brad
2021-04-15 02:34
has joined #pact-go

mail_4brad
2021-04-15 05:15
@mail_4brad has left the channel

goncalosamuel
2021-04-15 15:08
has joined #pact-go

dabfleming
2021-04-15 16:02
@matt.fellows Great... I'll try and throw an example together today.

matthew.hall
2021-04-15 17:36
has joined #pact-go

raony
2021-04-15 19:21
has joined #pact-go

gupta.ratnesh9
2021-04-16 04:48
has joined #pact-go

greg595au
2021-04-16 10:00
has joined #pact-go

manel_ben_yahia
2021-04-16 13:59
has joined #pact-go

maxence
2021-04-17 11:07
has joined #pact-go

kranti.deep
2021-04-17 14:17
has joined #pact-go

aaronw153
2021-04-17 21:42
has joined #pact-go

github
2021-04-19 00:57
GitHub app is successfully upgraded in your workspace :tada: To receive notifications in your private channels, you need to invite the GitHub app `/invite @GitHub`

dwmahieddine
2021-04-19 12:44
has joined #pact-go

garrettmichael
2021-04-19 18:34
has joined #pact-go

daniel.kalleward
2021-04-20 08:16
has joined #pact-go

mattias.persson
2021-04-20 12:45
has joined #pact-go

martin.eklund
2021-04-20 12:47
has joined #pact-go

enda.brody
2021-04-20 17:37
has joined #pact-go

cristian.moisa
2021-04-20 18:25
has joined #pact-go

darccide
2021-04-21 01:35
has joined #pact-go

pavel.azarau
2021-04-21 22:50
has joined #pact-go

pavel.azarau
2021-04-21 22:56
hello folks. have not found anything about it here in channel. has anybody had `Post ?http://localhost:54223/interactions?: dial tcp [::1]:54223: connect: connection refused` while calling pact.verify()? I call `pact.Setup(true)` before and I?ve confirmed it checks if a mock server was started up (by default within 10 seconds). but then I call `pact.verify` and fail with the error above. if I add a sleep for ~600 ms after `pact>Setup(true)` call the test passes

stain.witness
2021-04-22 02:43
has joined #pact-go

bheemreddy181
2021-04-22 03:31
You need to pick a random port rather than hard doing port like above


bheemreddy181
2021-04-22 03:34
Try to follow setup like in the above linked code

oleksandra.pishcheiko
2021-04-22 08:31
has joined #pact-go

akos.csurai.4github
2021-04-22 10:01
has joined #pact-go

christosbouloumpasis
2021-04-22 10:38
has joined #pact-go

steve.cook
2021-04-22 12:34
@steve.cook has left the channel

temanibeck
2021-04-22 16:04
has joined #pact-go

pavel.azarau
2021-04-22 16:38
I don?t use a specific port. by default `pact.Setup(true)` uses a random one ```if p.AllowedMockServerPorts != "" { port, perr = utils.FindPortInRange(p.AllowedMockServerPorts) } else { port, perr = utils.GetFreePort() }``` and I see different port each time I run it

michael_swiss
2021-04-22 21:04
has joined #pact-go

dawoud.sheraz
2021-04-23 09:34
has joined #pact-go

adriano.tanoue
2021-04-23 12:01
has joined #pact-go

saurabh.goel
2021-04-24 20:10
has joined #pact-go

cemal.onder
2021-04-25 12:22
has joined #pact-go

richard.forjoe
2021-04-26 00:52
has joined #pact-go

ron.aharoni
2021-04-26 11:03
has joined #pact-go

andrewmorton
2021-04-26 13:33
has joined #pact-go

aram
2021-04-26 15:24
has joined #pact-go

marcelo.souzameinberg
2021-04-26 21:32
has joined #pact-go

songqing.gu
2021-04-27 01:25
has joined #pact-go

fortiss.anita
2021-04-27 09:34
has joined #pact-go

keshav.reddy503
2021-04-27 12:06
has joined #pact-go

jeremykeczan
2021-04-27 14:57
has joined #pact-go

yeseniavega411
2021-04-27 15:31
has joined #pact-go

almantusk
2021-04-27 16:56
has joined #pact-go

alexandra.huamani
2021-04-28 00:12
has joined #pact-go

tonynguyenit18
2021-04-28 02:12
has joined #pact-go

agrawalneeraj43
2021-04-28 04:37
has joined #pact-go

shixun.liu1023
2021-04-28 04:39
has joined #pact-go

narendra.pathai
2021-04-28 06:21
has joined #pact-go

aparnachaudhari
2021-04-28 07:10
Has anyone ran into errors when running consumer contract test for one service but 2 contract test files - RESTful and async (message) in the same test run?

matt.fellows
2021-04-28 07:11
Ah, yes. This is a known problem

aparnachaudhari
2021-04-28 07:11
oh?

aparnachaudhari
2021-04-28 07:11
``` `extract_contents': undefined method `contents' for #<Pact::Interaction:0x007fd5841505e8> (NoMethodError)```

aparnachaudhari
2021-04-28 07:11
looks familiar then?


matt.fellows
2021-04-28 07:11
hmm the error doesn?t, no

matt.fellows
2021-04-28 07:12
consumer test or provider test?

aparnachaudhari
2021-04-28 07:12
consumer tests

matt.fellows
2021-04-28 07:12
right, that would make sense

matt.fellows
2021-04-28 07:13
It?s probably trying to parse the pact file that already has an item in it (a message pact or a http interaction). The current version of pact doesn?t support both in a single pact file

matt.fellows
2021-04-28 07:13
(see the main channel links I posted)

matt.fellows
2021-04-28 07:13
Simple solution: give the provider a different name (I know it?s a bit annoying, and it?s in the process of being resolved)

aparnachaudhari
2021-04-28 07:13
I see, you mean in one pact session on mock server

matt.fellows
2021-04-28 07:14
yeah, you need to have separate tests with separate mock servers (in the case of message pact, there is no mock service anyway)

aparnachaudhari
2021-04-28 07:14
our consumers and provider names are tightly tied to the service repo names.. service modules .. I think we can work around sperate sessions for now

matt.fellows
2021-04-28 07:15
ah, makes sense. you?re probably creating standard approaches/tooling I?m guessing?

aparnachaudhari
2021-04-28 07:16
yep.. lot of boiler plate code is packaged out and shared across the pipelines

matt.fellows
2021-04-28 07:17
Cool! Keen to see any of that, I?ve seen a few versions of these things. Some of it might be worth adding to Pact itself

aparnachaudhari
2021-04-28 07:17
Thanks for the quick response Matt, need to change some of the way we will be triggering tests based off of this.

matt.fellows
2021-04-28 07:17
for instance on a previous client (when I was still consulting) we built an internal tool to standardise how tokens were fetched, wrapped analytics around it etc.

matt.fellows
2021-04-28 07:18
Yeah, the main issue could be the provider side - it?s now _two_ logical providers

aparnachaudhari
2021-04-28 07:20
I see, so you are recommending that if service_a (consumer) has 2 contract tests - RESTful and async against service_b.. it would be useful to specify if service_b is going to run verification against the RESTful contract or the async contract

aparnachaudhari
2021-04-28 07:21
and the way to do that would be naming the provider side of things differently

matt.fellows
2021-04-28 07:26
correct!

matt.fellows
2021-04-28 07:26
Basically, you can?t have a pact file at the moment that has async interactions and HTTP ones

matt.fellows
2021-04-28 07:28
So you would have: `service_a` -> `service_b` for the HTTP interactions `service_a`-> `service_b_async` for the non-http interactions But both `service_b` and `service_b_async` is the same code base. It would need to run two verification processes, one for each of its named providers.

aparnachaudhari
2021-04-28 07:30
yep, about what I was thinking..

aparnachaudhari
2021-04-28 07:30
qq - what is the timeline for the fix on this

matt.fellows
2021-04-28 07:31
Not sure, it?s just been added to the core engine

matt.fellows
2021-04-28 07:31
I?m probably still at least a month away from getting the beta of the latest pact-go out

matt.fellows
2021-04-28 07:31
once that?s done, it should be fairly easy to add that support in

matt.fellows
2021-04-28 07:31
but assume at least a few months, I?d say

aparnachaudhari
2021-04-28 07:32
gotcha.. ok we can work around this for now and then we can edit it as the fix comes in

marcin.grzejszczak
2021-04-28 13:53
has joined #pact-go

scott.riley111
2021-04-28 15:45
has joined #pact-go

flubniewski
2021-04-28 17:01
has joined #pact-go

github2
2021-04-28 22:24
[pact-foundation/pact-go] Pull request opened by dependabot-preview[bot]

aparnachaudhari
2021-04-29 20:06
I am seeing something when writing a consumer contract for a message type interaction .. even tho the test case specifies ```message := pact.AddMessage() message. Given("Some test message"). ExpectsToReceive("Some test message back").```

aparnachaudhari
2021-04-29 20:06
I see ```"messages": [ { "description": "Some test message back", "providerStates": [ { "name": "a", "params": null } ],```

aparnachaudhari
2021-04-29 20:08
per ```// Given specifies a provider state. Optional. func (p *Message) Given(state string) *Message { p.States = []State{State{Name: state}} return p }```

aparnachaudhari
2021-04-29 20:08
The state should have been set but looks like its not?

aparnachaudhari
2021-04-29 20:14
I do not see where the Param is being set at all

aparnachaudhari
2021-04-29 20:15
for ```type State struct { Name string `json:"name"` Params map[string]interface{} `json:"params,omitempty"` }```

aparnachaudhari
2021-04-29 20:29
and it should be omitted but it is not apparently

aparnachaudhari
2021-04-29 23:46
ignore ^

matt.fellows
2021-04-30 01:59
Hmmmm

matt.fellows
2021-04-30 02:00
that all looks strange to me

matt.fellows
2021-04-30 02:00
which version are you using?

aparnachaudhari
2021-04-30 02:00
~of pact stand alone ruby?~

aparnachaudhari
2021-04-30 02:00
```pact-ruby-standalone 1.88.49```


matt.fellows
2021-04-30 02:04
thx

matt.fellows
2021-04-30 02:05
might be worth just doing a clean of the pact dir and starting fresh, just in case

matt.fellows
2021-04-30 02:05
otherwise, might need a repro

matt.fellows
2021-04-30 02:05
I?ll take a look this afternoon otherwise

aparnachaudhari
2021-04-30 02:05
clean out of pact dir? you mean to delete the generated json?

aparnachaudhari
2021-04-30 02:17
let me know if you need any help with repro

matt.fellows
2021-04-30 02:21
Just ran the example in the pact-go repository, and it generates the correct pact file

matt.fellows
2021-04-30 02:22
```cd $GOPATH/src/github.com/pact-foundation/pact-go/examples/messages/consumer go test -count=1 -tags consumer -v . cat $GOPATH/src/github.com/pact-foundation/pact-go/examples/pacts/pactgomessageconsumer-pactgomessageprovider.json```

matt.fellows
2021-04-30 02:22
should be able to see if it works

aparnachaudhari
2021-04-30 02:26
you are not seeing the param being picked up?

matt.fellows
2021-04-30 02:27
nope, it?s being set to `null` (which also doesn?t look right, but actually shouldn?t cause any issues)

matt.fellows
2021-04-30 02:28
It generates this: ```{ "consumer": { "name": "PactGoMessageConsumer" }, "provider": { "name": "PactGoMessageProvider" }, "messages": [ { "description": "a user", "providerStates": [ { "name": "user with id 127 exists", "params": null } ], "contents": { "access": [ { "role": "admin" }, { "role": "admin" }, { "role": "admin" } ], "id": 127, "name": "Baz" }, "matchingRules": { "body": { "$.access": { "matchers": [ { "min": 3 } ] }, "$.access[*].*": { "matchers": [ { "match": "type" } ] }, "$.access[*].role": { "matchers": [ { "match": "regex", "regex": "admin|controller|user" } ] }, "$.id": { "matchers": [ { "match": "type" } ] } } }, "metaData": { "Content-Type": "application/json; charset=utf-8" } }, { "description": "an order", "providerStates": [ { "name": "an order exists", "params": null } ], "contents": { "id": { "json_class": "Pact::SomethingLike", "contents": 42 }, "item": { "json_class": "Pact::Term", "data": { "generate": "apple", "matcher": { "json_class": "Regexp", "o": 0, "s": "(apple|orange)" } } } }, "matchingRules": { }, "metaData": { "Content-Type": "application/json; charset=utf-8" } } ], "metadata": { "pactSpecification": { "version": "3.0.0" } } }```

aparnachaudhari
2021-04-30 02:29
it technically should not, but when I re-run the consumer tests I see ```2021/04/29 11:55:13 [ERROR] service: Could not load existing consumer contract from /<path_redacted>/pact-example-consumer/pacts/example-todo-consumer-async-example-todo-provider.json due to 757: unexpected token at 'null'. Creating a new file.```

matt.fellows
2021-04-30 02:29
(just trying with latest Ruby binary now)

aparnachaudhari
2021-04-30 02:30
so `"params": null` should technically be omitted yea? since its `json:"params,omitempty"`

aparnachaudhari
2021-04-30 02:30
or is this being handled somewhere down stream that I cannot see in the go code

matt.fellows
2021-04-30 02:30
yes, but the pact is serialised by the Ruby binary, which might be doing it

matt.fellows
2021-04-30 02:30
yeah

matt.fellows
2021-04-30 02:30
I?ve just tried with 1.88.51

matt.fellows
2021-04-30 02:32
If you can share more code, please do (or DM me)

matt.fellows
2021-04-30 02:32
I?ll give it a go a little later today

matt.fellows
2021-04-30 02:33
:thinking_face:

matt.fellows
2021-04-30 02:33
any chance you could please share that offline with me?

aparnachaudhari
2021-04-30 02:33
share the test code?

aparnachaudhari
2021-04-30 02:34
and same results?

matt.fellows
2021-04-30 02:34
yep

matt.fellows
2021-04-30 02:35
the badly formatted JSON would help too

matt.fellows
2021-04-30 02:35
but the test code would also help

aparnachaudhari
2021-04-30 02:35
```{ "consumer": { "name": "example-todo-consumer-async" }, "provider": { "name": "example-todo-provider-async" }, "messages": [ { "description": "Test user information message", "providerStates": [ { "name": "Test User exists", "params": null } ], "contents": { "access": [ { "role": "admin" }, { "role": "admin" }, { "role": "admin" } ], "id": 127, "name": "Baz" }, "matchingRules": { "body": { "$.access": { "matchers": [ { "min": 3 } ] }, "$.access[*].*": { "matchers": [ { "match": "type" } ] }, "$.access[*].role": { "matchers": [ { "match": "regex", "regex": "admin|controller|user" } ] }, "$.id": { "matchers": [ { "match": "type" } ] } } }, "metaData": { "Content-Type": "application/json; charset=utf-8" } } ], "metadata": { "pactSpecification": { "version": "3.0.0" } } }```

aparnachaudhari
2021-04-30 02:36
this I can share ^ its pretty much the sample test but we were using it to trigger our service CI/CD

aparnachaudhari
2021-04-30 02:36
when I noticed it

matt.fellows
2021-04-30 02:37
is that this file: `pact-example-consumer/pacts/example-todo-consumer-async-example-todo-provider.json` ?

matt.fellows
2021-04-30 02:38
Thte error above is that it can?t parse the JSON document. Thte file you shared is definitely valid JSON

aparnachaudhari
2021-04-30 02:38
yep thats the file

matt.fellows
2021-04-30 02:38
:thinking_face:

matt.fellows
2021-04-30 02:40
Could you please try updating to the latest Ruby binary? I?m now just thinking that version is bad

matt.fellows
2021-04-30 02:41
I just added that to the test pact file here for messages, re-ran the tests and it appended the new interaction just fine

aparnachaudhari
2021-04-30 02:42
ok let me give that a shot

tjones
2021-04-30 11:40
@matt.fellows: We get that `null` error with pact-js when tests are writing to the same file concurrently. Don't know if it's related

matt.fellows
2021-04-30 11:46
Huh, interesting thanks Tim

roy_collings
2021-04-30 15:15
has joined #pact-go

prachi_mangesh_edake
2021-05-03 04:43
has joined #pact-go

sams.prashanth
2021-05-03 08:04
has joined #pact-go

philip.m.wood
2021-05-03 12:46
has joined #pact-go

amiller
2021-05-03 15:27
has joined #pact-go

agarwal.akash333
2021-05-03 23:14
has joined #pact-go

marcin.grzejszczak
2021-05-04 07:27
@marcin.grzejszczak has left the channel

anand.ilkal
2021-05-04 08:01
has joined #pact-go

dennis.minard
2021-05-04 16:23
has joined #pact-go

chris.williams
2021-05-04 16:41
has joined #pact-go

ssorcnafets
2021-05-04 19:20
has joined #pact-go

kowalczuk.jnr
2021-05-04 22:24
has joined #pact-go

hugo
2021-05-05 00:48
has joined #pact-go

jadelong
2021-05-05 15:51
has joined #pact-go

alexei.solcanu
2021-05-06 02:01
has joined #pact-go

zonkor
2021-05-06 08:08
has joined #pact-go

florian.mautendorfer
2021-05-06 14:04
has joined #pact-go

john.mcnulty
2021-05-06 16:49
has joined #pact-go

tarunmehrotra3
2021-05-10 06:31
has joined #pact-go

jbecker
2021-05-10 16:31
has joined #pact-go

github2
2021-05-11 00:34
[pact-foundation/pact-go] Issue opened by dabfleming

eric2323223
2021-05-11 04:44
Could anyone please share a example of define optional query parameter for consumer test with pact-go?

james.wettenhall
2021-05-11 04:54
has joined #pact-go

eduardo.marques
2021-05-11 09:19
has joined #pact-go

al8x.romanov
2021-05-11 13:09
has joined #pact-go

aparnachaudhari
2021-05-11 18:56
I noticed that `ConsumerVersionSelectors` is not part of the `VerifyMessageRequest` but only `VerifyRequest` . Any idea how to choose multiple consumer versions for async tests?

jr.jenks
2021-05-11 21:46
has joined #pact-go

dabfleming
2021-05-11 22:10
It does seem like more parity between `VerifyRequest` and `VerifyMessageRequest` would make sense.

dabfleming
2021-05-11 22:22
@matt.fellows When you're around, a question. Does the branch `feat/v3-ffi-verifier` on github represent a reasonably current snapshot of pact-go v3 development? We're starting to run into some sticky problems in how we might apply pact to our existing services and practices... contemplating suggesting some changes that might help us out, but want to base any feedback on what's current/upcoming if possible.

matt.fellows
2021-05-11 22:40
Yeah it does. The code is a bit of a mess behind the scenes as it was based on a spike from ~4 years ago, but I?m migrating to the new FFI based rust interface, so let me know where you?re going to look. If possible, suggestions to the public facing API without regard to implementation is probably your best bet Else, one option is to setup a call and navigate some of it together.

matt.fellows
2021-05-11 22:40
The provider interface is close enough to done for a first cut though, despite some shortcomings

aparnachaudhari
2021-05-11 23:20
Hello, I am looking to add message tests between two services where the message contents are marshaled protobuf, the consumer marshals the message and provider unmarshals it. Has anyone worked on adding this type of async tests? Any pointers will be helpful.

sammomichael
2021-05-12 02:27
has joined #pact-go

matt.fellows
2021-05-12 02:52
Interesting. I think you?re going to have to do something like convert the protobuf message to a base64 encoded payload that is embedded into a JSON blob, and unpack it on the consumer side.

matt.fellows
2021-05-12 02:55
Just linked you in the #protobufs channel on a relevant concept

tony.foster
2021-05-12 03:44
has joined #pact-go

aparnachaudhari
2021-05-12 03:45
Just saw this.. hmm interesting. I came across https://github.com/pact-foundation/pact-jvm/issues/878 I think his usecase sort of aligns with what I want to do... but I need to read more

jan.businsky
2021-05-12 09:10
has joined #pact-go

lreisch
2021-05-12 19:23
has joined #pact-go

jorge.curima.corp
2021-05-13 01:37
has joined #pact-go

anh.evizi.test
2021-05-13 05:56
has joined #pact-go

yka259
2021-05-13 08:22
has joined #pact-go

joshibharat
2021-05-13 11:43
has joined #pact-go

smankala
2021-05-13 20:55
has joined #pact-go

aparnachaudhari
2021-05-13 22:03
I think the README doc for go async provider side of tests is out of date. Is this something I should raise somewhere as ticket or already known? README https://github.com/pact-foundation/pact-go#provider-producer is out of date..  `dsl.MessageProviders` is not part of the pact-go any more

matt.fellows
2021-05-13 22:41
You?re right, sorry


aparnachaudhari
2021-05-14 03:55
Yeah.. have been using that as source of truth.. just wanted to let y'all know

martin.pelikan
2021-05-14 06:48
has joined #pact-go

joao_glorioso
2021-05-14 08:41
has joined #pact-go

ashok.jan31
2021-05-14 12:25
has joined #pact-go

gusfisha
2021-05-14 19:52
has joined #pact-go

keithgutfreund
2021-05-14 20:13
has joined #pact-go

k.gutfreund
2021-05-15 03:47
has joined #pact-go

siegcollado
2021-05-17 05:03
has joined #pact-go

simon.thomas1978
2021-05-17 08:53
has joined #pact-go

keimiokamoto
2021-05-17 10:36
has joined #pact-go

fabian.feary
2021-05-17 11:52
has joined #pact-go

josh.brangwyn
2021-05-17 12:19
has joined #pact-go

xiao.liang
2021-05-17 16:41
has joined #pact-go

bhattacharyyasom
2021-05-18 14:05
has joined #pact-go

lalit210784
2021-05-18 17:55
has joined #pact-go

zaxosdimi
2021-05-18 22:14
has joined #pact-go

viktor.trako
2021-05-19 15:45
has joined #pact-go

abdel.akkoub
2021-05-19 17:27
has joined #pact-go

akrala
2021-05-19 21:22
has joined #pact-go

mazi.fayazfar
2021-05-19 22:23
has joined #pact-go

daniel.qu
2021-05-20 18:03
has joined #pact-go

vijay.chawla
2021-05-21 08:37
has joined #pact-go

tim.walter
2021-05-21 09:12
has joined #pact-go

ankit.laddha
2021-05-21 14:03
has joined #pact-go

dimundo
2021-05-21 14:09
has joined #pact-go

include.melaz
2021-05-22 13:15
has joined #pact-go

uddhavchopade
2021-05-23 08:32
has joined #pact-go

lukasz.wlosek
2021-05-24 08:03
has joined #pact-go

komathy_priya_dhanas
2021-05-24 09:26
has joined #pact-go

nh.salah
2021-05-24 11:46
has joined #pact-go

erinc1915
2021-05-24 16:11
has joined #pact-go

nzarate
2021-05-24 18:11
has joined #pact-go

github2
2021-05-24 19:23
[pact-foundation/pact-go] Pull request opened by dependabot-preview[bot]

github2
2021-05-24 19:23
[pact-foundation/pact-go] Pull request closed by dependabot-preview[bot]

jonathan.arreola
2021-05-24 21:20
has joined #pact-go

cesar.consultorjr
2021-05-24 21:39
has joined #pact-go

gdfesta
2021-05-25 00:44
has joined #pact-go

utsavk3210
2021-05-25 08:37
has joined #pact-go

daniel.cardinha
2021-05-25 10:06
has joined #pact-go

dan.haughey
2021-05-25 14:34
has joined #pact-go

vince.lee
2021-05-25 14:36
has joined #pact-go

pact544
2021-05-25 16:01
has joined #pact-go

shlomi
2021-05-25 22:41
has joined #pact-go

raquel.bautista
2021-05-26 09:38
has joined #pact-go

aubilla
2021-05-26 09:52
has joined #pact-go

vishnuprakash323
2021-05-26 10:46
has joined #pact-go

rob.caiger
2021-05-26 11:54
has joined #pact-go

lio.lunesu
2021-05-26 17:55
has joined #pact-go

nahuel.dallavecchia
2021-05-26 20:24
has joined #pact-go

mathew.baltes
2021-05-26 23:33
has joined #pact-go

stephen.leece
2021-05-26 23:44
has joined #pact-go

james_fraser
2021-05-27 09:23
has joined #pact-go

mostafa.zaher
2021-05-27 10:13
has joined #pact-go

utsavtiwary10
2021-05-27 10:53
has joined #pact-go

kamoljan
2021-05-28 02:39
has joined #pact-go

eric2323223
2021-05-28 03:55
Hi, I want to verify a optional query parameter, such as `my-context`, in the consumer test with PACT-go, this query parameter could contains multiple key pairs, such as `name=eric,gender=male`. May I know how to define the Query matcher?

matt.fellows
2021-05-28 04:41
I think there is an example in the github repo

matt.fellows
2021-05-28 04:41
Something like this: ``` WithRequest(request{ Method: "POST", Path: term("/login/10", "/login/[0-9]+"), Query: dsl.MapMatcher{ "foo": term("bar", "[a-zA-Z]+"), }, Body: loginRequest, Headers: commonHeaders, }).```

eric2323223
2021-05-28 04:55
@matt.fellows Thank you for the answer, there is only one element in your sample query parameter `foo`, may I know how to define matcher when multiple elements in one query parameter? I have not yet found similar example in the repository

matt.fellows
2021-05-28 05:49
add another?

matt.fellows
2021-05-28 05:50
Can you please show what the actual query looks like from an http client?

marko.justinek
2021-05-28 06:04
I assume the question is whether it is currently possible to use an `includes.anyOfOrAll("name=eric", "gender=male")` kind of matcher for the request query, where the order of these key-value pairs might be different between the pact test declaration and actual API call?

marko.justinek
2021-05-28 06:07
though pact spec v3 supports this by https://github.com/pact-foundation/pact-specification/tree/version-3#query-strings-are-stored-as-map-instead-of-strings as an object of key-value pairs, not a string (or string matcher)?

marko.justinek
2021-05-28 06:08
worth sharing which version of what you?re using @eric2323223

matt.fellows
2021-05-28 06:27
I?m probably a week or two away from having a beta v3 on the consumer side

matt.fellows
2021-05-28 06:27
But I?m still not clear on what the query looks like

matt.fellows
2021-05-28 06:28
you can?t have `=` in a query string value, for obvious reasons

marko.justinek
2021-05-28 06:32
I wouldn?t mind getting ?my? headspace back so I could start thinking about the provider side on Swift (not that there is tonnes of demand :sweat_smile: - but we did have a bloke ask for it using Vapor (the future of web development :grinning_face_with_one_large_and_one_small_eye: ) (I thinks) :man-shrugging:

eric2323223
2021-05-28 07:41
I am using v1.88.3

matt.fellows
2021-05-28 08:00
What's the query you want to use tho Erik so I can help?

mathias.duesterhoeft
2021-05-28 08:59
has joined #pact-go

matty_o_connor01
2021-05-28 15:57
has joined #pact-go

nathaniel.emmons
2021-05-28 18:25
has joined #pact-go

github2
2021-05-29 12:50
[pact-foundation/pact-go] Pull request merged by mefellows

github2
2021-05-29 12:51
[pact-foundation/pact-go] Pull request merged by mefellows

matt.fellows
2021-05-29 13:01
:wave: I know a few people have been asking about v3 support in pact-go. I?m pleased to say we?re moving closer to a beta. Consumer examples: https://github.com/pact-foundation/pact-go/blob/2.x.x/examples/v3/consumer_test.go Provider examples: https://github.com/pact-foundation/pact-go/blob/2.x.x/examples/v3/provider_test.go It supports both the v2 and v3 specification, message pact, including all of the new matchers, binary payloads, values from provider states etc.. It also now uses the rust share core, and is pretty darn performant. The API has changed a bit, and I will document a migration guide once we settle on what the interface looks like. I?d like feedback on this in particular topic, because obviously this is where you?ll be using things day to day. (also everything is currently in a `v3` sub package, which I also plan to change)

matt.fellows
2021-05-29 13:03
From here, the plan is to clean up the rough edges, start using it in the edges of Pactflow (e.g. our Terraform provider) and other pet projects, in order to tease it out. Any community testers would be much appreciated. (cc @dabfleming @zbintliff @aniket.g2185)

sapoho3257
2021-05-29 16:10
has joined #pact-go

github2
2021-05-29 23:07
[pact-foundation/pact-go] New release _https://github.com/pact-foundation/pact-go/releases/tag/2.0.0-alpha.1_ published by mefellows

andjela.rajic
2021-05-30 20:00
has joined #pact-go

aniket.g2185
2021-05-31 01:49
Awesome @matt.fellows !! bit occupied with something else, but would check it out soon !! Cheers!

matt.fellows
2021-05-31 02:58
No worries

matt.fellows
2021-05-31 02:58
Ping me when you do, it?ll probably be changed by the time you show up to play with it :wink:

sumitsg004
2021-05-31 05:10
has joined #pact-go

james_fraser
2021-05-31 09:00
@james_fraser has left the channel

allan.barbosa
2021-05-31 14:08
has joined #pact-go

vinicius.grund
2021-05-31 14:35
has joined #pact-go

todd.lemmonds
2021-06-01 15:57
has joined #pact-go

alexander.infante
2021-06-01 15:57
has joined #pact-go

michael.doyle
2021-06-01 15:58
has joined #pact-go

paulorochag
2021-06-01 20:20
has joined #pact-go

jaspal.gill
2021-06-02 15:23
has joined #pact-go

wenqiglantz
2021-06-02 18:19
has joined #pact-go

ch.toimbetov
2021-06-02 21:46
has joined #pact-go

kyle.florence
2021-06-03 04:57
@kyle.florence has left the channel

xyz1kind
2021-06-03 05:03
has joined #pact-go

aftab.shamim2020
2021-06-03 06:02
has joined #pact-go

slu.mendozaharold
2021-06-03 10:33
has joined #pact-go

bheemreddy181
2021-06-03 14:58
For some reason i feel each like is so confusing i know that the function implementation explains it all ```func EachLike(content interface{}, minRequired int) Matcher {Matt Fellows, 3 years ago: ? feat(api): uplift API to support better match? return eachLike{ Contents: content, Min: minRequired, } }``` that we atleast require one element here of that kind with a value

bheemreddy181
2021-06-03 15:00
We did the same thing but that fails , here is what it looks like ```WillRespondWith(dsl.Response{ Status: 200, Body: dsl.Like(map[string]interface{}{ "underwriting_decisions": dsl.EachLike(dsl.EachLike(map[string]interface{}{"equation_results": dsl.EachLike(map[string]interface{}{"equation_name": dsl.Like("NC_Tier_Model")}, 1)}, 1), 1), }), Headers: responseCommonHeaders, })```

bheemreddy181
2021-06-03 15:00
here is the validation failure

greg.tyler
2021-06-03 15:05
Looks like you?ve got an extra `EachLike` at the start? I think you want: ```dsl.EachLike(map[string]interface{}{"equation_results": dsl.EachLike(map[string]interface{}{"equation_name": dsl.Like("NC_Tier_Model")}, 1)}, 1),``` Because the actual response is: ```{"underwriting_decisions":[{"equation_results":...}]}``` But your Pact expectation is: ```{"underwriting_decisions":[[{"equation_results":...}]]}```

zbintliff
2021-06-03 20:40
I?ll see if I can?t get someone to look at it this sprint!

zbintliff
2021-06-03 20:41
If this is using gomod will it still be in `v3/` dir?

bheemreddy181
2021-06-03 20:49
Ah makes sense

bheemreddy181
2021-06-03 20:49
So if i have multiple arrays does the validation look for each array to have atleast one item of this kind ?

matt.fellows
2021-06-03 23:28
good question

matt.fellows
2021-06-03 23:29
right now, it?s in the `v3` folder simply because during development I had it working in parallel with the existing code

matt.fellows
2021-06-03 23:29
Originally, I made it completely backwards compatible, but made the decision to change some of the interface as I went through.

matt.fellows
2021-06-03 23:30
I?m still not sure what?s best. I?ll be adding support back in for a similar API soon. Pretty straightforward I think, so migration could be easier

matt.fellows
2021-06-03 23:30
Anyway, I would love feedback on the interface. I was always a bit uncomfortable with everything being in the `dsl` package. Thoughts welcome on that Zach!

matt.fellows
2021-06-04 01:24
yes

matt.fellows
2021-06-04 01:24
`Eachlike` says ?this element should be an array, where each element of the array should have the following shape?

matt.fellows
2021-06-04 01:24
It?s basically the `Like` matcher, but for arrays

matt.fellows
2021-06-04 01:25
In the new branch, there is an `ArrayContains` matcher that lets you have _different_ objects in it :stuck_out_tongue:

sergio.artero
2021-06-04 10:07
has joined #pact-go

zbintliff
2021-06-04 13:47
Oh awesome. I linked this thread to a teammate that shoudl be able to look at it this sprint

bheemreddy181
2021-06-04 14:26
makes sense

v-gabriel.dantas
2021-06-04 15:26
has joined #pact-go

leonardo.viana
2021-06-04 18:52
has joined #pact-go

yashdev963
2021-06-07 06:51
has joined #pact-go

i.pinzari
2021-06-07 17:27
has joined #pact-go

aparnachaudhari
2021-06-07 18:36
@matt.fellows I would be interetestd too

gurkiratguliani
2021-06-07 19:36
has joined #pact-go

matt.fellows
2021-06-08 12:26
I?ve just added a migration guide to the repo: https://github.com/pact-foundation/pact-go/blob/2.x.x/MIGRATION.md

matt.fellows
2021-06-08 12:26
The rest of the docs (i.e. the readme and also the source code) still need updating, so just note that.

matt.fellows
2021-06-08 12:27
The installation instructions https://github.com/pact-foundation/pact-go/tree/2.x.x are still valid

matt.fellows
2021-06-08 12:28
migration guide for the new v2.x.x API is out: https://github.com/pact-foundation/pact-go/blob/2.x.x/MIGRATION.md

krishna.ramnk
2021-06-08 13:24
has joined #pact-go

nathaniel.emmons
2021-06-08 18:50
@nathaniel.emmons has left the channel

sagar.kharab
2021-06-09 00:32
has joined #pact-go

david.vancouvering
2021-06-09 03:36
has joined #pact-go

nuno.pik
2021-06-09 06:58
has joined #pact-go

natashakdykes
2021-06-09 16:06
has joined #pact-go

torbjorn.vatn
2021-06-09 17:30
has joined #pact-go

s.goel
2021-06-10 08:57
has joined #pact-go

s.goel
2021-06-10 14:17
@s.goel has left the channel

kondal.ramidi
2021-06-10 16:13
has joined #pact-go

richard
2021-06-11 00:13
has joined #pact-go

dabfleming
2021-06-11 03:53
Excited to take a look at this.

dabfleming
2021-06-11 04:02
If I have a providerA and two consumers consumerA and consumerB, what is the expected behaviour when I use this: ```req.ConsumerVersionSelectors = []types.ConsumerVersionSelector{ { Pacticipant: "consumerA", Tag: "my-tag", }, }``` I would expect to verify only the contract with consumerA, but what I'm currently seeing in the logs is both contracts being verified.

matt.fellows
2021-06-11 06:36
What?s the rest of your config?

matt.fellows
2021-06-11 06:36
(yes that is my expectation also, but to be fair, I don?t actually really use that feature :stuck_out_tongue: )

jwcarman
2021-06-11 14:23
has joined #pact-go

hello370
2021-06-11 14:58
has joined #pact-go

github2
2021-06-11 17:10
[pact-foundation/pact-go] Issue opened by mgoltzsche

aparnachaudhari
2021-06-12 00:25
Has any one run into an issue when running http pact provider tests with a pact url provided ? The error seems to indicate the server was unable to start

matt.fellows
2021-06-12 01:19
Can you please share the error?

matt.fellows
2021-06-12 01:20
Is this on the beta or current version?

github2
2021-06-12 03:58
[pact-foundation/pact-go] Issue closed by mefellows

github2
2021-06-12 12:13
[pact-foundation/pact-go] Issue closed by mefellows

vikrant82
2021-06-12 12:16
has joined #pact-go

tien.xuan.vo
2021-06-14 01:24
has joined #pact-go


matt.fellows
2021-06-14 01:27
Thanks, looks like I need to cleanup the release script

matt.fellows
2021-06-14 01:27
It shouldn't have any functional impact tho

matt.fellows
2021-06-14 01:27
Those release artifacts aren't used

daniel.bubenheim
2021-06-14 08:05
has joined #pact-go

joaoproenca
2021-06-14 10:15
has joined #pact-go

e.pittaluga.b
2021-06-14 16:34
has joined #pact-go

npatil
2021-06-14 17:28
has joined #pact-go

aparnachaudhari
2021-06-14 20:56
The issue I am seeing is that when the pact provider pipeline that is triggered with webhook (http interactions test) is failing on all interactions with 502's

aparnachaudhari
2021-06-14 20:58
The steps this pipeline should take: 1. Read the pact contract from the url provided by the webhook. 2. Use this contract and then proceed to test the provider a. This is where the failures occur: basically expected: 200, but got:502

aparnachaudhari
2021-06-15 05:35
Is there any known issue where, when the pact url is provided, the verification is run twice?

aparnachaudhari
2021-06-15 05:39
It looks like it does if I pass in the BrokerURL and the PACT URL

aparnachaudhari
2021-06-15 06:07
Bug? i.e. no logic to check if the pact url is provided? don?t bother to go fetch the contract from the broker

matt.fellows
2021-06-15 06:37
That logic is expected to be on the client - we don?t know which is more important to you

matt.fellows
2021-06-15 06:37
I could be wrong, but it may in fact do both (use the URL provided AND fetch dynamically from the broker). That would be the behaviour I would expect. But i?m still confused about the `502`. Which bit is erroring? The test or the connection to the broker?

lucas.rolle
2021-06-15 06:48
has joined #pact-go

github2
2021-06-15 09:03
[pact-foundation/pact-go] Pull request opened by jameshalsall

matt.fellows
2021-06-15 09:04
Any logs/output would be helpful

matt.fellows
2021-06-15 09:05
Also you might want to jump straight to the v2.x.x release. It's a beta for Go, but the core engine is production ready

caoilte
2021-06-15 11:36
has joined #pact-go

caoilte
2021-06-15 14:43
@caoilte has left the channel

aparnachaudhari
2021-06-15 16:43
The 502 was caused cause the tests endpoint were set to be hit only once and with the way verification was being run twice .. the second time was failing.

aparnachaudhari
2021-06-15 16:43
`I could be wrong, but it may in fact do both (use the URL provided AND fetch dynamically from the broker). That would be the behaviour I would expect.` yes it is doing exactly that..


danielabbitt
2021-06-15 17:12
has joined #pact-go

tom.borglum
2021-06-15 17:29
has joined #pact-go

matt.fellows
2021-06-15 23:54
Ah, the alpha is unrelated to the 2.x.x release

matt.fellows
2021-06-15 23:55
I?ve pushed a beta tag up too

matt.fellows
2021-06-15 23:55
But you shouldn?t need it for the branch

matt.fellows
2021-06-15 23:55
were you testing something out that didn?t work?

github2
2021-06-16 01:06
[pact-foundation/pact-go] Pull request merged by mefellows

matt.fellows
2021-06-16 01:07
Ah I see

matt.fellows
2021-06-16 01:07
Makes sense - you?re not testing against a local provider?

aparnachaudhari
2021-06-16 01:07
this is in our CI/CD

matt.fellows
2021-06-16 01:08
is that hitting a real environment though, or running local to the CI/

aparnachaudhari
2021-06-16 01:08
the pact provider pipeline that we were triggering with the custom webhook on contract change event.. was doing this duplicate verification

aparnachaudhari
2021-06-16 01:08
This is our CI/CD pipeline for our infra not my local

matt.fellows
2021-06-16 01:08
but the webhook only fires once, right?

matt.fellows
2021-06-16 01:08
the provider verification is where the configuration happens to say ?dynamically fetch pacts? or ?use a specific pact? (or both)

matt.fellows
2021-06-16 01:09
> This is our CI/CD pipeline for our infra not my local (edited) I think I recall your use case, so I can see why it could be a problem

aparnachaudhari
2021-06-16 01:09
right that configuration is where we had this messing up.. we were not only passing the pact url to test for - from the webhook but also the pact broker url

aparnachaudhari
2021-06-16 01:10
if both the url?s are passed - 2 contracts are pulled and verification happens against both

aparnachaudhari
2021-06-16 01:10
I have fixed the configuration issue right now.. but was a bit confusing to figure out

matt.fellows
2021-06-16 01:10
FWIW the https://docs.pactflow.io/docs/workshops/ci-cd goes through this with a code example

matt.fellows
2021-06-16 01:10
yeah I can see. Not sure the best place for that, aside from in Pact go verification docs.

aparnachaudhari
2021-06-16 01:11
yes .. I have been thru that CI/CD workshop

matt.fellows
2021-06-16 01:11
The behaviour is intended, it?s only a problem because your fixed environment has state.

aparnachaudhari
2021-06-16 01:11
and yes as I mentioned above.. verification or webhook docs will be the right place to put it

matt.fellows
2021-06-16 01:11
Cool. I?ll add that now

matt.fellows
2021-06-16 01:11
thanks (and sorry for the confusion!)

aparnachaudhari
2021-06-16 01:12
nw and thanks

matt.fellows
2021-06-16 01:13
Did you or David get a chance to look at the 2.x.x branch? Keen for feedback and to push it forward, to remove the pain points of the current Ruby and support all of the new goodies

aparnachaudhari
2021-06-16 01:14
will DM

tien.xuan.vo
2021-06-16 02:03
I just notice it. I didn't use or test it so don't worry

matt.fellows
2021-06-16 02:06
cool, thanks for reporting though. All tidied up now :thumbsup:

michael.branders
2021-06-16 06:57
has joined #pact-go

jedlicka
2021-06-16 10:12
has joined #pact-go

jpasse
2021-06-16 13:45
has joined #pact-go

jan.malkiewicz
2021-06-16 14:48
has joined #pact-go

aparnachaudhari
2021-06-17 04:46
I am trying to understand the nuances of using `Given` vs `UponReceiving` when defining interactions for my tests.. what are the cases when you all have used these.

matt.fellows
2021-06-17 06:08
`UponReceiving` is just the scenario name, it has no relevance for the test itself other than giving a useful human readible description

matt.fellows
2021-06-17 06:09
for message pacts however, this is the mapping to the function that it will execute - so it?s more important from that perspective

matt.fellows
2021-06-17 06:10
`Given` specifies the state in which the provider must be in for the test to pass (as we discussed). e.g. `User A exists` could indicate the provider should insert `User A` into the database. It could also be `the downstream system X is unavailable` to be able to test `500` or those kinds of scenarios

matt.fellows
2021-06-17 06:12
In the new 2.x.x branch, I?ve tried to do a better job of clarifing this: https://github.com/pact-foundation/pact-go/blob/2.x.x/docs/consumer.md#managing-test-data-using-provider-states


jeen.broekstra
2021-06-17 06:13
has joined #pact-go

minijb225
2021-06-17 06:44
has joined #pact-go

dabfleming
2021-06-18 02:57
Starting to look at pact-go v2... Looks like the only difference in the interface for an InteractionV2 vs InteractionV3 is with the Given func (parameters or not) and after a With* call you end up with an InteractionRequest either way (with a different model version in the data). Is this correct? How much difference is there in the internals?

matt.fellows
2021-06-18 03:32
> How much difference is there in the internals? The internals have been replaced by a Rust core instead of a Ruby one


matt.fellows
2021-06-18 03:37
The interface is now also exposed as a builder with more features. The existing interface (the ?all in one? struct one) was created to aid migration.

matt.fellows
2021-06-18 03:38
e.g. you can now add binary payloads, there are more matchers and of course, v3 is supported

tomknee1
2021-06-18 08:15
has joined #pact-go

rockin291
2021-06-19 05:18
has joined #pact-go

zainamro1
2021-06-20 17:17
has joined #pact-go

github2
2021-06-20 22:36
[pact-foundation/pact-go] Pull request opened by thetrav

github2
2021-06-20 23:07
[pact-foundation/pact-go] Pull request merged by mefellows

nferrazzano
2021-06-21 05:23
has joined #pact-go

lewis.prescott079
2021-06-21 12:55
has joined #pact-go

vlad
2021-06-21 18:23
has joined #pact-go

christopher.doherty
2021-06-21 19:01
has joined #pact-go

liorra
2021-06-22 04:17
has joined #pact-go

stanojevic.boban
2021-06-22 10:20
has joined #pact-go

miguel.carneiro
2021-06-22 12:51
has joined #pact-go

srinagasai.krishnasan
2021-06-22 17:35
has joined #pact-go

matt.fellows
2021-06-23 02:20
For those looking at trialling the new v2.x.x branch, here is a fully fledged example of Pact in use (by our Terraform provider): https://github.com/pactflow/terraform-provider-pact/blob/master/client/client_pact_test.go

matt.fellows
2021-06-23 02:21
I still need to split logs out into a separate file/output, but I quite like the way it diffs an error inline to your tests now ```--- ? Running Pact tests go test -tags=consumer -count=1 -v http://github.com/pactflow/terraform/client/... === RUN TestClientPact --- PASS: TestClientPact (0.00s) === RUN TestTerraformClientPact === RUN TestTerraformClientPact/Pacticipant === RUN TestTerraformClientPact/Pacticipant/CreatePacticipant === RUN TestTerraformClientPact/Pacticipant/ReadPacticipant === RUN TestTerraformClientPact/Pacticipant/UpdatePacticipant === RUN TestTerraformClientPact/Pacticipant/DeletePacticipant === RUN TestTerraformClientPact/Team === RUN TestTerraformClientPact/Team/ReadTeam === RUN TestTerraformClientPact/Team/CreateTeam === RUN TestTerraformClientPact/Team/UpdateTeam === RUN TestTerraformClientPact/Team/DeleteTeam === RUN TestTerraformClientPact/Team/UpdateTeamAssignments === RUN TestTerraformClientPact/Secret === RUN TestTerraformClientPact/Secret/CreateSecret === RUN TestTerraformClientPact/Secret/UpdateSecret === RUN TestTerraformClientPact/Secret/DeleteSecret === RUN TestTerraformClientPact/Role === RUN TestTerraformClientPact/Role/CreateRole === RUN TestTerraformClientPact/Role/ReadRole === RUN TestTerraformClientPact/Role/UpdateRole === RUN TestTerraformClientPact/Role/DeleteRole === RUN TestTerraformClientPact/User === RUN TestTerraformClientPact/User/CreateUser === RUN TestTerraformClientPact/User/ReadUser === RUN TestTerraformClientPact/User/UpdateUser === RUN TestTerraformClientPact/User/DeleteUser === RUN TestTerraformClientPact/User/SetUserRoles === RUN TestTerraformClientPact/Token === RUN TestTerraformClientPact/Token/ReadTokens === RUN TestTerraformClientPact/Token/RegenerateToken === RUN TestTerraformClientPact/Webhook === RUN TestTerraformClientPact/Webhook/CreateWebhook === RUN TestTerraformClientPact/Webhook/ReadWebhook === RUN TestTerraformClientPact/Webhook/UpdateWebhook === RUN TestTerraformClientPact/Webhook/DeleteWebhook === RUN TestTerraformClientPact/Webhook/AuthenticationSettings === RUN TestTerraformClientPact/Webhook/AuthenticationSettings/SetTenantAuthenticationSettings === RUN TestTerraformClientPact/Webhook/AuthenticationSettings/ReadTenantAuthenticationSettings client_pact_test.go:932: Pact Verification Failed for: TestTerraformClientPact/Webhook/AuthenticationSettings/ReadTenantAuthenticationSettings Diff: actual: GET /admin/tenant/authentication-settings (Unexpected request was received) expected: GET /dmin/tenant/authentication-settings (Expected request that was not received) client_pact_test.go:942: Error Trace: client_pact_test.go:942 Error: Received unexpected error: system unavailable please see the log for error details Test: TestTerraformClientPact/Webhook/AuthenticationSettings/ReadTenantAuthenticationSettings --- FAIL: TestTerraformClientPact (0.10s) --- PASS: TestTerraformClientPact/Pacticipant (0.02s) --- PASS: TestTerraformClientPact/Pacticipant/CreatePacticipant (0.01s) --- PASS: TestTerraformClientPact/Pacticipant/ReadPacticipant (0.00s) --- PASS: TestTerraformClientPact/Pacticipant/UpdatePacticipant (0.00s) --- PASS: TestTerraformClientPact/Pacticipant/DeletePacticipant (0.00s) --- PASS: TestTerraformClientPact/Team (0.02s) --- PASS: TestTerraformClientPact/Team/ReadTeam (0.00s) --- PASS: TestTerraformClientPact/Team/CreateTeam (0.00s) --- PASS: TestTerraformClientPact/Team/UpdateTeam (0.00s) --- PASS: TestTerraformClientPact/Team/DeleteTeam (0.00s) --- PASS: TestTerraformClientPact/Team/UpdateTeamAssignments (0.00s) --- PASS: TestTerraformClientPact/Secret (0.01s) --- PASS: TestTerraformClientPact/Secret/CreateSecret (0.00s) --- PASS: TestTerraformClientPact/Secret/UpdateSecret (0.00s) --- PASS: TestTerraformClientPact/Secret/DeleteSecret (0.00s) --- PASS: TestTerraformClientPact/Role (0.01s) --- PASS: TestTerraformClientPact/Role/CreateRole (0.00s) --- PASS: TestTerraformClientPact/Role/ReadRole (0.00s) --- PASS: TestTerraformClientPact/Role/UpdateRole (0.00s) --- PASS: TestTerraformClientPact/Role/DeleteRole (0.00s) --- PASS: TestTerraformClientPact/User (0.02s) --- PASS: TestTerraformClientPact/User/CreateUser (0.00s) --- PASS: TestTerraformClientPact/User/ReadUser (0.00s) --- PASS: TestTerraformClientPact/User/UpdateUser (0.00s) --- PASS: TestTerraformClientPact/User/DeleteUser (0.00s) --- PASS: TestTerraformClientPact/User/SetUserRoles (0.00s) --- PASS: TestTerraformClientPact/Token (0.01s) --- PASS: TestTerraformClientPact/Token/ReadTokens (0.00s) --- PASS: TestTerraformClientPact/Token/RegenerateToken (0.00s) --- FAIL: TestTerraformClientPact/Webhook (0.02s) --- PASS: TestTerraformClientPact/Webhook/CreateWebhook (0.00s) --- PASS: TestTerraformClientPact/Webhook/ReadWebhook (0.00s) --- PASS: TestTerraformClientPact/Webhook/UpdateWebhook (0.00s) --- PASS: TestTerraformClientPact/Webhook/DeleteWebhook (0.00s) --- FAIL: TestTerraformClientPact/Webhook/AuthenticationSettings (0.00s) --- PASS: TestTerraformClientPact/Webhook/AuthenticationSettings/SetTenantAuthenticationSettings (0.00s) --- FAIL: TestTerraformClientPact/Webhook/AuthenticationSettings/ReadTenantAuthenticationSettings (0.00s) FAIL FAIL http://github.com/pactflow/terraform/client 0.273s FAIL```

varnit.garg2424
2021-06-23 06:19
has joined #pact-go

varun.patil
2021-06-23 12:44
has joined #pact-go

mselvakumar
2021-06-23 23:54
has joined #pact-go

srikanth.rachakonda
2021-06-24 02:32
has joined #pact-go

ali.akbar
2021-06-24 06:58
has joined #pact-go

erterpstra
2021-06-24 19:20
has joined #pact-go

abinzahid
2021-06-25 06:12
has joined #pact-go

jchandorkar
2021-06-26 09:01
has joined #pact-go

rani.sathya
2021-06-27 04:14
has joined #pact-go

cala.dev_pact
2021-06-28 04:07
has joined #pact-go

robert.rap
2021-06-28 06:34
has joined #pact-go

v-ratngupta
2021-06-28 07:13
has joined #pact-go

e.hallowell
2021-06-28 13:28
has joined #pact-go

mishalalexander20
2021-06-29 07:36
has joined #pact-go

lukemufc125
2021-06-29 07:57
has joined #pact-go

prash471
2021-06-29 09:43
has joined #pact-go

martijn.hagens
2021-06-29 10:12
has joined #pact-go

miguel.carneiro
2021-06-29 10:23
@miguel.carneiro has left the channel

mikko.s.koskinen
2021-06-29 17:05
has joined #pact-go

zhaoyi0113
2021-06-30 02:13
has joined #pact-go

sgottipati
2021-07-01 06:02
has joined #pact-go

vshankar
2021-07-01 06:06
has joined #pact-go

e.generalov
2021-07-01 07:19
has joined #pact-go

eduards.klavins
2021-07-01 13:44
has joined #pact-go

darshan
2021-07-01 14:21
has joined #pact-go

felix.gomez
2021-07-01 14:38
has joined #pact-go

bbako
2021-07-01 20:51
has joined #pact-go

phil.armstrong
2021-07-02 06:49
has joined #pact-go

gargshubham49
2021-07-02 07:21
has joined #pact-go

github2
2021-07-02 08:54
[pact-foundation/pact-go] Issue opened by bbmokus

github2
2021-07-02 15:51
[pact-foundation/pact-go] Pull request opened by bbmokus

github2
2021-07-03 00:27
[pact-foundation/pact-go] Pull request merged by mefellows

github2
2021-07-05 07:19
[pact-foundation/pact-go] Issue closed by mefellows

vinnys.lins
2021-07-05 13:49
has joined #pact-go

talank
2021-07-06 03:52
has joined #pact-go

juri.petersen
2021-07-06 07:29
has joined #pact-go

leolvicario
2021-07-06 07:36
has joined #pact-go

swoichhaa
2021-07-06 08:46
has joined #pact-go

ivo.velthoven174
2021-07-06 09:28
has joined #pact-go

fjtdg
2021-07-06 12:16
has joined #pact-go

steve.etherington
2021-07-06 16:44
has joined #pact-go

rosh.mjohn
2021-07-07 07:19
has joined #pact-go

mahajanalokkumar
2021-07-07 10:41
has joined #pact-go

jyiyng2002
2021-07-07 19:57
has joined #pact-go

splurgeop
2021-07-07 21:48
has joined #pact-go

kapoor.manil
2021-07-07 22:30
has joined #pact-go

pashas.2k3
2021-07-08 03:41
has joined #pact-go

vijayanaggella
2021-07-08 05:25
has joined #pact-go

ananthshenoy03
2021-07-08 05:46
has joined #pact-go

sai5i.islam
2021-07-08 06:40
has joined #pact-go

github2
2021-07-08 07:45
[pact-foundation/pact-go] Issue opened by raoulk

poorvasgokhale
2021-07-08 09:08
has joined #pact-go

suresh.thammishetti
2021-07-08 11:08
has joined #pact-go

michael.katende
2021-07-09 10:41
has joined #pact-go

marcin.baranowski953
2021-07-09 10:42
has joined #pact-go

bedfordwest
2021-07-10 22:21
has joined #pact-go

firstamit
2021-07-11 14:07
has joined #pact-go

omar554
2021-07-11 21:54
has joined #pact-go

k.deepupardha
2021-07-12 10:23
has joined #pact-go

lumenofor
2021-07-12 10:46
has joined #pact-go

jayr.motta
2021-07-12 13:57
has joined #pact-go

doug.shattuck
2021-07-12 20:26
has joined #pact-go

sorin_balbae
2021-07-13 07:41
has joined #pact-go

akara
2021-07-13 10:34
has joined #pact-go

nathan.derave
2021-07-13 12:28
has joined #pact-go

matthew.schaad
2021-07-13 21:29
has joined #pact-go

neenad.jadhavgre
2021-07-13 22:30
has joined #pact-go

cristian
2021-07-14 06:18
has joined #pact-go

michal.bernhard
2021-07-14 11:16
has joined #pact-go

richard.jones254
2021-07-14 23:53
has joined #pact-go

edanielsen
2021-07-15 00:46
has joined #pact-go

abatan.k
2021-07-15 03:48
has joined #pact-go

mandeep302755
2021-07-15 04:49
has joined #pact-go

mahajanrupali22
2021-07-15 05:46
has joined #pact-go

hylke.de.jong
2021-07-15 12:49
has joined #pact-go

efemgy
2021-07-15 14:27
has joined #pact-go

amreenshaik.basha
2021-07-16 04:06
has joined #pact-go

rhian.van.esch
2021-07-16 12:14
has joined #pact-go

wilco.van.esch
2021-07-16 12:30
has joined #pact-go

karl.morrison
2021-07-16 12:56
has joined #pact-go

timothyjabez
2021-07-16 17:23
has joined #pact-go

kamoljan
2021-07-18 02:33
Do I need to use `"http://github.com/pact-foundation/pact-workshop-go/provider"` for provider service?

matt.fellows
2021-07-18 02:37
no, that?s the provider from the workshop!

matt.fellows
2021-07-18 02:37
You should use your own provider

kamoljan
2021-07-18 02:39
I see, then I am not sure why I am getting `Error on Verify: Actual interactions do not match expected interactions for mock MockService`

matt.fellows
2021-07-18 02:40
are you in the workshop or in your own test?

matt.fellows
2021-07-18 02:40
that?s a consumer test failure, which step is erroring?

matt.fellows
2021-07-18 02:41
There should be more context in either the terminal or a log file that shows what it expected and what it got

matt.fellows
2021-07-18 02:41
usually, it means your consumer code is not calling the endpoint defined in the test

kamoljan
2021-07-18 02:44
```I, [2021-07-18T11:34:57.392109 #9752] INFO -- : Registered expected interaction GET /health D, [2021-07-18T11:34:57.392312 #9752] DEBUG -- : { "description": "A request for health check'", "providerState": "Health exists", "request": { "method": "GET", "path": { "json_class": "Pact::Term", "data": { "generate": "/health", "matcher": { "json_class": "Regexp", "o": 0, "s": "/health" } } } }, "response": { "status": 200, "headers": { "Content-Type": { "json_class": "Pact::Term", "data": { "generate": "application/vnd.api+json", "matcher": { "json_class": "Regexp", "o": 0, "s": "application\\/vnd.api\\+json" } } } } }, "metadata": null } W, [2021-07-18T11:34:57.395111 #9752] WARN -- : Verifying - actual interactions do not match expected interactions. Missing requests: GET /health W, [2021-07-18T11:34:57.395142 #9752] WARN -- : Missing requests: GET /health I, [2021-07-18T11:34:57.396814 #9752] INFO -- : Cleared interactions```

matt.fellows
2021-07-18 02:44
that indicates your consumer test is not sending the request to the mock service

matt.fellows
2021-07-18 02:45
can you please share your code?


kamoljan
2021-07-18 02:46
```// +build integration package client import ( "fmt" "os" "testing" "http://github.com/pact-foundation/pact-go/dsl" "net/url" ) var commonHeaders = dsl.MapMatcher{ "Content-Type": term("application/vnd.api+json", `application\/vnd.api\+json`), //"X-Api-Correlation-Id": dsl.Like("100"), } var u *url.URL var client *Client func TestMain(m *testing.M) { var exitCode int // Setup Pact and related test stuff setup() // Run all the tests exitCode = m.Run() // Shutdown the Mock Service and Write pact files to disk if err := pact.WritePact(); err != nil { fmt.Println(err) os.Exit(1) } pact.Teardown() os.Exit(exitCode) } func TestClientPact_Regions(t *testing.T) { t.Run("Health exists", func(t *testing.T) { pact. AddInteraction(). Given("Health exists"). UponReceiving("A request for health check'"). WithRequest(request{ Method: "GET", Path: term("/health", "/health"), }). WillRespondWith(dsl.Response{ Status: 200, Headers: commonHeaders, }) err := pact.Verify(func() error { _, err := client.GetHealth() return err }) if err != nil { t.Fatalf("Error on Verify: %v", err) } }) /* TODO: Uncomment for GetRegions t.Run("All regions exists", func(t *testing.T) { pact. AddInteraction(). Given("All regions exists"). UponReceiving("A request for all regions"). WithRequest(request{ Method: "GET", Path: term("", ""), }). WillRespondWith(dsl.Response{ Status: 200, Body: dsl.Match(model.Result{}), Headers: commonHeaders, }) err := pact.Verify(func() error { body, err := client.GetRegions() message := "successfully get regions" // Assert basic fact if body.Message != message { return fmt.Errorf("wanted %v but got %v", body.Message, message) } return err }) if err != nil { t.Fatalf("Error on Verify: %v", err) } }) */ } // Common test data var pact dsl.Pact // Aliases var term = dsl.Term type request = dsl.Request func setup() { pact = createPact() // Proactively start service to get access to the port pact.Setup(true) // TODO: Uncomment after port mapping with provider //u, _ = url.Parse(fmt.Sprintf("http://localhost:%d", pact.Server.Port)) u, _ = url.Parse(fmt.Sprintf("http://localhost:%d", 9000)) client = &Client{ BaseURL: u, } } func createPact() dsl.Pact { return dsl.Pact{ Consumer: os.Getenv("CONSUMER_NAME"), Provider: os.Getenv("PROVIDER_NAME"), LogDir: os.Getenv("LOG_DIR"), PactDir: os.Getenv("PACT_DIR"), LogLevel: "INFO", } }```

matt.fellows
2021-07-18 02:47
what is port `9000`?

matt.fellows
2021-07-18 02:47
I think it should be the line that?s currently commented out

matt.fellows
2021-07-18 02:47
i.e. ```u, _ = url.Parse(fmt.Sprintf("http://localhost:%d", pact.Server.Port))```

kamoljan
2021-07-18 02:47
that?s my provider service?s port

matt.fellows
2021-07-18 02:47
yep, you shouldn?t be hitting the real provider, you need to use the mock

matt.fellows
2021-07-18 02:48
Pact is your provider mock, think of this as a unit test of your consumer client code

kamoljan
2021-07-18 02:48
so it is always through the mock?

matt.fellows
2021-07-18 02:49
yes

kamoljan
2021-07-18 02:49
can I replace this mock with Pactflow?

matt.fellows
2021-07-18 02:50
Pactflow is not a mock, it?s a commercial version of the Pact Broker.

matt.fellows
2021-07-18 02:50
Think of it this way

matt.fellows
2021-07-18 02:50
Pact is a unit testing tool

matt.fellows
2021-07-18 02:50
Pactflow is a CI/CD tool

matt.fellows
2021-07-18 02:50
(this is a crude deliniation, but probably good enough for now)

kamoljan
2021-07-18 02:51
ok? if Pact is a unit testing tool, do I still need unit test (client_test.go)?

matt.fellows
2021-07-18 02:52
that is a good question, and is a little harder to answer in absolutes because that really depends on the code you?re testing

matt.fellows
2021-07-18 02:53
many times Pact is sufficient for unit testing an API client

matt.fellows
2021-07-18 02:53
> ok? if Pact is a unit testing tool, do I still need unit test (client_test.go)? Oh right, in the workshop? No, Pact definitely replaces that test

kamoljan
2021-07-18 02:54
I see, thank you very much for your clarifications! :slightly_smiling_face:

matt.fellows
2021-07-18 02:54
that?s the point of the workshop - that test is only so helpful, but doesn?t give us any confidence when deploying. Pact gives us more because the mock is validated by the provider


kamoljan
2021-07-18 06:43
How `dsl.Match` can understand the following module? ```package model type Region struct { Message string `json:"message" pack:"example=successfully get regions"` Results []Result `json:"result" pack:"example=(.*)"` }```

matt.fellows
2021-07-18 11:23
`pack` should be `pact`

matt.fellows
2021-07-18 11:24
but also, the example can?t be a regex - it needs to be a string value that will be used as the example


matt.fellows
2021-07-18 11:24
personally, I don?t often use it, because it only covers basic scenarios, making it difficult to use in situations where you want to test different values

matt.fellows
2021-07-18 11:25
If you?re only just getting started with Pact, you may want to look at jumping straight to the latest version (currently in beta): https://github.com/pact-foundation/pact-go/#v3-beta

kamoljan
2021-07-18 12:04
Oh, let me look at it. Thank you Matt!

ppdnguyen
2021-07-18 16:23
has joined #pact-go

cgoodison
2021-07-18 23:56
has joined #pact-go

sripathi
2021-07-19 12:30
has joined #pact-go

calvin.krist
2021-07-19 15:29
has joined #pact-go

vinay.viswanadha
2021-07-19 15:30
has joined #pact-go

brian.mitchell
2021-07-19 15:37
has joined #pact-go

mike.geeves064
2021-07-19 18:07
has joined #pact-go

ben.clare2
2021-07-20 08:16
has joined #pact-go

rafael.moral
2021-07-20 11:48
has joined #pact-go

andrii.rakhimov
2021-07-20 23:06
has joined #pact-go

boris.gordon
2021-07-20 23:25
has joined #pact-go

github2
2021-07-22 00:25
[pact-foundation/pact-go] Issue opened by bethesque

ryn.anderson
2021-07-22 17:41
has joined #pact-go

schakalabbi
2021-07-22 21:29
has joined #pact-go

uryadov212
2021-07-23 06:21
@uryadov212 has left the channel

consulting
2021-07-23 12:33
has joined #pact-go

galante2123
2021-07-23 14:14
has joined #pact-go

dc113604
2021-07-23 14:39
has joined #pact-go

kamoljan
2021-07-24 08:47
btw, I am trying the latest version and getting this warning ```ld: warning: directory not found for option '-L/opt/pact/lib'``` during `Running Pact tests`

kamoljan
2021-07-25 11:56
Do you have an example for testing provider which is external? Or how do you that? Mocking and updating your mock periodically?

matt.fellows
2021-07-25 12:05
What do you mean by external? Like a 3rd party?

kamoljan
2021-07-25 12:05
yes, 3rd party

matt.fellows
2021-07-25 12:07
No gloang examples I know of. We did an AMA on this a few months back https://docs.pact.io/help/amas/#join-an-upcoming-ask-me-anything-ama-session

kamoljan
2021-07-25 12:09
Thank you, watching

dsinecos
2021-07-26 04:49
has joined #pact-go

mebenhoeh
2021-07-26 05:20
has joined #pact-go

dsinecos
2021-07-26 05:28
Hi all, I'm playing around with pact-go, version 2.x.x. I've a question around contract testing a Provider SDK method when I expect it to return an error, something like the following ```// Act: test our API client behaves correctly err = mockProvider.ExecuteTest(t, func(config pact.MockServerConfig) error { // Execute the API client data, err := ProviderSDKMethod(config.Host, config.Port) // Assert assert.EqualError(t, err, fmt.Sprintf("Internal Server Error")) assert.Nil(t, data) return nil })``` Could you share what is the recommended way to write `mockProvider.ExecuteTest` when I expect the SDK method for the provider service to return an error. In the regular scenario I can just return the err from `ProviderSDKMethod` If it is nil the pact contract files are updated else they are not. But when I expect the `err` from `ProviderSDKMethod` to be non-nil, 1) Should I return a nil error. The challenge here is, if one of the earlier assertions fail, assert.EqualError, the pact contract files still get updated 2) If I return the `non-nil` error received from ProviderSDKMethod, then the contract files won't be updated Please share any guidance on this, Thanks

matt.fellows
2021-07-26 05:30
does it matter if the pact file is updated but the tests themselves fail? Presumably you?re not going to publish a pact for a broken set of tests?

dsinecos
2021-07-26 05:36
Hey @matt.fellows, ? When the tests pass, that means I have a non-nil `err` from `ProviderSDKMethod` and they satisfy the `assert.EqualError` assertion. In this scenario, I should return nil from the `func(config pact.MockServerConfig) error {}` to allow updating the pact contract tests ? The issue is that if I return nil, then even when the assert.EqualError assertion fails, my pact contract files would still end up getting updated (because I'm returning nil). But I don't want that. Maybe I'm missing something obvious here, hope this makes sense :slightly_smiling_face:

matt.fellows
2021-07-26 05:36
got it

matt.fellows
2021-07-26 05:37
but my point is, who cares if the pact file gets updated. `assert.<whatever>` should fail your tests

matt.fellows
2021-07-26 05:38
?and you shouldn?t do anything with the pact file

dsinecos
2021-07-26 05:39
I understand your point is that once I fix my failing tests, my contracts would get updated with the passing tests anyways. So I shouldn't be worrying about the intermediate phases, ?

matt.fellows
2021-07-26 05:39
yeah

matt.fellows
2021-07-26 05:39
the caveat is that you should be clearing out the pacts directory before you run the tests

dsinecos
2021-07-26 05:42
> the caveat is that you should be clearing out the pacts directory before you run the tests I'd a small clarification on this. So I observed that when I change the text inside matchers eg. `pact.S("Original text")` to `pact.S("Changed text")`. It doesn't get updated in the pact contract tests. I need to delete the contract tests folder and rerun the tests for these changes to take effect. Is this expected behavior or something that happens cause v2.x.x is in beta. basically in the pact workflow, when updating consumer tests, should I always clear up the pact directory so there's always a new copy written instead of exepecting the changes to be accurately overwritten on the existing contract-test-files

matt.fellows
2021-07-26 05:46
> basically in the pact workflow, when updating consumer tests, should I always clear up the pact directory so there?s always a new copy written instead of exepecting the changes to be accurately overwritten on the existing contract-test-files (edited) At the moment, yes you need to do this.

matt.fellows
2021-07-26 05:46
It should be possible to automatically do this in the framework.

dsinecos
2021-07-26 05:53
> It should be possible to automatically do this in the framework. Is there a configuration for this in pact-go? Or you meant running the clean-up insde a `Before` handler of sorts

matt.fellows
2021-07-26 05:55
Not at the moment, but it can easily be exposed

matt.fellows
2021-07-26 05:55
it?s available in the shared core

matt.fellows
2021-07-26 05:55
I hadn?t exposed it yet, because I was still a littlle uncertain about how Pact Go should be used

matt.fellows
2021-07-26 05:57
I think if we disallow parallel tests (because seriously, it?s fast enough without it - it?s also currently documented that way, I think) then we should expose automatically cleaning as an option, default it to true and things will be easier

dsinecos
2021-07-26 05:59
Yep, I agree. Thanks for answering the queries :slightly_smiling_face:

matt.fellows
2021-07-26 06:00
Mind raising that as an issue so I don?t forget?

matt.fellows
2021-07-26 06:00
I?ll get to it on my next OSS day

dsinecos
2021-07-26 06:01
Sure, I'll do that on pact-go :thumbsup:

github2
2021-07-26 08:35
[pact-foundation/pact-go] Issue opened by dsinecos

dsmileb
2021-07-26 16:06
has joined #pact-go

hazel.wright
2021-07-26 19:04
has joined #pact-go

matt682
2021-07-27 01:32
has joined #pact-go

dsinecos
2021-07-27 08:02
I'm trying to experiment with pact-broker locally. I've used the https://github.com/pact-foundation/pact-broker-docker/blob/master/docker-compose.yml file to set it up. It's running successfully and I can view the dashboards in the browser :thumbsup: I'm not clear on how to configure pact-go when writing consumer tests to send the contract files to the pact-broker. I found https://github.com/pact-foundation/pact-go/#publishing-from-go-code but I'm experimenting on v2.x.x and I'm not sure where to locate the `Publisher` type. I've this in my go imports `pact "http://github.com/pact-foundation/pact-go/v2/sugar"` Please help to share any guidance on this, Thanks :slightly_smiling_face:

matt.fellows
2021-07-27 08:04
Just use the pact CLI



dsinecos
2021-07-27 09:51
Tried to run the provider tests (I was able to successfully send the pact contracts to pact broker). I get the following error when running provider tests ```--- FAIL: Test_Provider (0.11s) --- FAIL: Test_Provider/Provider_pact_verification (0.00s) http_verifier.go:136: an unknown error ocurred when verifying the provider (this indicates a defect in the framework provider_test.go:79: Error Trace: provider_test.go:79 Error: Received unexpected error: an unknown error ocurred when verifying the provider (this indicates a defect in the framework Test: Test_Provider FAIL exit status 1``` My config for using the pact broker ```err := verifier.VerifyProvider(t, VerifyRequest{ ProviderBaseURL: "http://localhost:9000", ProviderVersion: "1.0.0", BrokerURL: "http://localhost:9292", Tags: []string{"master"}, })``` Sharing here, in case this strikes any ideas to help debug :pray: :slightly_smiling_face:

matt.fellows
2021-07-27 09:54
Thanks, can you please enable debug logs and share?

matt.fellows
2021-07-27 09:54
There's a log level method you can call before running tests

matt.fellows
2021-07-27 09:54
See examples dir

dsinecos
2021-07-27 09:59
Logs ```2021/07/27 15:28:33 [DEBUG] starting new proxy with opts {http localhost:9000 0 [] /__setup/ <nil>} 2021/07/27 15:28:33 [DEBUG] starting reverse proxy on port 38913 2021/07/27 15:28:33 [DEBUG] waiting for port 38913 to become available 2021/07/27 15:28:33 [DEBUG] pact provider verification 2021/07/27 15:28:33 [DEBUG] waiting for port 38913 to become available 2021/07/27 15:28:33 [DEBUG] initialising rust verifier interface 2021/07/27 15:28:33 [DEBUG] executing verifier FFI with args [--hostname localhost --port 38913 --broker-url http://localhost:9292 --provider-version 1.0.0 --loglevel debug --consumer-version-tags master] an unknown error ocurred when verifying the provider (this indicates a defect in the framework --- FAIL: Test_Provider (0.10s) --- FAIL: Test_Provider/Provider_pact_verification (0.00s) http_verifier.go:136: an unknown error ocurred when verifying the provider (this indicates a defect in the framework provider_test.go:79: Error Trace: provider_test.go:79 Error: Received unexpected error: an unknown error ocurred when verifying the provider (this indicates a defect in the framework Test: Test_Provider FAIL exit status 1``` One more thing, the provider tests run fine when I use the local files created in pact directory

matt.fellows
2021-07-27 10:08
Ah sorry can you please try a trace?

matt.fellows
2021-07-27 10:09
I do need CI to have an example use the broker so I'll do that.

dsinecos
2021-07-27 10:13
After I set the log level to `TRACE` as per the example, it's pretty much the same output ```2021/07/27 15:41:54 [DEBUG] starting new proxy with opts {http localhost:9000 0 [] /__setup/ <nil>} 2021/07/27 15:41:54 [DEBUG] starting reverse proxy on port 46695 2021/07/27 15:41:54 [DEBUG] waiting for port 46695 to become available 2021/07/27 15:41:54 [DEBUG] pact provider verification 2021/07/27 15:41:54 [DEBUG] waiting for port 46695 to become available 2021/07/27 15:41:54 [DEBUG] initialising rust verifier interface 2021/07/27 15:41:54 [DEBUG] executing verifier FFI with args [--hostname localhost --port 46695 --broker-url http://localhost:9292 --provider-version 1.0.0 --loglevel trace --consumer-version-tags master] an unknown error ocurred when verifying the provider (this indicates a defect in the framework --- FAIL: Test_Provider (0.11s) --- FAIL: Test_Provider/Provider_pact_verification (0.00s) http_verifier.go:136: an unknown error ocurred when verifying the provider (this indicates a defect in the framework provider_test.go:79: Error Trace: provider_test.go:79 Error: Received unexpected error: an unknown error ocurred when verifying the provider (this indicates a defect in the framework Test: Test_Provider FAIL exit status 1```

github2
2021-07-27 13:47
[pact-foundation/pact-go] Pull request ready for review by mefellows

github2
2021-07-27 13:48
[pact-foundation/pact-go] Pull request merged by mefellows

matt.fellows
2021-07-27 13:49
@dsinecos I?ve just merged the latest branch off 2.x.x which had support for verifying message metadata

matt.fellows
2021-07-27 13:49
it also uses the latest FFI bindings

matt.fellows
2021-07-27 13:49
I just added an e2e example using Pactflow, to give me some continued confidence it does work with a broker

matt.fellows
2021-07-27 13:49
if you could please share your code, that might help

matt.fellows
2021-07-27 13:50
it?s possible, although unlikely as I think you?d have experienced a warning earlier (and your consumer tests would probably also have failed) that the bindings haven?t installed correctly

matt.fellows
2021-07-27 13:50
I?ll check back in tomorrow

github2
2021-07-27 13:51
[pact-foundation/pact-go] New release _https://github.com/pact-foundation/pact-go/releases/tag/v2.0.0-beta.2_ published by mefellows

vbhardwaj.eminent
2021-07-28 05:15
has joined #pact-go

miguel.panelo
2021-07-28 07:29
has joined #pact-go

otaviio
2021-07-28 07:57
has joined #pact-go

patrice.krakow
2021-07-28 10:00
has joined #pact-go

dsinecos
2021-07-28 10:02
Hey @matt.fellows, I upgraded just now the v2.0.0-beta.2. Now when I run the consumer tests using `go test` I get this error ```# http://github.com/pact-foundation/pact-go/v2/internal/native /usr/bin/ld: cannot find -lpact_ffi collect2: error: ld returned 1 exit status FAIL http://github.com/dsinecos/contract_testing/consumer [build failed]``` The consumer tests were running fine before the upgrade.

dsinecos
2021-07-28 10:02
Here's the repository where I'm experimenting - https://github.com/dsinecos/pact-contract-testing

dsinecos
2021-07-28 10:03
The latest commit is from yesterday, so I haven't committed the upgrade to v2.0.0-beta.2 that I did today

matt.fellows
2021-07-28 10:04
You would need to rerun the install, it's a new FFI

matt.fellows
2021-07-28 10:04
Thanks, I'll try and take a look later!

dsinecos
2021-07-28 10:04
Thanks, let me do that

dsinecos
2021-07-28 10:34
Updated the FFI, receiving this error when I run the provider tests ```2021/07/28 16:01:49 [INFO] package libpact_ffi found 2021/07/28 16:01:49 [INFO] checking version 0.0.0 for lib libpact_ffi within semver range >= 0.0.0, < 1.0.0 2021/07/28 16:01:49 [INFO] checking version 0.0.0 of libpact_ffi against semver constraint >= 0.0.0, < 1.0.0 2021/07/28 16:01:49 [DEBUG] 0.0.0 satisfies constraints 0.0.0 >= 0.0.0, < 1.0.0 2021/07/28 16:01:49 [DEBUG] version check completed 2021/07/28 16:01:49 [DEBUG] starting new proxy with opts {http localhost:9000 0 [] /__setup <nil>} 2021/07/28 16:01:49 [DEBUG] starting reverse proxy on port 33545 2021/07/28 16:01:49 [DEBUG] waiting for port 33545 to become available 2021/07/28 16:01:49 [DEBUG] pact provider verification 2021/07/28 16:01:49 [DEBUG] waiting for port 33545 to become available 2021/07/28 16:01:49 [DEBUG] initialising rust mock server interface 2021/07/28 16:01:49 [DEBUG] executing verifier FFI with args [--hostname localhost --port 33545 --broker-url http://localhost:9292 --provider-version 1.0.0 --publish --loglevel trace] [2021-07-28T10:31:49Z ERROR pact_ffi::verifier::verifier] error verifying Pact: "error: The following required arguments were not provided:\n --provider-name <provider-name>\n\nUSAGE:\n pact_verifier_cli --broker-url <broker-url>... --hostname <hostname> --loglevel <loglevel> --port <port> --provider-name <provider-name> --provider-version <provider-version> --publish --scheme <scheme>\n\nFor more information try --help" Error { message: "error: The following required arguments were not provided:\n --provider-name <provider-name>\n\nUSAGE:\n pact_verifier_cli --broker-url <broker-url>... --hostname <hostname> --loglevel <loglevel> --port <port> --provider-name <provider-name> --provider-version <provider-version> --publish --scheme <scheme>\n\nFor more information try --help", kind: MissingRequiredArgument, info: None } --- FAIL: Test_Provider (0.11s) --- FAIL: Test_Provider/Provider_pact_verification (0.00s) http_verifier.go:136: an unknown error ocurred when verifying the provider (this indicates a defect in the framework provider_test.go:76: Error Trace: provider_test.go:76 Error: Received unexpected error: an unknown error ocurred when verifying the provider (this indicates a defect in the framework Test: Test_Provider FAIL exit status 1```

dsinecos
2021-07-28 10:36
One more thing, when I want to update the FFI using `pact-go -l DEBUG install` it attempts to install at `/usr/local/lib` and needs `sudo` to run. Is there a way to change this destination? I don't want to run using `sudo` Currently I'm doing a explicit wget, gunzip followed by moving the unzipped file into `~/.local/lib` and creating a symbolic link from `/usr/local/lib`

david.simpson
2021-07-28 12:51
has joined #pact-go

e.alderson004
2021-07-28 17:17
has joined #pact-go

jdalessandro
2021-07-29 07:27
has joined #pact-go

github2
2021-07-29 08:00
[pact-foundation/pact-go] Pull request opened by antklim

eric.tang1
2021-07-29 16:22
has joined #pact-go

antklim
2021-07-29 22:25
has joined #pact-go

toffer.lim87
2021-07-30 03:51
has joined #pact-go

dsinecos
2021-07-30 04:30
Hey @matt.fellows, thanks for pushing the updated FFI. I've fixed the error I was facing using the debug logs :slightly_smiling_face:

matt.fellows
2021-07-30 04:34
Good to know. What was it?

matt.fellows
2021-07-30 04:34
More importantly, how can I make that easier to debug?

dsinecos
2021-07-30 04:46
I'd not added the `ProviderName` :face_palm:, so it didn't know which pact contract tests to fetch from the broker > how can I make that easier to debug? After you updated the FFI, and I ran it in DEBUG mode, it highlighted the error :slightly_smiling_face: ```"error: The following required arguments were not provided:\n --provider-name <provider-name>```

matt.fellows
2021-07-30 04:47
Ah, ok sorry I didn't see that

matt.fellows
2021-07-30 04:47
We'll be improving those messages, but for now that's the best you have sorry :grimacing:

github2
2021-07-30 07:28
[pact-foundation/pact-go] Pull request opened by antklim

aphronio
2021-07-30 13:42
has joined #pact-go

fabio882
2021-08-01 19:31
has joined #pact-go

mike.key
2021-08-02 03:01
has joined #pact-go

eddie
2021-08-02 04:08
has joined #pact-go

marvin.kienitz
2021-08-05 07:20
has joined #pact-go

danieljak
2021-08-05 10:09
has joined #pact-go

univ.anirudh
2021-08-05 13:22
has joined #pact-go

james.perepiczka
2021-08-05 16:29
has joined #pact-go

j3rry.wan9
2021-08-05 21:44
has joined #pact-go

sadikshahidain
2021-08-06 02:14
has joined #pact-go

ganginenik
2021-08-06 18:14
has joined #pact-go

github2
2021-08-09 01:10
[pact-foundation/pact-go] Pull request merged by mefellows

github2
2021-08-09 03:01
[pact-foundation/pact-go] Pull request merged by mefellows

github2
2021-08-09 07:17
[pact-foundation/pact-go] Pull request merged by mefellows

github2
2021-08-09 07:17
[pact-foundation/pact-go] Pull request merged by mefellows

github2
2021-08-09 07:17
[pact-foundation/pact-go] Pull request merged by mefellows

github2
2021-08-09 07:18
[pact-foundation/pact-go] Pull request merged by mefellows

github2
2021-08-09 07:18
[pact-foundation/pact-go] Pull request merged by mefellows

github2
2021-08-09 07:42
[pact-foundation/pact-go] Issue closed by mefellows

george.south
2021-08-09 21:51
@george.south has left the channel

xiaoyewang
2021-08-10 01:13
has joined #pact-go

mfellows_admin
2021-08-10 02:52
has joined #pact-go

qingyuliu
2021-08-10 09:27
has joined #pact-go

dhairyapatel071996
2021-08-10 20:06
has joined #pact-go

beem132
2021-08-10 21:21
has joined #pact-go

rfang
2021-08-11 00:49
has joined #pact-go

subhashnarla
2021-08-11 07:29
has joined #pact-go

jkdihenkar
2021-08-11 10:43
has joined #pact-go

christian.kampka
2021-08-11 10:51
has joined #pact-go

ashwinparthasarathy30
2021-08-11 11:23
has joined #pact-go

andrew.jensen
2021-08-11 16:18
has joined #pact-go

vivekkurhe1993
2021-08-12 03:44
has joined #pact-go

aakbar
2021-08-12 06:05
has joined #pact-go

tm.buga
2021-08-12 08:55
has joined #pact-go

yanivhad
2021-08-12 08:58
has joined #pact-go

francois.fernandes
2021-08-12 11:55
has joined #pact-go

bheemreddy181
2021-08-12 12:54
if i have to reuse the createpact() function so that i can pass different providers with in the same consumer https://github.com/pact-foundation/pact-go/blob/master/examples/consumer/goconsumer/user_service_test.go#L114 how do i do so ? As per go implementation we can test main only once we can't multiple TestMains per package

bheemreddy181
2021-08-12 22:50
I mean `we can have testmain`

bheemreddy181
2021-08-13 00:27
Matt any insights here

johnathan.gilday
2021-08-13 16:40
has joined #pact-go

ben.kaiser
2021-08-13 17:47
has joined #pact-go

johnathan.gilday
2021-08-13 20:03
@johnathan.gilday has left the channel

dbekman
2021-08-13 20:51
has joined #pact-go

bheemreddy181
2021-08-14 03:41
I found a way to do so with https://github.com/houqp/gtest


matt.fellows
2021-08-14 21:52
Also the new beta doesn't have this problem. It just merges them by default

matt.fellows
2021-08-14 21:53
You just need to clear the pact folder before running

matt.fellows
2021-08-14 22:52
Also you only need to reuse the Pact instance if you have separate files in different test packages _for the same provider_

matt.fellows
2021-08-14 22:52
Different providers will have a different Pact instance

matt.fellows
2021-08-14 22:53
Sorry I didn't see this the other day

sadikshahidain
2021-08-15 03:08
@sadikshahidain has left the channel

chen
2021-08-15 09:34
has joined #pact-go

tom.willmott
2021-08-16 13:47
has joined #pact-go

franklin.lucena89
2021-08-16 16:52
has joined #pact-go

ram.tripathi
2021-08-17 06:33
has joined #pact-go

ricardo.neto
2021-08-17 09:22
has joined #pact-go

andrew.patterson
2021-08-17 14:55
has joined #pact-go

pshah
2021-08-17 15:31
has joined #pact-go

dylanchase26
2021-08-18 04:11
has joined #pact-go

satish.chandra
2021-08-18 05:54
has joined #pact-go

flynnhandley
2021-08-18 22:30
has joined #pact-go

thomaswtsang
2021-08-19 16:53
has joined #pact-go

chris005
2021-08-19 19:07
has joined #pact-go

srimuralixi
2021-08-20 02:18
has joined #pact-go

manika.goel
2021-08-20 05:38
has joined #pact-go

akanksha.sharma
2021-08-20 06:31
has joined #pact-go

jonah
2021-08-20 14:42
has joined #pact-go

tlzhou
2021-08-20 15:02
has joined #pact-go

rsaccoll
2021-08-20 17:51
has joined #pact-go

ramya.sri
2021-08-23 03:52
has joined #pact-go

joseramonrivera21
2021-08-23 08:49
has joined #pact-go

denny.duttig
2021-08-23 10:10
has joined #pact-go

akansha.saraswat3
2021-08-23 10:50
has joined #pact-go

sushant.soni
2021-08-23 21:10
has joined #pact-go

ajaiswal595
2021-08-24 11:00
has joined #pact-go

pd287515778
2021-08-24 12:48
has joined #pact-go

hwebster
2021-08-25 05:30
has joined #pact-go

hoangvo
2021-08-25 05:43
has joined #pact-go

jobjingjo
2021-08-25 06:20
has joined #pact-go

sagarsitap596
2021-08-25 14:10
has joined #pact-go

kyle.fischer
2021-08-25 16:31
has joined #pact-go

datasmithadvtech
2021-08-25 19:43
has joined #pact-go

todor.m.kolev
2021-08-25 19:59
has joined #pact-go

aparnachaudhari
2021-08-26 00:20
Has any one ran into errors when running API (HTTP) type tests with logging level set to `TRACE` ?

aparnachaudhari
2021-08-26 00:24
My tests were silently failing on setup ..i.e. I was only shown error `pact.go:418: no pacts found to verify`

aparnachaudhari
2021-08-26 00:25
When I changed the log level to `INFO` tho.. the same pipeline with all the same code/variables is now happy

matt.fellows
2021-08-26 00:26
:thinking_face:

aparnachaudhari
2021-08-26 00:27
Seeing this in last 2 days

aparnachaudhari
2021-08-26 00:28
this pipeline has been healthy before that

matt.fellows
2021-08-26 00:28
Just looking at the code, the log level is passed down to the verifier binary itself

matt.fellows
2021-08-26 00:29
it?s possible setting it to trace breaks the (json) output Go captures

aparnachaudhari
2021-08-26 00:33
has any implementation around this changed recently ?

matt.fellows
2021-08-26 00:33
not that I?m aware of

matt.fellows
2021-08-26 00:33
Do you know if you?ve updated the standalone recently? It?s possible the standalone output behaviour has changed

aparnachaudhari
2021-08-26 00:37
looks like the stand-alone was updated last 21 days ago


aparnachaudhari
2021-08-26 00:39
```PACT_CLI_VERSION=1.88.55``` Thats the one we are on

matt.fellows
2021-08-26 00:51
If you could please raise an issue on github, i?ll get it looked at

aparnachaudhari
2021-08-26 00:55
Will do. Thank you.

matt.fellows
2021-08-26 00:59
thanks!

aparnachaudhari
2021-08-26 01:27
Where should this issue go ? on cli repo ? or the pact-go repo ?

matt.fellows
2021-08-26 01:47
pact go (If it?s an issue with the CLI, I?ll redirect as needed)

sushmitha.amin
2021-08-26 04:31
has joined #pact-go

shwetastar98
2021-08-26 12:35
has joined #pact-go

contact
2021-08-26 12:44
has joined #pact-go

malena.cadima
2021-08-26 16:07
has joined #pact-go

louis.ss
2021-08-27 01:42
has joined #pact-go


sergio.amorim
2021-08-27 14:40
has joined #pact-go

kamoljan
2021-08-28 11:59
never mind, I am not going to use it, I assume it is not necessary with pactflow.

slin
2021-08-29 23:51
has joined #pact-go

shane.robinson
2021-08-30 00:30
has joined #pact-go

br.maher
2021-08-30 04:35
has joined #pact-go

kwongyun
2021-08-30 15:57
has joined #pact-go

0x06065a
2021-08-31 00:02
has joined #pact-go

matt.thomas
2021-08-31 05:29
has joined #pact-go

abhi.nandan964
2021-08-31 10:19
has joined #pact-go

shivi.btech08
2021-08-31 21:03
has joined #pact-go

kpuengpanich
2021-09-01 07:14
has joined #pact-go

mhmtyuceoz
2021-09-01 07:35
has joined #pact-go

volkan.tufekci
2021-09-02 08:47
has joined #pact-go

tjones
2021-09-02 10:23
Correct :slightly_smiling_face:

tjones
2021-09-02 10:23
If you don't use a broker, you can do local files

tjones
2021-09-02 10:23
but you should use a broker if you can. You get much better features.

yassine
2021-09-02 10:59
has joined #pact-go

connor.beck
2021-09-02 13:39
has joined #pact-go

maurits.out
2021-09-02 15:12
has joined #pact-go

jamescourtoy
2021-09-02 15:45
:thinking_face: I'm writing some provider tests using the latest v2 go verifier (beta). I noticed some strange behavior when working with environment variables. ```err = verifier.VerifyProvider(t, pact.VerifyRequest{ BrokerURL: os.getEnv("PACT_BROKER_BASE_URL"), BrokerToken: os.getEnv("PACT_BROKER_TOKEN"),``` This will result in the following error: ```[2021-09-02T15:43:30Z ERROR pact_ffi::verifier::verifier] error verifying Pact: "error: The argument '--token <token>' requires 1 values, but 2 were provided\n\nUSAGE:\n pact_verifier_cli --broker-url <broker-url>... --dir <dir>... --file <file>... --hostname <hostname> --loglevel <loglevel> --port <port> --provider-name <provider-name> --provider-version <provider-version> --scheme <scheme> --state-change-url <state-change-url> --token <token> --url <url>...\n\nFor more information try --help" Error { message: "error: The argument '--token <token>' requires 1 values, but 2 were provided\n\nUSAGE:\n pact_verifier_cli --broker-url <broker-url>... --dir <dir>... --file <file>... --hostname <hostname> --loglevel <loglevel> --port <port> --provider-name <provider-name> --provider-version <provider-version> --scheme <scheme> --state-change-url <state-change-url> --token <token> --url <url>...\n\nFor more information try --help", kind: WrongNumberOfValues, info: Some(["token"]) }``` It appears to be due to `PACT_BROKER_TOKEN` being pulled in as an env var in the call through pact_ffi and _also_ passed via parameter `--token`. I didn't see it documented anywhere, so not sure if it's expected behavior or not.

kumasaka.tk
2021-09-02 21:24
has joined #pact-go

matt.fellows
2021-09-02 21:58
I've seen it, it's a quirk in the library we defer to. Could you please raise a bug and we'll look into it?

valeriia.danylenko
2021-09-03 18:26
has joined #pact-go

irmt06
2021-09-04 22:51
has joined #pact-go

divyalakshmi.gk
2021-09-07 01:46
has joined #pact-go

constantin.jaeck
2021-09-07 02:24
has joined #pact-go

narendra_uppara
2021-09-07 07:17
has joined #pact-go

nikuplanchiwar
2021-09-07 08:03
has joined #pact-go

sdomeracki
2021-09-07 10:22
has joined #pact-go

gibraltor999
2021-09-07 12:03
has joined #pact-go

norway.martin
2021-09-07 18:38
has joined #pact-go

bheemreddy181
2021-09-07 22:25
All of a sudden my pact provider tests started failing on all go provider services - Any insights

matt.fellows
2021-09-07 22:35
Did you upgrade Pact? I haven't pushed any updates to the current stable for a few months

matt.fellows
2021-09-07 22:35
Also that image resolution is hard to read so I can't see, any chance of a better one?

bheemreddy181
2021-09-07 22:37
Ah ok

bheemreddy181
2021-09-07 22:39
We haven't upgraded pact for some time now - I am fairly confident something changed with our ci but hard to figure out what went wrong here

matt.fellows
2021-09-08 00:32
is that URL correct? I could be wrong, but the `metadata/xxxx` bit looks wrong to me

matt.fellows
2021-09-08 00:33
I?m assuming this is a webhook flow?

marko.justinek
2021-09-08 00:39
it does say that it can?t find any pacts to verify

bheemreddy181
2021-09-08 00:52
Yes the url is correct I verified that manually this is failing on all go pact providers

bheemreddy181
2021-09-08 00:53
Both webhook Flows and provider verifications are failing

bheemreddy181
2021-09-08 00:54
I could find a pact with that incoming pact url

matt.fellows
2021-09-08 01:36
If Pact go hasn?t changed recently, then my fingers point to other sources: 1. Did you update the standalone binary? 2. Did you update the broker? 3. Has some infrastructure changed?

matt.fellows
2021-09-08 01:36
Does it work locally?

matt.fellows
2021-09-08 01:37
it seems to be complaining about a HAL link. Pact first makes a call to `/` and then follows links around. This is where proxies get in the way and can interfere with this process

matt.fellows
2021-09-08 01:38
see if you can cURL the URL in the failing test from your machine and from CI to see what the response looks like

bheemreddy181
2021-09-08 03:52
Makes sense thanks Matt

matt.fellows
2021-09-08 06:17
np, let us know how you go

matt.fellows
2021-09-08 06:18
I do need to re-enable the verbose logs again to see if it fixes it

matt.fellows
2021-09-08 06:18
reminder set to look into this

adamdullenty
2021-09-08 08:23
has joined #pact-go

martin.a.harkins
2021-09-08 12:15
has joined #pact-go

bheemreddy181
2021-09-08 20:05
Can you also log the API calls made to pact broker - looks like it says it couldn't find the pacts with main tag ( as mentioned by @marko.justinek)but there are pacts with main tag


bheemreddy181
2021-09-08 20:07
i do see a response for the above tag

bheemreddy181
2021-09-08 21:18
might need some help in debugging this

matt.fellows
2021-09-08 23:54
Bheem I?ve just been informed that there was an issue in the latest Ruby standalone

matt.fellows
2021-09-08 23:54
So I suspect your CI is not pinning the standalone version to Pact Go (which I would recommend)

matt.fellows
2021-09-08 23:54
A new release has just gone out this morning, which I believe addresses this exact issue

marko.justinek
2021-09-08 23:55
And I?ve just clicked the button for it to update the brew version. :thumbsup:

bheemreddy181
2021-09-08 23:59
So should I pin :pushpin: to a particular version so something like this doesn?t happen

matt.fellows
2021-09-09 00:12
I would recommend that, because you?ll get consistent results. When you upgrade Pact go you can upgrade the standalone then, and then any issues will be obviously related to the upgrade (i.e. not a ?we didn?t change anything problem, but stuff stopped working?)

bheemreddy181
2021-09-09 00:20
You are referring to the standalone correct ? Not pact go ?

matt.fellows
2021-09-09 00:46
yes. my guelss is that the standalone is not managed by the developers who can pin the version of Pact

matt.fellows
2021-09-09 00:46
so they can get out of sync, which is what?s causing surprises

bheemreddy181
2021-09-09 02:30
I am going as per the go docs mentioned and the pact go examples

bheemreddy181
2021-09-09 02:51
Can you update the docs as well

bheemreddy181
2021-09-09 03:00
this is fixed with new standlone

matt.fellows
2021-09-09 03:53
thanks for confirming, just update docs :thumbsup_all:

rocco.smit
2021-09-09 06:20
has joined #pact-go

andrei_mironau
2021-09-09 10:00
has joined #pact-go

febin.sathar
2021-09-09 10:16
has joined #pact-go

jcaromiq
2021-09-09 11:47
has joined #pact-go

mirko.zipris
2021-09-09 20:08
has joined #pact-go

dotelnp
2021-09-10 06:48
has joined #pact-go

volkan.tufekci
2021-09-10 11:24
@volkan.tufekci has left the channel


sameer.patil
2021-09-10 18:42
has joined #pact-go

b.1.alpha
2021-09-10 19:17
has joined #pact-go

matt.fellows
2021-09-10 21:54
I remember the pinning to beta was a problem but can't remember why now

kamoljan
2021-09-10 22:46
I am using https://github.com/pact-foundation/pact-go/tree/2.x.x w/ go1.17, so far no problem.

kamoljan
2021-09-11 11:47
Sorry, I was wrong. There will be failures without those libraries in `test` and`vet` targets.

naushad_amin
2021-09-11 23:15
has joined #pact-go

jose_rodriguez
2021-09-13 13:16
has joined #pact-go

kyle_evans
2021-09-13 13:16
has joined #pact-go

rahul.louis
2021-09-13 15:55
has joined #pact-go

a.koka
2021-09-13 17:01
has joined #pact-go

efloresambrosio
2021-09-13 20:09
has joined #pact-go

olle_hallin
2021-09-14 05:50
has joined #pact-go

a.babenko
2021-09-14 14:00
has joined #pact-go

vasavi.balanagu
2021-09-14 16:49
has joined #pact-go

samuel.sjoberg
2021-09-14 21:49
has joined #pact-go

domingo
2021-09-14 23:51
has joined #pact-go

pradeepkumarstudent20
2021-09-15 03:32
has joined #pact-go

bryan
2021-09-15 15:16
has joined #pact-go

dboxler
2021-09-15 18:35
has joined #pact-go

keerthisiv
2021-09-16 03:59
has joined #pact-go

adelina.simion
2021-09-16 08:41
has joined #pact-go

akke.luukkonen
2021-09-16 10:29
has joined #pact-go

alejandro.pena
2021-09-16 13:37
has joined #pact-go

kamoljan
2021-09-17 04:14
```WithJSONBody(Map{ "type": Includes("text"), // image-and-text or text-only })``` How can I have an exact match for those two options without `Includes`?


matt.fellows
2021-09-17 04:27
(you might be able to drop the matcher altogether, I don't have an IDE in front of me tho)

matt.fellows
2021-09-17 04:27
Oh, you want two options. Probably a regex?

matt.fellows
2021-09-17 04:28
We could probably support a matcher that takes variable number of arguments that essentially wraps a regex

kamoljan
2021-09-17 04:39
`Equality` ?s Min. Compatibility is V3.

kamoljan
2021-09-17 04:41
How about `Term` ? ```WithJSONBody(Map{ "type": Term("image-and-text","image-and-text|text-only"), // image-and-text or text-only })```

matt.fellows
2021-09-17 05:25
Yep :+1:

kamoljan
2021-09-17 05:27
Thank you!

bbleach
2021-09-17 07:30
has joined #pact-go

kamoljan
2021-09-20 10:13
Is chunked transfer encoding (`Transfer-Encoding: chunked`) supported?

matt.fellows
2021-09-20 10:14
Good question, I'm not sure. Give it a try!

kamoljan
2021-09-20 10:22
```2021/09/20 19:14:58 [DEBUG] error decoding APIErrorResponse from response for GET /notification/inappmessages . Error json: cannot unmarshal string into Go struct field apiErrorResponse.error of type client.apiErrorMessage 2021/09/20 19:14:58 [DEBUG] error decoding APIArrayErrorResponse from response for GET /notification/inappmessages . Error json: cannot unmarshal string into Go struct field apiArrayErrorResponse.error of type client.apiErrorMessage client_pact_test.go:113: Error Trace: client_pact_test.go:113 http.go:154 client_pact_test.go:105 Error: Received unexpected error: api unavailable Test: TestNotificationClientPact/Notification 2021/09/20 19:14:58 [DEBUG] mock server cleaning up port: 59097 2021/09/20 19:14:58 [DEBUG] pact setup 2021/09/20 19:14:58 [DEBUG] initialising rust mock server interface --- FAIL: TestNotificationClientPact (0.00s) --- PASS: TestNotificationClientPact/Health (0.00s) --- FAIL: TestNotificationClientPact/Notification (0.00s) panic: runtime error: invalid memory address or nil pointer dereference [recovered] panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x45c9622]``` First one is passing, but the second (w/ chunked transfer encoding) is crashing.

matt.fellows
2021-09-20 10:27
Looks like it doesn't. Any chance you could please raise an issue on GitHub? Might need to add support to the rust core

rushideshpandes
2021-09-20 13:11
has joined #pact-go

gemhar
2021-09-20 14:33
has joined #pact-go

jsegall
2021-09-20 21:37
has joined #pact-go

dalkire
2021-09-21 13:30
has joined #pact-go

hakan.celebi
2021-09-21 19:43
has joined #pact-go

samuel.sjoberg
2021-09-21 20:12
@samuel.sjoberg has left the channel

nrobison
2021-09-22 15:39
has joined #pact-go

calise
2021-09-22 17:06
has joined #pact-go

nareshnavinash
2021-09-23 09:28
has joined #pact-go

radu.simu
2021-09-23 09:38
has joined #pact-go

aterrong
2021-09-23 09:42
has joined #pact-go

nisharaveendran30
2021-09-23 10:34
has joined #pact-go

sujithsukumaranm
2021-09-23 10:36
has joined #pact-go

sureshbabudevaki
2021-09-23 12:01
has joined #pact-go

greg.hinsley
2021-09-23 12:29
has joined #pact-go

nyman.robin
2021-09-24 07:07
has joined #pact-go

ricardo.paquito
2021-09-24 10:36
has joined #pact-go

abramenkov.valentin
2021-09-24 12:42
has joined #pact-go

leo.tang
2021-09-24 17:56
has joined #pact-go

jyotiguptaofficial
2021-09-25 13:00
has joined #pact-go

mattandaey
2021-09-25 20:32
has joined #pact-go

saurelio58
2021-09-27 12:39
has joined #pact-go

francisco
2021-09-27 18:27
has joined #pact-go

jamesatroughton
2021-09-28 10:42
has joined #pact-go

jake.thacker
2021-09-28 22:06
has joined #pact-go

craig.schwarzwald
2021-09-28 22:37
has joined #pact-go

owain.hunt
2021-09-29 12:58
has joined #pact-go

damtsisa
2021-09-30 06:58
has joined #pact-go

morsisdivine
2021-09-30 09:23
has joined #pact-go

patrice.jy.thomas
2021-09-30 15:05
has joined #pact-go

kschendster
2021-09-30 16:46
has joined #pact-go

adam.dubnytskyy
2021-09-30 17:49
has joined #pact-go

stefano.varesi
2021-09-30 17:51
has joined #pact-go

steven.yi
2021-09-30 20:17
has joined #pact-go

calcorbin
2021-09-30 23:09
has joined #pact-go

osikwemhev
2021-10-01 01:45
has joined #pact-go

kentaro
2021-10-01 10:05
has joined #pact-go

vitali.domashkevitsh
2021-10-01 10:08
has joined #pact-go

seb983
2021-10-01 11:30
has joined #pact-go

vannessa.andrade
2021-10-01 14:44
has joined #pact-go

mickfagan
2021-10-02 10:36
has joined #pact-go

maxim.matviyuk
2021-10-03 16:48
has joined #pact-go

jonathan.a.stern
2021-10-03 20:38
has joined #pact-go

chris.ramsden
2021-10-04 16:40
has joined #pact-go

brian.fung
2021-10-05 04:57
has joined #pact-go

elekberhacizade
2021-10-05 05:27
has joined #pact-go

ankit.wadhwana
2021-10-05 12:23
has joined #pact-go

zhaopeng
2021-10-05 12:24
has joined #pact-go

bjorn.johansson
2021-10-05 13:16
has joined #pact-go

pcting
2021-10-05 18:57
has joined #pact-go

aulia.ahn
2021-10-06 00:01
has joined #pact-go

muralis
2021-10-06 01:21
has joined #pact-go

lakapoor777
2021-10-06 08:47
has joined #pact-go

garry.jeromson973
2021-10-06 09:52
has joined #pact-go

anagha.sulakhe
2021-10-06 16:27
has joined #pact-go

aparnachaudhari
2021-10-06 22:38
Are there plans to extend pact testing to graphql endpoints? I know these are a little unique in the sense of how many variations schema that can be returned.. but curious to know.

aparnachaudhari
2021-10-06 22:38
Also if anyone has done any work with pact+graphql in go

aparnachaudhari
2021-10-06 22:39
I know there is a JS example for GraphQL + Pact.. but unsure if there is one for go too somewhere

matt.fellows
2021-10-06 22:56
:wave: yes. I think we should add a GraphQL interface in Go as we do in JS. Could you please raise a feature request? Should be fairly straightforward to implement

matt.fellows
2021-10-06 22:57
as for general GraphQL support, that would probably be delivered by a plugin (see https://github.com/pact-foundation/pact-plugins/). The plugin framework is currently underway, with the first being supporting protobufs

aparnachaudhari
2021-10-06 23:12
Can you please point me to the doc that walks through how to raise a feature request?

matt.fellows
2021-10-07 07:35
Just a quick request here will be fine: https://github.com/pact-foundation/pact-go/issues/new

matt.fellows
2021-10-07 07:35
I'll review on my next OSS day

mesut.gunes
2021-10-07 09:03
has joined #pact-go

dabfleming
2021-10-07 20:45
I don't know if this is more appropriate as a #general question, but I find it interesting that when a state handler does not exist, it is only a warning, not an automatic error / failure: `[WARN] no state handler found for state: Item Exists` Is this pattern followed across the pact ecosystem? I would argue that when a test has a `Given("foo")` then if the `foo` state can not be implemented because it is missing that is an error (failure) regardless of if the rest of the test would pass.

matt.fellows
2021-10-07 21:32
Anything ruby based takes this assumption

matt.fellows
2021-10-07 21:33
I don't think it should fail, personally

matt.fellows
2021-10-07 21:34
A state is a hint, a description, but not a test itself. the provider doesn't need to deal with it explicitly like it does status codes, bodies etc

matt.fellows
2021-10-07 21:35
Whilst I have you though, I'd like to get V2 out of beta - you had some ideas about state handlers from memory?

dabfleming
2021-10-07 21:36
My thinking is that if my contract specifies a state, if the provider verification can't / doesn't implement that state it has failed to implement the contract.

matt.fellows
2021-10-07 21:36
We could actually easily make that behaviour configurable though

dabfleming
2021-10-07 21:36
That's not a bad idea.

dabfleming
2021-10-07 21:37
Yeah, I was actually going to ask about timeline for the beta. (Team had expressed some curiosity about that.)

matt.fellows
2021-10-07 21:40
There's nothing really holding it up apart from feedback

matt.fellows
2021-10-07 21:41
I'm not 100% comfortable with the message API and you also had expressed thoughts on provider states

dabfleming
2021-10-07 21:41
And this week I've finally been able to jump back into looking at v2. So far there's a lot I like. Also seeing some places where I've got some ideas and places where it could feel more 'Go-y'.. or more like idiomatic Go.

dabfleming
2021-10-07 21:42
Also had at least a couple minor docs fixes so far.

dabfleming
2021-10-07 21:45
Gonna try and throw together some PRs in the next few days as I wrap my head around it a bit more.

matt.fellows
2021-10-07 21:46
That'd be great.

matt.fellows
2021-10-07 21:47
I'll probably get a day in the next fortnight to get stuck into it, but will definitely be able to review and comment on suggestions

matt.fellows
2021-10-07 21:47
Happy to create a GH discussion if that's easier too

vandana.bhaskersen
2021-10-08 09:58
has joined #pact-go

dabfleming
2021-10-08 17:17
So given that moving to `pact-go` requires a migration, why is there a separation of v2/v3 pacts? Does V3 lose or change any functionality from V2? (Or is it only additive?) To me it seems like they could be combined and using the library could be a lot simpler.

dabfleming
2021-10-08 17:17
Especially since if you have a v2 test and a v3 test combined into a single file then you seem to end up with a v3 pact.

matt.fellows
2021-10-08 21:42
Because you need to still be able to write V2 pacts if you use a provider in another language that doesn't support v3 yet

matt.fellows
2021-10-08 21:43
The serialised pact file is different

ad.redouani
2021-10-09 15:11
has joined #pact-go

amulyadoss
2021-10-09 21:09
has joined #pact-go

farshad.falaki
2021-10-10 19:13
has joined #pact-go

jhopkinwilliams
2021-10-12 02:01
has joined #pact-go

josephhaig
2021-10-12 08:52
has joined #pact-go

margarita.lukjanska
2021-10-12 10:12
has joined #pact-go

oak155online
2021-10-12 14:17
has joined #pact-go

dabfleming
2021-10-12 20:42
Right, that makes sense. Would you be open to unifying them under a `NewPact(opts ...PactOptions)` function where you could default to, say, V3 and use functional arguments for options. IE call `p := consumer.NewPact(consumer.OptionV2Pact())` for a v2 pact. This would be an extensible API where in the future if there's a V4 pact format you wouldn't have to add `NewV4Pact()` and could otherwise extend the API with minimal impact.

dabfleming
2021-10-12 20:43
More on Functional options for any who haven't come across them before: https://dave.cheney.net/2014/10/17/functional-options-for-friendly-apis

dabfleming
2021-10-12 20:45
(Seeing version numbers as part of function names in an exported API is a bit of a pet peeve of mine. It's just so awkward.)

matt.fellows
2021-10-12 20:55
Yeah I think that could be be nicer. I have read Dave's article so previously, let me have a look

dabfleming
2021-10-12 23:05
I've thrown together an initial take on this. Will try and post a PR for review tomorrow my time.

matt.fellows
2021-10-13 00:10
oh even better, thanks!

dsinecos
2021-10-13 05:51
hello here :wave:, I?m trying to work with Provider states but for some reason they don?t seem to be invoked In my consumer test, I?ve something like the following ```mockProvider. AddInteraction(). Given(pact.ProviderStateV3{ Name: "TestProviderState", }). UponReceiving("A request for Greeting"). WithRequest("GET", pact.S("/greeting")). WillRespondWith(200). WithHeader("Content-Type", pact.S("application/json")). WithJSONBody(pact.Map{ "language": pact.S("EN"), "message": pact.S("Hello"), "first_name": pact.S("Jane"), })``` I was hoping that when the pact contract gets generated it?d mention the Provider state somewhere, but looks it doesn?t ```"interactions": [ { "description": "A request for Greeting", "request": { "method": "GET", "path": "/greeting" }, "response": { "body": { "first_name": "Jane", "language": "EN", "message": "Hello" }, "headers": { "Content-Type": "application/json" }, "status": 200 } },``` Inside my provider test, I?ve configured the following to trigger Statehandlers ```err := verifier.VerifyProvider(t, VerifyRequest{ ProviderBaseURL: "http://localhost:9000", Provider: "GreetingAPI", ProviderVersion: "1.0.4", BrokerURL: "http://localhost:9292", PublishVerificationResults: true, BeforeEach: func() error { fmt.Println("[DEBUG] HOOK before each") return nil }, AfterEach: func() error { fmt.Println("[DEBUG] HOOK after each") return nil }, StateHandlers: StateHandlers{ "TestProviderState": func(setup bool, s ProviderStateV3) (ProviderStateV3Response, error) { if setup { fmt.Println("[DEBUG] HOOK calling user foo exists state handler", s) } else { fmt.Println("[DEBUG] HOOK teardown the 'User foo exists' state") } // ... do something, such as create "foo" in the database // Optionally (if there are generators in the pact) return provider state values to be used in the verification return ProviderStateV3Response{"uuid": "1234"}, nil }, },``` When I run the Provider tests, only the `AfterHook` triggers and prints the statement. The `BeforeHook` and the `StateHandlers` don?t seem to be invoked Please share any ideas/ suggestions what I might be missing here

matt.fellows
2021-10-13 06:04
Can you please double check that the pact file is cleared before the tests run?

dsinecos
2021-10-13 06:31
So I deleted the pact file before running the tests, but the generated pact file still has the same interaction ``` { "consumer": { "name": "GreetingAPIConsumer" }, "interactions": [ { "description": "A request for Greeting", "request": { "method": "GET", "path": "/greeting" }, "response": { "body": { "first_name": "Jane", "language": "EN", "message": "Hello" }, "headers": { "Content-Type": "application/json" }, "status": 200 } } ], "metadata": { "pactRust": { "version": "0.9.3" }, "pactSpecification": { "version": "3.0.0" } }, "provider": { "name": "GreetingAPI" } }```

filipovic
2021-10-13 06:51
has joined #pact-go

stefan.smith
2021-10-13 09:37
has joined #pact-go

dsinecos
2021-10-13 09:45
hey @matt.fellows Is there any other requirement besides using the `Given` method when writing Consumer tests? I'm using `pact-go@v2.0.0-beta.6` (also tried on `pact-go@v2.0.0-beta.5`) Pasting the logs at TRACE level from running the provider tests. It mentions - `skipping state handler for request greeting` ```=== RUN Test_Provider 2021/10/13 15:05:47 [DEBUG] starting new proxy with opts {http localhost:9000 0 [0x71f4a0 0x71f7a0 0x71fa40] /__setup <nil>} 2021/10/13 15:05:47 [DEBUG] starting reverse proxy on port 46299 2021/10/13 15:05:47 [DEBUG] waiting for port 46299 to become available 2021/10/13 15:05:47 [DEBUG] pact provider verification 2021/10/13 15:05:47 [DEBUG] waiting for port 46299 to become available 2021/10/13 15:05:47 [DEBUG] initialising rust mock server interface 2021/10/13 15:05:47 [DEBUG] executing verifier FFI with args [--hostname localhost --port 46299 --state-change-url http://localhost:46299/__setup --broker-url http://localhost:9292 --provider-version 1.0.1 --provider-name GreetingAPI --publish --loglevel trace] Verifying a pact between GreetingAPIConsumer and GreetingAPI 2021/10/13 15:05:47 [TRACE] skipping state handler for request /greeting 2021/10/13 15:05:47 [DEBUG] http reverse proxy received connection from 127.0.0.1:44240 on path /greeting 2021/10/13 15:05:47 [DEBUG] setting proxy to target 2021/10/13 15:05:47 [DEBUG] incoming request /greeting 2021/10/13 15:05:47 [DEBUG] outgoing request to target http://localhost:9000/greeting 2021/10/13 15:05:47 [TRACE] proxy outgoing request GET /greeting HTTP/1.1 Host: localhost:9000 User-Agent: Pact Go Accept: */* X-Forwarded-For: 127.0.0.1 Accept-Encoding: gzip 2021/10/13 15:05:47 [TRACE] proxied server response HTTP/1.1 200 OK Content-Length: 55 Content-Type: application/json Date: Wed, 13 Oct 2021 09:35:47 GMT {"language":"EN","message":"Hello","first_name":"Jane"} 2021/10/13 15:05:47 [DEBUG] executing after hook [DEBUG] HOOK after each A request for Greeting returns a response which has status code 200 (OK) includes headers "Content-Type" with value "application/json" (OK) has a matching body (OK) === RUN Test_Provider/Provider_pact_verification --- PASS: Test_Provider (0.15s) --- PASS: Test_Provider/Provider_pact_verification (0.00s) PASS ok http://github.com/dsinecos/contract_testing/provider 0.160s ? http://github.com/dsinecos/contract_testing/provider/cmd [no test files]```

warren
2021-10-13 16:45
has joined #pact-go

michael.stein
2021-10-13 19:02
has joined #pact-go

matt.fellows
2021-10-14 05:39
I?ll have to look at this tomorrow

matt.fellows
2021-10-14 05:40
I know the terraform provider uses this library, and produces the https://github.com/pactflow/terraform-provider-pact/blob/master/client/client_pact_test.go#L71

matt.fellows
2021-10-14 05:40
It?s possible there is a bug for the paramaterised version

matt.fellows
2021-10-14 05:42
Ah, I can see the bug

matt.fellows
2021-10-14 05:46
can you please try beta.7 ?

dsinecos
2021-10-14 08:38
hey, No luck still, upgraded to beta.7. Btw I'm using the NewV3Pact and not NewV2Pact which is in the linked pact_test.go

dsinecos
2021-10-14 08:40
@matt.fellows Just took a look at the fix commit, shouldn't this be the other way round - when `len(state.Parameters) == 0` we invoke using `i.Interaction.interaction.Given(state.name)` https://github.com/pact-foundation/pact-go/commit/f85734754e7fde9096509884fa8796271ebb9441 ```if len(state.Parameters) == 0 { i.Interaction.interaction.GivenWithParameter(state.Name, state.Parameters) } else { i.Interaction.interaction.Given(state.Name) }```

matt.fellows
2021-10-14 09:46
yes, i spotted it earlier also - that?s what you get when you commit and push whilst in a meeting!!

matt.fellows
2021-10-14 09:46
?beta.8 is out, can you please try that again :laughing:

dsinecos
2021-10-14 12:24
It works :tada: , thanks @matt.fellows

matt.fellows
2021-10-14 13:55
Oh I remember why I didn't use the functional option now - the interface follows a sort of typestate pattern. I was thinking of making that even strongercin the interface but hadn't come back to it

matt.fellows
2021-10-14 13:55
Potentially a method on `NewPact`

matt.fellows
2021-10-14 13:56
E.g. `NewPact().WithSpec2()...`

matt.fellows
2021-10-14 13:57
The interface is different, so I don't think a functional argument will sufficiently capture that difference without additional conditional logic in all of the methods

hwillj
2021-10-14 14:52
has joined #pact-go

dabfleming
2021-10-14 17:06
> The interface is different I poked around and the only difference I've seen is Given vs GivenWithParams.

dabfleming
2021-10-14 17:11
There are the V3 matchers but you _can_ add those into a V2 pact currently. In fact I may have just found a bug here, as I created a V2 pact and added a v3 matcher (Integer). Result was no errors and a pact file that was version 2 but contained what I assume to be a v3 matching rule: ```"$.body.id": { "match": "integer" },```

fengniy
2021-10-15 02:09
has joined #pact-go

mark.dathorne
2021-10-15 09:51
has joined #pact-go

haroldlearning93
2021-10-15 14:49
has joined #pact-go

vsrungar95
2021-10-15 22:14
has joined #pact-go

jsoto128
2021-10-16 20:45
has joined #pact-go

fiszczu
2021-10-17 17:04
has joined #pact-go

brocheleau
2021-10-18 03:23
has joined #pact-go

andrerc
2021-10-18 22:11
has joined #pact-go

rodolfo.valenzuela
2021-10-19 07:43
has joined #pact-go

kamilyrb
2021-10-19 22:31
has joined #pact-go

matt.fellows
2021-10-20 06:44
Started a discussion about this here David: https://github.com/pact-foundation/pact-go/discussions/189

matt.fellows
2021-10-20 06:44
Thanks for kicking it off


matt.fellows
2021-10-20 06:45
I?m very keen to get off the 1.x.x line so that we can move forward. Ideally, we are fully released this calendar year and only maintenance patches will be provided back into the 1.x.x line so that we can focus on moving forward, getting plugin support and all of the other good stuff out there.

matt.fellows
2021-10-20 06:45
Thanks to @dabfleming for kicking off the conversation

dabfleming
2021-10-20 15:51
:tada: Happy to help nudge things forward. Would love to see v2 released soon and looking forward to some of these other benefits. (Also happy to offer some help where I can.)

dabfleming
2021-10-20 15:53
Nice breakdown of the issue. I'm going to take some time later to try and grok the `v4` stuff and add my thoughts.

joel.whalen588
2021-10-20 20:27
has joined #pact-go

matt.fellows
2021-10-21 00:11
Thanks David! The main blocker from releasing is just getting clarity on the API that we?re happy with, and then it?s a matter of tidy up, releasing and getting some better test coverage

matt.fellows
2021-10-21 00:11
i.e. API first, implementation detail second

aparnachaudhari
2021-10-21 04:06
Curious if any one here has multiple contracts being written for one provider and how they handler running this in their setup. i.e. one contract run against the provider for each test run.

vasil.vasilev
2021-10-21 08:41
has joined #pact-go

ben.crinion
2021-10-21 11:09
has joined #pact-go

estephania.calvo
2021-10-21 19:27
has joined #pact-go

ahmetbcakici
2021-10-21 22:38
has joined #pact-go

aparnachaudhari
2021-10-22 00:12
Hello, cc @matt.fellows Checking my understanding. If I have test suites defined for consumers and providers tests in a repo and I pass a contract for only one consumer-provider to this repo and run tests .. the other tests should be skipped/ignored ?

matt.fellows
2021-10-22 03:29
On the assumption that the repo is only a single provider, then yes, you can filter which contracts are being verified by using the `ConsumerVersionSelectors` property, specifying the consumer you want (or `PactUrls` to specify exact pacts etc.)

matt.fellows
2021-10-22 03:29
I suspect this question relates to https://pact-foundation.slack.com/archives/C9VPNUJR2/p1634857199006300, in which case, let me take a look at that thread?

aparnachaudhari
2021-10-22 03:36
When I specify the pact url, the provider tests that do not have their state defined in.that pact fail eve tho the name if the providers is unique.

matt.fellows
2021-10-22 03:40
wouldn?t you expect it to fail (or possibly fail) if the states aren?t supported?

ben.crinion
2021-10-22 08:09
@ben.crinion has left the channel

abarcadabra
2021-10-22 12:30
has joined #pact-go

harwin1494
2021-10-22 19:04
has joined #pact-go

anindita.ghosh
2021-10-22 23:26
has joined #pact-go

rajnish.maurya
2021-10-25 06:47
has joined #pact-go

alanbos
2021-10-25 10:11
has joined #pact-go

kuzmanovid
2021-10-25 13:59
has joined #pact-go

j.malyjasiak
2021-10-25 14:24
has joined #pact-go

rtbhosale17
2021-10-25 14:25
has joined #pact-go

stefano.mantini
2021-10-25 14:31
has joined #pact-go

r.muthukumar136
2021-10-25 14:59
has joined #pact-go

gravis54
2021-10-25 21:46
has joined #pact-go

misha.antipenko
2021-10-25 21:57
has joined #pact-go

j.malyjasiak
2021-10-26 06:01
@j.malyjasiak has left the channel

adomanski
2021-10-26 10:43
has joined #pact-go

kriegster108
2021-10-26 14:58
has joined #pact-go

adam.witko
2021-10-27 07:36
has joined #pact-go

alex.macpherson
2021-10-27 08:28
has joined #pact-go

yurich00
2021-10-27 18:10
has joined #pact-go

lincolnf
2021-10-27 23:30
has joined #pact-go

lawrencemajmacdonald
2021-10-28 07:33
has joined #pact-go

zsolt.vilagos
2021-10-28 10:00
has joined #pact-go

zsolt.vilagos
2021-10-28 10:01
@zsolt.vilagos has left the channel

norway.martin
2021-10-28 15:59
@norway.martin has left the channel

ramesh.dhanasekaran
2021-10-29 02:20
has joined #pact-go

christopher.mcewen
2021-10-29 12:14
has joined #pact-go

catalin.comarnescu
2021-10-29 12:31
has joined #pact-go

labardinim
2021-10-29 12:51
has joined #pact-go

kiran.rudrangi
2021-10-29 16:48
has joined #pact-go

ahmed_syed
2021-11-01 20:46
has joined #pact-go

somayajulaas
2021-11-02 00:38
has joined #pact-go

john
2021-11-02 03:32
has joined #pact-go

rochitsen
2021-11-02 10:49
has joined #pact-go

finta.pl
2021-11-02 14:43
has joined #pact-go

alessandro.borraccino
2021-11-02 17:04
has joined #pact-go

matti.anusha
2021-11-03 02:58
has joined #pact-go

ozgurerisir
2021-11-03 10:29
has joined #pact-go

jordan.r.stewart
2021-11-04 08:47
@jordan.r.stewart has left the channel

dean.miley1
2021-11-05 11:40
has joined #pact-go

martha.nolan
2021-11-05 11:50
has joined #pact-go

eniko_kollar
2021-11-05 16:46
has joined #pact-go

ashwin
2021-11-05 17:58
has joined #pact-go

d.philipp
2021-11-08 03:51
has joined #pact-go

hamzah.saleem
2021-11-08 11:22
has joined #pact-go

srividya.ece
2021-11-08 12:17
has joined #pact-go

markus.joschko
2021-11-08 13:13
has joined #pact-go

markus.joschko
2021-11-08 14:18
@markus.joschko has left the channel

dabfleming
2021-11-08 17:07
:point_up: Migrating from tags to branches (and eventually environments, deployments and releases) has a lot of potential value for our evolving use of Pact... so aiming to to help push the Go library along a bit. :+1:

belugin.v
2021-11-08 17:16
has joined #pact-go

eric2323223
2021-11-09 04:12
May I know how to simulate GET request with body in provider test? Here is one contract generated from consumer test ```{ "description": "description", "request": { "method": "GET", "path": "/api/v1/myservice/endpoint", "headers": { "Content-Type": "text/plain" }, "body": "test body" }, "response": { "status": 200, "headers": { "Content-Type": "application/json" }, "body": { "enabled": "false" } } },``` I run provider test using this contract but i received empty request body, could anyone please tell me why?

matt.fellows
2021-11-09 04:18
GET request with a body is not an RFC standard, so it?s possible that your server does not know how to respond to it (and therefore the body is not available to your code, despite it being sent over the wire)

matt.fellows
2021-11-09 04:18
it?s also possible that Pact is not sending the body

eric2323223
2021-11-09 04:58
@matt.fellows Thank you for the quick response, server is designed and implemented to understand such request (although it?s not recommended). could you please confirm PACT will not send body because it?s not comply with the RFC standard?

matt.fellows
2021-11-09 05:00
Which version of pact go are you using?

matt.fellows
2021-11-09 05:05
You can test by creating a minimal pact file with a GET and body, and using the CLI to verify it against your API and see what it sends

matt.fellows
2021-11-09 05:05
It's possible the Pact Go middleware that is used isn't respecting this

will.griffiths
2021-11-09 05:25
has joined #pact-go

eric2323223
2021-11-09 05:42
`testhelper/contracts/pact/bin/pact-mock-service version` `3.6.2`

matt.fellows
2021-11-09 05:45
ah ok, I meant the Pact Go version but that?s all I needed (you?re on the 1.x.x branch)

matt.fellows
2021-11-09 05:54
Looks like the 1.x.x won?t support it, but the good news is that the 2.x.x line does

matt.fellows
2021-11-09 05:57
There is at least one old issue for this: https://github.com/pact-foundation/pact-net/issues/185

matt.fellows
2021-11-09 05:57
TL;DR - the underlying libraries used don?t support it

matt.fellows
2021-11-09 05:58
The first request is from the current Ruby verifier, the second from the rust one (note how your message is put into the query string in the first one with an empty body): ``` GET /api/v1/myservice/endpoint?test+body HTTP/1.1 Host: localhost:1234 Cookie: X-Forwarded-For: 127.0.0.1 Content-Length: 0 Content-Type: application/json GET /api/v1/myservice/endpoint HTTP/1.1 content-type: application/json accept: */* host: localhost:1234 content-length: 11 "test body"```

eric2323223
2021-11-09 06:25
Thank you, may I know which pact-go version I should choose? it seems there is only beta versions for 2.0.0

matt.fellows
2021-11-09 06:26
that?s the current status of the world I?m afraid, it should be close to stable but it?s a chicken/egg problem - need feedback from the community before we say ?yes, we?ll accept this as the new mainline?!


eric2323223
2021-11-09 06:27
OK, understand, do I also need to upgrade my PACT version? I am currently using pct-ruby-standalone v1.88.3

matt.fellows
2021-11-09 06:28
2.x.x is a completely different implementation. It was using the Ruby core, and is now using a Rust core


eric2323223
2021-11-09 06:29
oh, thank you, I will read docs

matt.fellows
2021-11-09 06:30
I have created an early migration guide, to help. But obviously if it?s just this one request you might need to find an alternative solution, rather than forcing an upgrade of everything

navilooz
2021-11-09 08:48
has joined #pact-go

keith.hirst
2021-11-09 12:13
has joined #pact-go

rbo
2021-11-09 17:47
has joined #pact-go

harshaan.n.khan
2021-11-10 05:38
has joined #pact-go

esparga
2021-11-10 14:32
has joined #pact-go

thales.areis
2021-11-10 19:33
has joined #pact-go

henk.koopman
2021-11-11 08:56
has joined #pact-go

lena.lindblad
2021-11-11 09:58
has joined #pact-go

radekkoubsky
2021-11-11 16:24
has joined #pact-go

aditya
2021-11-11 17:20
has joined #pact-go

claire
2021-11-11 17:55
has joined #pact-go

gentritmm
2021-11-12 08:35
has joined #pact-go

wilson.espina
2021-11-12 09:52
has joined #pact-go

megan.twyver
2021-11-12 18:39
has joined #pact-go

mischa.molhoek
2021-11-14 09:42
has joined #pact-go

69vron
2021-11-15 01:35
has joined #pact-go

james.sawle
2021-11-15 08:49
has joined #pact-go

pete.watts
2021-11-15 12:46
has joined #pact-go

joshua.badger
2021-11-15 17:10
has joined #pact-go

omarsaddaoui
2021-11-17 02:55
has joined #pact-go

mbyrne
2021-11-17 14:23
has joined #pact-go

matthew.drill
2021-11-18 01:08
has joined #pact-go

james.halsall
2021-11-18 12:02
has joined #pact-go

chvram
2021-11-19 14:09
has joined #pact-go

akhandalmani.malik
2021-11-19 14:17
has joined #pact-go

elias.frykholm
2021-11-19 15:17
has joined #pact-go

martin.carlin
2021-11-19 15:52
has joined #pact-go

paul.nardone
2021-11-19 16:12
has joined #pact-go

dabfleming
2021-11-19 18:24
@matt.fellows Was looking at the plugin stuff again and noticed that the link to your spike implementation in https://github.com/pact-foundation/pact-go/tree/spike/plugin-system was a 404. Is that still around somewhere?

emily
2021-11-19 18:56
has joined #pact-go

matt.fellows
2021-11-19 21:51
Where did you get that link ?

matt.fellows
2021-11-19 21:53
Oh might be from the docs talking about the design . That spike is definitely out of date now so I wouldn't use it for anything, the real plugin interface will be very different


dabfleming
2021-11-19 21:55
I was just trying to wrap my head around how the plugin use might look in code.


matt.fellows
2021-11-19 21:57
Hmm the branch should still be there somewhere

matt.fellows
2021-11-19 21:57
In any case, these are real plugins examples: https://github.com/pact-foundation/pact-plugins/tree/main/examples

matt.fellows
2021-11-19 21:59
Thanks for those questions/comments, I'll take a look asap

pietrucha.bartosz
2021-11-20 13:47
has joined #pact-go

ringo
2021-11-20 16:18
@matt.fellows I think I did everything correctly, but still have the error that `CLI tools are out of date`: ```$ PATH=../pact/bin:$PATH go test -v ./... -run TestCreateUser === RUN TestCreateUser 2021/11/20 17:12:10 [INFO] checking pact-mock-service within range >= 3.5.0, < 4.0.0 2021/11/20 17:12:10 [ERROR] CLI tools are out of date, please upgrade before continuing FAIL http://github.com/vatesfr/xo-sdk-go/client 0.152s FAIL $ PATH=../pact/bin:$PATH which pact-mock-service ../pact/bin/pact-mock-service $ PATH=../pact/bin:$PATH pact-mock-service version 3.9.0``` Any idea what can still be wrong? This is with https://github.com/pact-foundation/pact-ruby-standalone/releases/tag/v1.88.80 and this in my `go.mod` file: ``` http://github.com/pact-foundation/pact-go v1.6.6 // indirect```

ringo
2021-11-20 19:48
OK, I found out that my PATH wasn?t correctly set after all. Using a one-time `export PATH=<full pact path>:$PATH` before running my tests seem to fix it. :see_no_evil:

matt.fellows
2021-11-20 21:50
It's recommend adding it to the actual environment variable rather than inlining the declaration. Otherwise you'll need to prefix every command that way

matt.fellows
2021-11-21 01:00
So that should have been "I'd" not "it's"

mastrobardo
2021-11-21 11:42
has joined #pact-go

fed
2021-11-22 04:20
has joined #pact-go

tumunshaily
2021-11-22 07:54
has joined #pact-go

yunfeng.wang
2021-11-22 09:25
has joined #pact-go

christos.litsas
2021-11-23 13:05
has joined #pact-go

christos.litsas
2021-11-23 13:08
Hi everyone, I?d like to use pact-go on my M1 machine but the `pact-go -l DEBUG install` command fails because it can?t detect my architecture. Does anyone have experience on how to set it up?

matt.fellows
2021-11-23 13:27
Ah, is this the new 2.x.x branch or the current master?

christos.litsas
2021-11-23 13:28
2.x.x

matt.fellows
2021-11-23 13:28
I don't think we currently publish M1 artifacts yet. It might run on rosetta mode

matt.fellows
2021-11-23 13:28
I don't have access to an M1 yet so can't test myself

matt.fellows
2021-11-23 13:29
Could you please raise an issue and I can look?

christos.litsas
2021-11-23 13:29
sure, where and how to raise that issue?

matt.fellows
2021-11-23 13:30
On pact go GitHub please

christos.litsas
2021-11-23 13:30
good!

christos.litsas
2021-11-23 13:30
thanks a lot!


matt.fellows
2021-11-23 13:32
Pop the osx aarch64 unzipped file in /usr/local/lib/libffi_pact.dylib and it should work (that's all the install does)

elliot.sel
2021-11-23 14:40
Hi :slightly_smiling_face: I am trying to understand the relationship between matchingrules in JSON and the `Pact::Term` operator. When building pacts using the DSL is it preferable to use the latter over the former? (I can?t see a way to generate matching rules using the DSL)

elliot.sel
2021-11-23 15:06
I think I may have found my answer https://github.com/pact-foundation/pact-specification/blob/aa019ef50db9f2337997cabd0e6b6777b03c775c/implementation-guidelines/README.md > _Notes on the pact format between the client and the mock service_: To communicate between the DSL and the mock service, the Ruby code still uses the original Pact format that uses Ruby specific JSON (?json_class?: ?Pact::Term?...) to serialise the Terms, regexps and SomethingLikes. You can use the newer pact-specification v2 matching code if you like as both are accepted, but TBH the old Ruby way is actually easier to implement!

walter.psjr
2021-11-23 17:39
has joined #pact-go

matt.fellows
2021-11-23 20:34
The matching rules are automatically created by the DSL. It does be transparent to you as a user

matt.fellows
2021-11-23 20:34
What are you trying to do?

steveforwork2
2021-11-24 08:47
has joined #pact-go

fredrik.ostling
2021-11-24 11:56
has joined #pact-go

jorge.nunez
2021-11-24 14:28
has joined #pact-go

asradhakrishnan
2021-11-24 17:20
has joined #pact-go

edouard.lopez
2021-11-25 11:01
has joined #pact-go

maxkitzing
2021-11-25 17:49
has joined #pact-go

cristian.carrillo
2021-11-26 00:06
has joined #pact-go

christoph.oswald
2021-11-26 09:53
has joined #pact-go

gjourdanweil
2021-11-26 14:39
has joined #pact-go

sean.pike
2021-11-26 14:48
has joined #pact-go

gjourdanweil
2021-11-28 20:09
@gjourdanweil has left the channel

michael.bannister
2021-11-29 07:43
has joined #pact-go

rjadams96
2021-11-29 18:47
has joined #pact-go

pavithz
2021-11-29 23:51
has joined #pact-go

mfellows_20211130
2021-11-30 06:57
has joined #pact-go

mfellows_20211130v2
2021-11-30 10:32
has joined #pact-go

mfellows_20211130v3
2021-11-30 10:57
has joined #pact-go

mfellows_20211130v4
2021-11-30 11:16
has joined #pact-go

agittcelik
2021-11-30 18:35
has joined #pact-go

alturil
2021-11-30 20:56
has joined #pact-go

draper.joseph
2021-12-01 06:50
has joined #pact-go

abhay175
2021-12-01 07:35
has joined #pact-go

joelgrimberg
2021-12-01 11:27
has joined #pact-go

reem.alashry
2021-12-01 12:09
has joined #pact-go

beshoy.ibrahim
2021-12-01 12:09
has joined #pact-go

omar.radi
2021-12-01 12:10
has joined #pact-go

mmudassar192
2021-12-01 12:11
has joined #pact-go

eric.seipold
2021-12-01 13:40
has joined #pact-go

apselsevier
2021-12-01 16:48
has joined #pact-go

ali.korayem
2021-12-01 18:55
has joined #pact-go

luiz.filipe.abrahao
2021-12-01 21:04
has joined #pact-go

srinagasai.krishnasan
2021-12-01 21:47
hello team, I am trying to integrate pact-go in a go project we have. However under `createPact` the attr `PactDir` doesn't seem to show the verification result. How is it supposed to work? It's not even creating the folder.

matt.fellows
2021-12-01 22:37
can you please share your code and log file (see https://github.com/pact-foundation/pact-go#troubleshooting)

david.cummings
2021-12-02 14:13
has joined #pact-go

miccagiann
2021-12-02 14:17
has joined #pact-go

srinagasai.krishnasan
2021-12-02 17:15
Here's my create pact ```// Configuration / Test Data var dir, _ = os.Getwd() var pactDir = fmt.Sprintf("%s/pact", dir) var logDir = fmt.Sprintf("%s/log", dir) var port, _ = utils.GetFreePort() // Setup the Pact client. func createPact() dsl.Pact { return dsl.Pact{ Provider: "entitlements", //LogDir: logDir, PactDir: pactDir, DisableToolValidityCheck: true, LogLevel: "INFO", } }``` http://W.R.TO log this is what I am seeing in regards to pact ```--- PASS: TestPactProvider (11.67s) === RUN TestPactProvider/Pact_between__and__ --- PASS: TestPactProvider/Pact_between__and__ (0.00s) === RUN TestPactProvider/has_status_code_200 pact.go:626: Verifying a pact between listener and entitlements Getentitlementdetails with POST /pandora-entitlements/pandoraentitlements/jsonrpc returns a response which has status code 200 --- PASS: TestPactProvider/has_status_code_200 (0.00s) === RUN TestPactProvider/has_a_matching_body pact.go:626: Verifying a pact between listener and entitlements Getentitlementdetails with POST /pandora-entitlements/pandoraentitlements/jsonrpc returns a response which has a matching body --- PASS: TestPactProvider/has_a_matching_body (0.00s) === RUN TestPactProvider/"Content-Type"_which_equals_"application/json" pact.go:626: Verifying a pact between listener and entitlements Getentitlementdetails with POST /pandora-entitlements/pandoraentitlements/jsonrpc returns```

jarmy
2021-12-02 19:37
has joined #pact-go

matt.fellows
2021-12-02 21:21
The verification results is the test run. It doesn't generate another document

matt.fellows
2021-12-02 21:22
I can see your test run worked just fine. It just prints standard golang test output

matt.fellows
2021-12-02 21:22
If you want to send results to the broker, there is another flag for that

srinagasai.krishnasan
2021-12-02 21:22
in java through gradle. we can produce documents such as `.md` `.json` right

srinagasai.krishnasan
2021-12-02 21:23
there's nothing of that sort with go-lang pact?

matt.fellows
2021-12-02 21:24
No, sorry

matt.fellows
2021-12-02 21:24
What do you want to actually see, and why?

srinagasai.krishnasan
2021-12-02 21:24
then what is PactDir for?

srinagasai.krishnasan
2021-12-02 21:24
just a report is all. But not in the console.

srinagasai.krishnasan
2021-12-02 21:28
also my test runs only as a regular test "make test". It doesn't run as make provider. what are some explicit changes I need to make to get that working?

matt.fellows
2021-12-02 21:29
> then what is PactDir for? the current interface has the same Pact object for writing consumer tests and verifying providers. That property as documented only is used for producing a contract file (from the consumer)

matt.fellows
2021-12-02 21:29
> also my test runs only as a regular test ?make test?. It doesn?t run as make provider. what are some explicit changes I need to make to get that working? I?m not sure what you?re asking here. The make targets are user defined, you can call them whatever you want

srinagasai.krishnasan
2021-12-02 21:30
ah i'm new to golang. Will need to look at that. Thanks for the input, matt.

praveen.em
2021-12-03 07:40
has joined #pact-go

ally.parker
2021-12-03 11:18
has joined #pact-go

rishabh.gaur
2021-12-03 11:43
has joined #pact-go

william.wallace
2021-12-03 15:12
has joined #pact-go

batiushkov.nik
2021-12-03 15:48
has joined #pact-go

keith.mcgrath
2021-12-03 18:28
has joined #pact-go

rchandragupthara
2021-12-03 19:32
has joined #pact-go

vinicius.cosmi
2021-12-03 20:01
has joined #pact-go

ichatterjee
2021-12-03 21:27
has joined #pact-go

ben.watts
2021-12-03 23:48
has joined #pact-go

imikhtyuk
2021-12-06 00:36
has joined #pact-go

norrischebl
2021-12-06 05:54
has joined #pact-go

smantini
2021-12-06 09:25
has joined #pact-go

gzinger
2021-12-06 11:19
has joined #pact-go

mahatmafatal
2021-12-06 13:50
has joined #pact-go

jacob.v.gardner
2021-12-06 14:59
has joined #pact-go

glebing2000
2021-12-07 07:28
has joined #pact-go

sergio.freire
2021-12-07 09:52
has joined #pact-go

sahoo.skumar
2021-12-07 10:55
has joined #pact-go

kingyang728
2021-12-07 15:58
has joined #pact-go

jesseaantebi
2021-12-07 19:36
has joined #pact-go

rsheikh
2021-12-07 22:34
has joined #pact-go

jorgwel
2021-12-08 01:22
has joined #pact-go

rahul.anwekar23
2021-12-08 04:19
has joined #pact-go

luanacosta05
2021-12-08 20:34
has joined #pact-go

saurabh.techiee
2021-12-09 09:41
has joined #pact-go

albertcabantog
2021-12-09 10:52
has joined #pact-go

paul.scholes
2021-12-10 10:21
has joined #pact-go

chris.sloan
2021-12-10 10:48
has joined #pact-go

leon.york
2021-12-10 12:42
has joined #pact-go

kyle.craviotto
2021-12-10 16:40
has joined #pact-go

lorenz.schumann
2021-12-10 18:33
has joined #pact-go

luispires.m
2021-12-13 12:32
has joined #pact-go

fabio.rodrigues
2021-12-13 16:22
has joined #pact-go

mbailey
2021-12-13 22:17
has joined #pact-go

dkwak
2021-12-14 03:47
has joined #pact-go

haoran.lin
2021-12-14 05:27
has joined #pact-go

tom450
2021-12-14 08:06
has joined #pact-go

pajaree.tuampitak
2021-12-14 10:00
has joined #pact-go

nitins333
2021-12-14 10:03
has joined #pact-go

jaakko.tompuri
2021-12-14 13:10
has joined #pact-go

albert.moreno
2021-12-14 17:01
has joined #pact-go

himanshu
2021-12-15 06:16
has joined #pact-go

diva.pant1
2021-12-15 14:21
has joined #pact-go

johnreilly100
2021-12-15 16:36
has joined #pact-go

elliot.weiser
2021-12-15 19:06
has joined #pact-go

sunit
2021-12-16 07:27
has joined #pact-go

felipe.simoes
2021-12-16 18:42
has joined #pact-go

ameadewi
2021-12-16 18:48
has joined #pact-go

felipe.simoes
2021-12-17 02:32
Hello, can someone help me out? I have a server and its provider's tests all set up but I am confused about setting up a workflow on github actions. It requires all dependencies but it fails my pact tests with the following message `exec: "pact-provider-verifier": executable file not found in $PATH` Can anyone share an example of using the pact-ruby-standalone on github actions workflow?

matt.fellows
2021-12-17 04:03
is it on the path?

matt.fellows
2021-12-17 04:08
You still need to download and install the standalone as per https://github.com/pact-foundation/pact-go#installation-on-nix

michael.scheepers
2021-12-17 08:11
has joined #pact-go

felipe.simoes
2021-12-17 14:28
thanks, it seemed to work like this ```curl -LO https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v1.88.81/pact-1.88.81-linux-x86_64.tar.gz && tar xzf pact-1.88.81-linux-x86_64.tar.gz && echo "$PWD/pact/bin" >> $GITHUB_PATH```

felipe.simoes
2021-12-17 14:30
I was a bit confused on how to use it on github actions, it was actually very simple. thank you @matt.fellows

yanis.benekaa
2021-12-17 16:05
has joined #pact-go

dilek
2021-12-20 12:42
has joined #pact-go

sadhana.0203
2021-12-21 07:55
has joined #pact-go

adrian.ernst.lgln
2021-12-21 08:36
has joined #pact-go

dalton.pinto
2021-12-21 09:53
has joined #pact-go

roman.rutkowski.87
2021-12-21 15:42
has joined #pact-go

maxwell.xandeco
2021-12-22 21:43
has joined #pact-go

lixiaoyan68
2021-12-23 06:50
has joined #pact-go

sashaavramchik
2021-12-23 09:07
has joined #pact-go

jamie.manson
2021-12-23 10:51
has joined #pact-go

colin.ansah
2021-12-23 13:21
has joined #pact-go

bruno855
2021-12-23 17:47
has joined #pact-go

appgify
2021-12-23 20:41
has joined #pact-go

jason329
2021-12-23 22:12
has joined #pact-go

shaheen.d2
2021-12-24 07:55
has joined #pact-go

laura.koekenberg
2021-12-24 10:32
has joined #pact-go

craiganthonyrichards
2021-12-25 05:01
has joined #pact-go

mch
2021-12-28 12:54
has joined #pact-go

florian.becker_pact-s
2021-12-28 14:49
has joined #pact-go

oblique
2021-12-28 18:45
has joined #pact-go

smalladi
2021-12-28 19:22
has joined #pact-go

jordan.nazemi
2021-12-28 19:24
has joined #pact-go

gbhusari
2021-12-28 21:22
has joined #pact-go

pghosh
2021-12-28 21:23
has joined #pact-go

carlos.agullo
2021-12-29 08:46
has joined #pact-go

cyrus.devnomad
2021-12-29 14:15
has joined #pact-go

muirandy
2021-12-30 17:57
has joined #pact-go

brocheleau
2022-01-03 21:23
@brocheleau has left the channel

hocautomation
2022-01-05 09:54
has joined #pact-go

deepakdaga2007
2022-01-05 17:49
has joined #pact-go

tomas.hornak
2022-01-05 23:49
has joined #pact-go

juan.cruz
2022-01-06 02:44
has joined #pact-go

marconota.mac
2022-01-06 10:30
has joined #pact-go

marta.rey-benito
2022-01-06 15:56
has joined #pact-go

fr4ngus
2022-01-06 16:20
has joined #pact-go

aparnachaudhari
2022-01-06 23:26
Hello @matt.fellows following up on this ^ one of our projects would like to use pact to test graphql schema between consumer and provider

matt.fellows
2022-01-07 12:49
Hi @aparnachaudhari! sorry, I?m currently on leave so my notifications are off - did you end up raising the request on the repo? I don?t recall seeing it, but as noted should be easy enough to do. If you could please raise it, i?ll get it added!

huhuang
2022-01-08 05:28
has joined #pact-go

frankfullstack
2022-01-09 20:33
has joined #pact-go

gkrawczyszyn
2022-01-10 06:51
has joined #pact-go

tom.kelly
2022-01-10 15:05
has joined #pact-go

dave.sorenson
2022-01-10 15:51
has joined #pact-go

gianni.araco
2022-01-11 16:13
has joined #pact-go

aparnachaudhari
2022-01-11 17:49
Added a request for this yesterday.. FYI

anu.johar
2022-01-11 20:25
has joined #pact-go

matt.fellows
2022-01-11 20:35
Thanks, I saw that :sunglasses:

yann.danot
2022-01-12 10:15
has joined #pact-go

hsanghavi
2022-01-13 00:57
has joined #pact-go

vejeta
2022-01-13 03:19
has joined #pact-go

sweeneyrichard2
2022-01-13 15:43
has joined #pact-go

thuvu.se
2022-01-14 05:51
has joined #pact-go

rahul.meher
2022-01-14 09:02
has joined #pact-go

gavin.campbell
2022-01-14 17:31
has joined #pact-go

davideliu
2022-01-14 17:52
has joined #pact-go

pavlo.sprogis
2022-01-16 17:15
has joined #pact-go

jbrady
2022-01-16 21:54
has joined #pact-go

johnathan
2022-01-17 04:42
has joined #pact-go

dimakos.neoklis
2022-01-17 15:04
has joined #pact-go

gueorgui
2022-01-17 16:43
has joined #pact-go

marcbetts
2022-01-17 22:35
has joined #pact-go

lambat.ishanya
2022-01-18 05:10
has joined #pact-go

sprathi
2022-01-18 13:40
has joined #pact-go

emanuela.ceuta
2022-01-18 16:25
has joined #pact-go

chaugule.sandeep
2022-01-19 05:00
has joined #pact-go

ajay.kawde
2022-01-19 13:34
has joined #pact-go

liam.chen
2022-01-19 21:19
has joined #pact-go

taylor.phillips01
2022-01-19 21:45
has joined #pact-go

sandeepa.kv
2022-01-20 06:46
has joined #pact-go

shane.dombowsky
2022-01-20 14:08
has joined #pact-go

jlbrown
2022-01-20 15:29
has joined #pact-go

gabriel.fatori
2022-01-20 18:36
has joined #pact-go

petersonbtah
2022-01-20 20:16
has joined #pact-go

llast
2022-01-20 21:44
has joined #pact-go

devesh.mishra
2022-01-21 04:26
has joined #pact-go

viveksingh.kiit
2022-01-21 09:29
has joined #pact-go

viveksingh.kiit
2022-01-21 09:57
@viveksingh.kiit has left the channel

james.demaine
2022-01-21 10:02
has joined #pact-go

theferryatbuckland
2022-01-21 20:24
has joined #pact-go

david.kormushoff
2022-01-22 00:54
has joined #pact-go

tom.tantisalidchai
2022-01-25 05:43
has joined #pact-go

cedric.spengler
2022-01-25 15:08
has joined #pact-go

austin.reifsteck
2022-01-25 15:20
has joined #pact-go

hsd999
2022-01-25 19:06
has joined #pact-go

parasonbe
2022-01-25 20:31
has joined #pact-go

alex.diaz
2022-01-26 09:05
has joined #pact-go

kskowron
2022-01-26 11:30
has joined #pact-go

spencerm
2022-01-26 14:33
has joined #pact-go

cristiano.cunha
2022-01-26 14:55
has joined #pact-go

nish063
2022-01-27 02:42
has joined #pact-go

ingcmurcia
2022-01-27 04:41
has joined #pact-go

weijian.duan
2022-01-27 08:58
has joined #pact-go

abraham.gonzalez93
2022-01-27 10:39
has joined #pact-go

demna
2022-01-27 15:29
has joined #pact-go

mircea.ungureanu
2022-01-27 15:48
has joined #pact-go

nikhilwa84
2022-01-27 17:43
has joined #pact-go

bogdanm.rusu
2022-01-27 18:04
has joined #pact-go

cventcport
2022-01-27 22:29
has joined #pact-go

mayuri.khemani
2022-01-28 09:43
has joined #pact-go

sujith.nair2
2022-01-28 12:33
has joined #pact-go

rob
2022-01-28 16:36
has joined #pact-go

radovan
2022-01-29 00:20
has joined #pact-go

mongeyc
2022-01-31 14:03
has joined #pact-go

mike.bernard
2022-01-31 21:14
has joined #pact-go

tjoy
2022-02-01 02:06
has joined #pact-go

max.tilford
2022-02-01 03:17
has joined #pact-go

toanshukumar
2022-02-01 14:15
has joined #pact-go

juanquis419
2022-02-01 15:01
has joined #pact-go

matt.murray
2022-02-01 19:40
has joined #pact-go

aparnachaudhari
2022-02-02 07:30
following up on ^ any updates?

frederic.gendebien
2022-02-02 08:54
has joined #pact-go

frederic.gendebien
2022-02-02 09:00
Hello gentlemen, I am doing a proof-of-concept with pact and pactflow in Go (obviously, since I am here?) and I encounter a weird behaviour from the framework, my server offers an HTTP API and Produces messages at the same time (of course). I have one client which is using the HTTP API and another one which is reading the events, so I have two pacts. When I ?VerifyProvider? using the framework it executes both pact at the same time, the HTTP succeeds but the messaging part fails, because there is no obvious way to define MessageHandlers. The same occurs but in the other way when I test the messaging layer (VerifyMessageProvider), the message part is ok but the HTTP fails because there are no way to define the url. How do I do it without giving different names for the same provider? Thanks

matt.fellows
2022-02-02 11:03
Sorry @aparnachaudhari have been flat out the last couple of weeks, should be able to get to it next week I think.

matt.fellows
2022-02-02 11:04
If you wanted to write your own adapter, it?s not very big. This is the Pact JS one: https://github.com/pact-foundation/pact-js/blob/master/src/dsl/graphql.ts

matt.fellows
2022-02-02 11:04
the main barrier for me to implement it quickly, is that it would mostly require me to understand the current Golang GraphQL ecosystem and make sure that it supports it. GraphQL in general is straightforward, but there can be language specific gotchas

matt.fellows
2022-02-02 11:05
What lib do you use / is the most popular we should use as a test bed do you think?

matt.fellows
2022-02-02 11:06
> How do I do it without giving different names for the same provider? in the current 1.x.x branch, you need different names

matt.fellows
2022-02-02 11:07
In the 2.x.x branch it should _soon_ be supported (the v4 specification of Pact - not to be confused with the version of libraries - allows for this). 2.x.x supports v3 spec, but should be straightforward to add 4 once we release the next major of Pact Go

dougie.robertson
2022-02-02 11:15
has joined #pact-go

frederic.gendebien
2022-02-02 13:16
@matt.fellows thanks!

juan.avendano
2022-02-02 13:36
has joined #pact-go

frederic.gendebien
2022-02-03 08:38
Just migrated from 1.x.x to 2.x.x and got: Undefined symbols for architecture arm64

frederic.gendebien
2022-02-03 08:38
:sleepy:

frederic.gendebien
2022-02-03 08:47
Not sure it is compliant with M1 chip

matt.fellows
2022-02-03 08:51
Yep, we don't have libraries/binaries for that yet sorry

matt.fellows
2022-02-03 08:51
It might work under Rosetta mode but I can't say for sure

matt.fellows
2022-02-03 08:52
If you can please raise an issue it shouldn't be hard to support

frederic.gendebien
2022-02-03 08:52
Sure! FYI it does not work with rosetta

frederic.gendebien
2022-02-03 08:52
arch: posix_spawnp: go: Bad CPU type in executable

matt.fellows
2022-02-03 08:56
Haha dang

matt.fellows
2022-02-03 08:56
Thanks, I'll look into it this weekend


ausachov
2022-02-03 13:15
has joined #pact-go

aaron.kibbie
2022-02-03 15:59
has joined #pact-go

williangldzn
2022-02-03 20:23
has joined #pact-go

ricardo.gonzaga
2022-02-04 09:35
has joined #pact-go

robin.jacques
2022-02-04 10:51
has joined #pact-go

joaomiguel.rocha
2022-02-04 17:40
has joined #pact-go

matt.fellows
2022-02-04 23:09
latest beta released that should support this. See also the response to your issue

matt.fellows
2022-02-04 23:09
thanks for raising

jacek.sienniak
2022-02-07 08:45
has joined #pact-go

jamie.weatherby
2022-02-07 15:25
has joined #pact-go

joaobrandao.rodrigues
2022-02-07 16:30
has joined #pact-go

extra
2022-02-07 21:31
has joined #pact-go

aparnachaudhari
2022-02-07 22:34
hey Matt, sorry for the delay in getting back to you

aparnachaudhari
2022-02-07 22:34
https://github.com/99designs/gqlgen is what we are currently using

matt.fellows
2022-02-07 22:37
thx

matt.fellows
2022-02-07 22:37
that?s the provider side, is there a consumer client language you use?

aparnachaudhari
2022-02-07 22:40
We have yet to decide that, it really depends on what the consumer teams choose to use .. ex the UI being one of our consumer - but for our local/integration tests we use gqlgen?s client

matt.fellows
2022-02-07 22:41
ok cool

matt.fellows
2022-02-07 22:42
I used the Hasura client as an example. I?ll push it up today if you wanted to take a look. Currently spike code, still having a think about what the best API looks like

matt.fellows
2022-02-07 22:43
After this meeting I?ll push and share

aparnachaudhari
2022-02-07 22:48
thank you



matt.fellows
2022-02-08 02:04
Apologies, I did a `go mod tidy` as part of this and it?s added a lot of files, unsurprisingly

aparnachaudhari
2022-02-08 02:05
thank you, will :eyes: tonight or first thing tomorrow

matt.fellows
2022-02-08 02:05
np. The provider side shouldn?t need anything, because as far as it?s concerned, it should just accept the HTTP request and respond as needed.

matt.fellows
2022-02-08 02:05
So it?s really just the consumer side that needs support in the API

matt.fellows
2022-02-08 02:07
I found the hasura GraphQL client a bit unfriendly to use, in that I still had to hard-code the GraphQL query in the test - there was no way to programmatically get it to print out what query it _would_ make. I would ideally like to not have to specify it by hand, as I can see that not being an ideal experience for developers to have to write

matt.fellows
2022-02-08 02:08
If you / your colleague could please eyeball it for feedback and post in that PR, we can iterate from there

aparnachaudhari
2022-02-08 02:14
will do thank you

elenatuzel
2022-02-08 08:27
has joined #pact-go

vadim
2022-02-08 09:19
has joined #pact-go

anna.khv
2022-02-08 12:19
has joined #pact-go

dhospital
2022-02-08 16:15
has joined #pact-go

jcabrera
2022-02-08 18:26
has joined #pact-go

ardiel.fuentes
2022-02-09 07:14
has joined #pact-go

ruud.von.faber
2022-02-09 09:11
has joined #pact-go

agustin.gomes
2022-02-09 13:23
has joined #pact-go

thijme.langelaar
2022-02-09 13:29
has joined #pact-go

dharmesh.kumar
2022-02-09 13:52
has joined #pact-go

athaper
2022-02-09 14:14
has joined #pact-go

svranyes
2022-02-09 20:16
has joined #pact-go

samuel.whittaker
2022-02-09 23:40
has joined #pact-go

david.hvilava
2022-02-10 10:53
has joined #pact-go

carlos.ferrao
2022-02-10 15:46
has joined #pact-go

rios.martinivan
2022-02-10 20:18
has joined #pact-go

charles.kuo
2022-02-10 21:42
has joined #pact-go

sudhanshu.testing
2022-02-11 05:12
has joined #pact-go

alessandro.polidori
2022-02-11 15:02
has joined #pact-go

krisakins
2022-02-12 20:19
has joined #pact-go

ian.cervantez
2022-02-13 03:32
has joined #pact-go

antonio.gamiz
2022-02-14 06:51
has joined #pact-go

zish.gatrad
2022-02-14 16:01
has joined #pact-go

james.troughton
2022-02-14 16:08
has joined #pact-go

manuelam20
2022-02-15 00:41
has joined #pact-go

dchen
2022-02-15 08:03
has joined #pact-go

aristides.suarez
2022-02-15 08:14
has joined #pact-go

marcelino.garcia
2022-02-15 08:22
has joined #pact-go

varnika.singh
2022-02-15 09:11
has joined #pact-go

bernard
2022-02-15 16:22
has joined #pact-go

david.uzumaki
2022-02-15 16:33
has joined #pact-go

abhishekc.jh
2022-02-15 17:21
has joined #pact-go

nuno.frias
2022-02-15 19:28
has joined #pact-go

aparnachaudhari
2022-02-15 21:26
@matt.fellows the developer who is planning to use this commented on the above PR FYI and I am also looking now.

matt.fellows
2022-02-15 21:28
thanks, I saw that come through yesterday. The feedback around extending the types is :ok_hand:

faran
2022-02-15 22:31
has joined #pact-go

andy
2022-02-16 00:35
has joined #pact-go

andy
2022-02-16 00:36
@andy has left the channel

fushinoryuu
2022-02-16 01:40
has joined #pact-go

abdelior
2022-02-16 08:48
has joined #pact-go

misterjkl
2022-02-16 13:12
has joined #pact-go

brian.azizi
2022-02-16 14:05
has joined #pact-go

richelle.raaphorst
2022-02-16 15:17
has joined #pact-go

guillermo.aguirre
2022-02-17 20:06
has joined #pact-go

adamslack
2022-02-18 15:55
has joined #pact-go

darwin.cahyadi
2022-02-18 18:00
has joined #pact-go

jkdihenkar
2022-02-19 10:51
@jkdihenkar has left the channel

rishi.speets
2022-02-19 14:43
has joined #pact-go

ybergstrom
2022-02-21 03:24
has joined #pact-go

gyuvaraj10
2022-02-21 08:03
has joined #pact-go

athissen
2022-02-21 08:09
has joined #pact-go

andrefcsousa
2022-02-21 10:19
has joined #pact-go

katharina.pavic
2022-02-21 12:37
has joined #pact-go

ipoe
2022-02-21 14:54
has joined #pact-go

jeroen.vandijk
2022-02-21 16:40
has joined #pact-go

ondikumana
2022-02-21 22:13
has joined #pact-go

nithyag.ganesan
2022-02-22 10:01
has joined #pact-go

ntiwari
2022-02-22 11:48
has joined #pact-go

phil.vint
2022-02-23 11:01
has joined #pact-go

phongthornk
2022-02-23 11:04
has joined #pact-go

phongthornk
2022-02-23 11:06
:wave: Hello, team!

lukasz
2022-02-23 14:55
has joined #pact-go

ezequiel.uhrig
2022-02-25 13:46
has joined #pact-go

emin.sahin
2022-02-26 13:53
has joined #pact-go

emin.sahin
2022-02-26 13:54
hello guys

emin.sahin
2022-02-26 13:54
i have a problem with pact

emin.sahin
2022-02-26 13:54
[ERROR] service exec: "pact-mock-service": executable file not found in $PATH

emin.sahin
2022-02-26 13:54
i get that error and i couldnt solve

emin.sahin
2022-02-26 13:57
I tried to add to path but the error doesnt change

matt.fellows
2022-02-26 21:39
Can you please share what you've tried? My guess is you've not updated the path correctly or it hasn't taken effect

emin.sahin
2022-02-27 08:58
i used the export path command

emin.sahin
2022-02-27 08:59
*? ~* export PATH=$PATH:/Users/emin.sahin/pact/bin

matt.fellows
2022-02-27 09:20
If you run `/Users/emin.sahin/pact/bin/pact-mock-service` what happens?

matt.fellows
2022-02-27 09:55
cool, that looks good to me

matt.fellows
2022-02-27 09:55
what error are you getting then?

emin.sahin
2022-02-27 09:56
in the project

emin.sahin
2022-02-27 09:56
when i try to run the test

matt.fellows
2022-02-27 09:56
can you please share the failure here?

matt.fellows
2022-02-27 09:57
ideally as text output, not a screenshot

emin.sahin
2022-02-27 09:58
GOROOT=/Users/emin.sahin/sdk/go1.17.2 #gosetup GOPATH=/Users/emin.sahin/go #gosetup /Users/emin.sahin/sdk/go1.17.2/bin/go test -c -o /private/var/folders/2_/s1hp0w_n6kl2wc6b974fht109b462r/T/GoLand/___Test_IPostNewProductWithGivenID_in_backend_test_front_end.test backend/test/front_end #gosetup /Users/emin.sahin/sdk/go1.17.2/bin/go tool test2json -t /private/var/folders/2_/s1hp0w_n6kl2wc6b974fht109b462r/T/GoLand/___Test_IPostNewProductWithGivenID_in_backend_test_front_end.test -test.v -test.paniconexit0 -test.run ^\QTest_IPostNewProductWithGivenID\E$ === RUN Test_IPostNewProductWithGivenID 2022/02/27 12:56:47 [ERROR] service exec: ?pact-mock-service?: executable file not found in $PATH 2022/02/27 12:56:57 [ERROR] Expected server to start < 10s. Timed out waiting for Mock Server to start on port 56421 - are you sure it?s running? 2022/02/27 12:56:57 [ERROR] client: failed to wait for Mock Server: Expected server to start < 10s. Timed out waiting for Mock Server to start on port 56421 - are you sure it?s running? --- FAIL: Test_IPostNewProductWithGivenID (10.00s) panic: runtime error: invalid memory address or nil pointer dereference [recovered] panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x134c6b2] goroutine 19 [running]: testing.tRunner.func1.2({0x138b8e0, 0x1720a40}) /Users/emin.sahin/sdk/go1.17.2/src/testing/testing.go:1209 +0x24e testing.tRunner.func1() /Users/emin.sahin/sdk/go1.17.2/src/testing/testing.go:1212 +0x218 panic({0x138b8e0, 0x1720a40}) /Users/emin.sahin/sdk/go1.17.2/src/runtime/panic.go:1038 +0x215 http://github.com/pact-foundation/pact-go/dsl.(*PactClient).StartServer(0xc00017e600, {0xc0002d2180, 0xc, 0xc}, 0xdc65) /Users/emin.sahin/go/pkg/mod/github.com/pact-foundation/pact-go@v1.6.9/dsl/client.go:107 +0x372 http://github.com/pact-foundation/pact-go/dsl.(*Pact).Setup(0xc000129e58, 0x1) /Users/emin.sahin/go/pkg/mod/github.com/pact-foundation/pact-go@v1.6.9/dsl/pact.go:200 +0x759 http://github.com/pact-foundation/pact-go/dsl.(*Pact).AddInteraction(0xc000129e58) /Users/emin.sahin/go/pkg/mod/github.com/pact-foundation/pact-go@v1.6.9/dsl/pact.go:117 +0x27 backend/test/front_end.Test_IPostNewProductWithGivenID(0xc000117520) /Users/emin.sahin/Desktop/adamgibi/backend/test/front_end/product_test.go:27 +0x111 testing.tRunner(0xc000117520, 0x1400dc8) /Users/emin.sahin/sdk/go1.17.2/src/testing/testing.go:1259 +0x102 created by testing.(*T).Run /Users/emin.sahin/sdk/go1.17.2/src/testing/testing.go:1306 +0x35a Process finished with the exit code 1

matt.fellows
2022-02-27 09:58
so it looks like you are running the process in different places

matt.fellows
2022-02-27 09:59
in the first place, a standalone terminal, and the other place (from the brief screenshot you posted, helpfully :stuck_out_tongue: ) frrom an IDE

matt.fellows
2022-02-27 09:59
My guess is that the IDE does not know about this environment variable

emin.sahin
2022-02-27 09:59
yes

emin.sahin
2022-02-27 09:59
how can i solve it

matt.fellows
2022-02-27 09:59
running `export VAR=value` in one terminal does not result in it working in another terminal

emin.sahin
2022-02-27 10:00
oh ok

matt.fellows
2022-02-27 10:00
you need to: 1. Make it a global environment variable (e.g. add it to your ~/.bashrc or ~./profile) 2. Add it to Goland / IDE (however the IDE supports that)

emin.sahin
2022-02-27 10:04
i have just made the first step

emin.sahin
2022-02-27 10:05
how can i do the second step

matt.fellows
2022-02-27 10:05
sorry, those two are options. So the first step is probably all you need

matt.fellows
2022-02-27 10:05
close down Goland

matt.fellows
2022-02-27 10:06
and then open it back up. If you open it from a terminal, do it in the terminal you know has the updated env var

matt.fellows
2022-02-27 10:06
I can?t tell you anything more than that, you should look at your IDE docs for that

emin.sahin
2022-02-27 10:06
yeah it worked

emin.sahin
2022-02-27 10:07
i made the first step

emin.sahin
2022-02-27 10:07
and restart the ide

emin.sahin
2022-02-27 10:07
after that it worked

emin.sahin
2022-02-27 10:07
thank you very much

emin.sahin
2022-02-27 10:07
:slightly_smiling_face:

ihassin
2022-02-27 21:20
has joined #pact-go

yumiihuang
2022-02-28 09:55
has joined #pact-go

yousaf
2022-02-28 11:57
has joined #pact-go

gerry
2022-02-28 12:56
has joined #pact-go

agustina.bosso
2022-02-28 16:04
has joined #pact-go

deactivateduser320370
2022-03-01 11:41
has joined #pact-go

luke.bickell
2022-03-01 14:46
has joined #pact-go

luke.bickell
2022-03-01 16:04
@luke.bickell has left the channel

james.williams
2022-03-01 16:29
has joined #pact-go

qluck
2022-03-01 22:15
has joined #pact-go

peter.pinda
2022-03-01 23:37
has joined #pact-go

omer.bilgin
2022-03-02 15:51
has joined #pact-go

banolik
2022-03-02 18:35
has joined #pact-go

ancyaziz
2022-03-02 22:26
has joined #pact-go

timothyg
2022-03-02 23:40
has joined #pact-go

ancyaziz
2022-03-02 23:58
I am new to Pact Contract Testing. I am using Pact-go and I have a Struct with String[], I need to write a pact:example for this, but I am getting error "`struct field tag `json:"tags" pact:"example="Name::CustomerName","Status::Live""` not compatible with reflect.StructTag.Get: key:"value" pairs not separated by spaces`". JSON value is ```"tags":["Name::CustomerName","Status::Live"]``` Under Struct, this is what I have which is throwing error. `Tags []string `json:"tags" pact:"example="Name::CustomerName","Status::Live""`` can someone tell me the correct format of pact:example for string[]?

harihararaj.lk
2022-03-03 09:44
has joined #pact-go

matt.fellows
2022-03-03 10:55
you can?t put commas like that - that error is a standard Go struct tag problem

matt.fellows
2022-03-03 10:55
You provide one example value in the pact struct tag

matt.fellows
2022-03-03 10:55
So, something like this: ```Tags []string `json:"tags" pact:"example="Name::CustomerName"```

matt.fellows
2022-03-03 10:56
Personally, I think the struct tags are very limiting despite being convenient for simple cases

matt.fellows
2022-03-03 10:56
you can?t test multiple scenarios with them with different data, for instance

mircea.ungureanu
2022-03-03 11:40
@mircea.ungureanu has left the channel

toyamarinyon
2022-03-03 13:25
has joined #pact-go

david342
2022-03-03 13:26
has joined #pact-go

ancyaziz
2022-03-03 14:02
thank you so much!

ancyaziz
2022-03-03 14:19
this is still throwing me error `Tags []string `json:"tags" pact:"example="Name::CustomerName""`` may be because there are still 2 " at the end. Even the below throwing error "parsing failed" `Tags []string `json:"tags" pact:"example=Name::CustomerName"``

yesilmenadil
2022-03-03 16:14
has joined #pact-go

dajaman1
2022-03-03 20:30
has joined #pact-go

waqif
2022-03-03 23:32
has joined #pact-go

dmitry.matveev
2022-03-03 23:44
has joined #pact-go

reuben.tonna
2022-03-04 14:32
has joined #pact-go

negrolyze
2022-03-04 15:34
has joined #pact-go

negrolyze
2022-03-04 15:52
been looking at this https://docs.pact.io/slack/pact-go.html#1531267542.000155 as i have ran into the error where i get `No pacts found to verify` . This fails my test, what could be the cause

negrolyze
2022-03-04 15:52
and what is the fix?

42amehmeto
2022-03-04 19:17
has joined #pact-go

rawatankit90
2022-03-04 22:33
has joined #pact-go

matt.fellows
2022-03-04 23:35
It's usually because the selectors you're using are incorrect and it can't find any pacts. I.e likely a configuration issue

matt.fellows
2022-03-04 23:35
Enable debug logging to find out why it can't find any pacts

tom.daley
2022-03-07 09:09
has joined #pact-go

leon.brown
2022-03-07 09:26
has joined #pact-go

aurelia.rochat
2022-03-07 10:16
has joined #pact-go

kabhatiya
2022-03-08 00:51
has joined #pact-go

luis.garelli
2022-03-08 09:29
has joined #pact-go

andrevdrodrigues
2022-03-08 12:50
has joined #pact-go

tobias
2022-03-08 13:11
has joined #pact-go

mutharaju.kk
2022-03-08 14:34
has joined #pact-go

gerry
2022-03-08 14:48
@gerry has left the channel

will.robinson
2022-03-08 14:54
has joined #pact-go

fragonib
2022-03-08 16:22
has joined #pact-go

jason.wang
2022-03-08 19:05
has joined #pact-go

ancyaziz
2022-03-09 03:51
I have a response body with contents like below, is there a way to match the values in Header using dsl.Match and just validate the type of the fields inside Body part using dsl.Like in pact.AddInteraction WillRespondWith section? ```[ { "Body": { "environments": [ { "createdDate": "2020-05-20", "id": "abc", "name": "abc", "state": "YES", "tags": [], "status": false } ], "nPageKey": "aabbgggcc==", "pageSize": 1, "totalCount": 1 }, "Header": { "ResponseCode": 200, "Region": "xyz" } } ]```

matt.fellows
2022-03-09 04:21
You want to match exact values in the header, but types in the body?

matt.fellows
2022-03-09 04:22
I think so, you just need to not put matchers (via struct tags) on the things that should be exact matched

ancyaziz
2022-03-09 04:48
Thank you for the reply! Do you mean if I don't put pact:"example=value" on Struct, it will work using dsl.Match? sorry I am new to pact, so confirming.

matt.fellows
2022-03-09 05:10
Yes it should just mean "match exact value"

sam680
2022-03-09 05:12
has joined #pact-go

matt.fellows
2022-03-09 05:15
If that doesn't work, you might need to use the standard matchers

annette.reid
2022-03-09 07:43
has joined #pact-go

ancyaziz
2022-03-09 08:11
thank you so much!

tomknee1
2022-03-09 08:54
Hi has anyone got pact go v3 beta working on M1 Mac / arm64 architecture?

matt.fellows
2022-03-09 09:30
I've had a few queries about this lately, I'll take a look tonight on an AWS M1 instance and see what I can do

matt.fellows
2022-03-09 09:30
It's hard, I dont have an M1 and GH actions doesn't yet either

matt.fellows
2022-03-09 09:31
I'm told Rosetta mode also doesn't work, but have yet to verify for the same reasons as above

jeroen.vandijk
2022-03-09 12:26
I'm interested to know this as well.

victor.lau
2022-03-09 20:46
has joined #pact-go

tomknee1
2022-03-10 10:22
thanks, much appreciated :slightly_smiling_face:

matt.fellows
2022-03-10 11:41
BTW I thought AWS had M1 machines, but they are in ?preview? and you have to apply. I?ve applied, but no response yet

tomknee1
2022-03-10 13:48
ah ok good to know, thanks for the update

kenneth.krause
2022-03-10 16:41
has joined #pact-go

bergner
2022-03-11 06:19
has joined #pact-go

gotax80534
2022-03-11 06:55
has joined #pact-go

mathias
2022-03-11 10:17
has joined #pact-go

jtcsek
2022-03-11 13:02
has joined #pact-go

josephwoodward
2022-03-11 13:08
has joined #pact-go

joachim005
2022-03-14 08:16
has joined #pact-go

alexstout009
2022-03-14 14:32
has joined #pact-go

paul.richards
2022-03-14 14:38
has joined #pact-go

akif.tahir
2022-03-14 15:00
has joined #pact-go

lramos
2022-03-14 16:29
has joined #pact-go

michael036
2022-03-14 18:31
has joined #pact-go

lauren.coggin
2022-03-14 19:27
has joined #pact-go

mkanika1811
2022-03-15 09:22
has joined #pact-go

ian.pringle
2022-03-15 11:02
has joined #pact-go

negrolyze
2022-03-15 11:19
how does one enable debugging


karl.wagner
2022-03-15 12:25
has joined #pact-go

chaitasi.patel988
2022-03-16 04:04
has joined #pact-go

mathias
2022-03-16 08:05
@mathias has left the channel

jose.iglesias
2022-03-16 09:23
has joined #pact-go

alegab0710
2022-03-16 10:20
has joined #pact-go

jeroen.vandijk
2022-03-16 12:25
hello :slightly_smiling_face: with Pact Go v2, is there a way to set the Provider Log Directory? In v1 it was:

jeroen.vandijk
2022-03-16 12:25
``` pact := dsl.Pact{ Provider: "GoUserService", LogDir: logDir, LogLevel: "INFO", }```

serghei.pogodin
2022-03-16 12:31
has joined #pact-go

matt.fellows
2022-03-16 12:49
No, at least not at the moment. It currently logs to stdout

matt.fellows
2022-03-16 12:50
the core engine now supports it though, so we could redirect it there

matt.fellows
2022-03-16 12:50
mind raising a feature request (if you want it, of course!). Otherwise, all logging goes to stdout and you can configure via log levels

jeroen.vandijk
2022-03-16 13:39
Thanks Matt, not that keen for it, as did not find it particularly useful. I was curious in case I missed it :thumbsup:

jeremy.vincent
2022-03-16 14:29
has joined #pact-go

1.g10squad
2022-03-16 16:01
has joined #pact-go

alistair.c.kung
2022-03-16 18:44
has joined #pact-go

matt.fellows
2022-03-17 02:00
ah, cool - thanks. One less thing to do :slightly_smiling_face:

adam.howard
2022-03-17 02:05
has joined #pact-go

jonatan.jaworski
2022-03-17 02:32
has joined #pact-go

lewis.greenway-jones
2022-03-17 08:52
has joined #pact-go

pierre.gerard
2022-03-17 11:59
has joined #pact-go

viswanathan.sarma
2022-03-17 22:39
has joined #pact-go

osirisnos4a2
2022-03-17 22:56
has joined #pact-go

madhulika.mitra
2022-03-18 15:56
has joined #pact-go

ancyaziz
2022-03-19 01:51
Hi, I have a response file that provides a body like below, some entries with response code 200 and few with 404, and the "Body" tag is different in this case, one with a "monitors" array and another with an error, is there a way to match this response in AddInteraction WillRespondWith section? I tried using this but it's failing matching for the cases with 404 error. ```Body: dsl.EachLike(map[string]interface{}{ "Body": dsl.Like(map[string]interface{}{ "monitors": dsl.EachLike(map[string]interface{}{}, 0), })``` Response: ```[{"Header":{"Region":"abc","Tenant":"abc","Stage":"dev","Status":"Live","RespCode":200},"Body":{"monitors":[]}},{"Header":{"Region":"xyz","Tenant":"xyz","Stage":"dev","Status":"NotLive","RespCode":404},"Body":{"error":{"code":404,"message":"failed to resolve tenant xyz"}}}]```

matt.fellows
2022-03-19 05:08
I'm not sure I understand sorry, you can definitely test the body shape in that JSON you shared. This looks like it's failing the verification though, which would indicate the request is not eliciting the response shape you're after.. Can you please share the req/res details your expecting, the consumer pact test and the provider verification output?

ancyaziz
2022-03-21 00:33
sorry for delayed response. My issue here is that when the RespCode is 200, I get an an array of "monitors" object, and when the RespCode is 404, I get a hash of "error", so it's not matching for cases with RespCode 404 with my Matcher code. I am trying to see if there is an option to match with both cases. Our internal provider is reading data from a third party and providing the response, that's why we are getting RespCode 200 and 404.

matt.fellows
2022-03-21 00:36
You need to create two separate test cases - one for each of the `200` and `404` scenarios. You would then use a Provider State in the consumer test to control the desired outcome from the provider. Pact is not designed to be tested against a live system for this reason - it?s hard to control the state of the provider. You really should be running the provider in a controlled (unit test-like) environment, where you can manipulate external dependencies as needed

ancyaziz
2022-03-21 03:16
thank you so much for your quick response!! much appreciated.

rupam.saha
2022-03-21 09:26
has joined #pact-go

christian.jeppesen
2022-03-21 10:10
has joined #pact-go

anand.kannan
2022-03-21 10:10
has joined #pact-go

mikhail.yartsev
2022-03-21 10:10
has joined #pact-go

bblechman
2022-03-21 16:36
has joined #pact-go

jeffrey2011998
2022-03-22 09:22
has joined #pact-go

xavier.arque
2022-03-22 11:33
has joined #pact-go

aubrey
2022-03-22 14:32
has joined #pact-go

balazs
2022-03-22 15:51
has joined #pact-go

seasharp37
2022-03-22 22:17
has joined #pact-go

saritacutinha
2022-03-23 07:09
has joined #pact-go

rachelb
2022-03-23 10:16
has joined #pact-go

shaheen
2022-03-23 23:11
has joined #pact-go

sentyaev
2022-03-24 12:36
has joined #pact-go

altan.demirkiran
2022-03-24 14:06
has joined #pact-go

jonathan.fortunati
2022-03-24 21:53
has joined #pact-go

simon.dicola
2022-03-25 10:25
has joined #pact-go

mrooschuz
2022-03-25 14:52
has joined #pact-go

ashok.pathak
2022-03-25 15:17
has joined #pact-go

rdanthuluri
2022-03-27 03:28
has joined #pact-go

jeffrey2011998
2022-03-28 10:33
I have a question regarding a go provider verifying contracts. When verification of a contract fails I don't want my entire test run to fail but I just want pact to publish the results to the broker. Is this possible?

matt.fellows
2022-03-28 10:48
No, the exit code will always be a failure. You can always run the suite separate to your other tests (e.g. using build tags) and choose how to behave based on that code

matt.fellows
2022-03-28 10:49
Pending pacts is the one exception to this rule though

jeffrey2011998
2022-03-28 10:51
Allright, I'm gonna try that

cudi.unal
2022-03-28 11:25
has joined #pact-go

jeffrey2011998
2022-03-28 12:05
Reading the documentation, it is possible to set the branch on a provider using the pact-provider-verifier. Only, the pact-provider-verifier seems only able to verify HTTP based contracts by testing against a real API. I'm using message based contracts. Is it possible to set the branch of my provider?

matt.fellows
2022-03-28 12:46
why are you using that and not the Golang API?

matt.fellows
2022-03-28 12:47
(unless you mean https://github.com/pact-foundation/pact-go/blob/master/dsl/verify_mesage_request.go, in which case, you?re right, it needs to be added)

matt.fellows
2022-03-28 12:47
We are currently planning the final work for branches/environments/releases so this would be in scope

matt.fellows
2022-03-28 12:47
it?s a minor change, so if you?re up for a PR we?d happily accept

ashraf.anwar.iw
2022-03-28 13:12
has joined #pact-go

b.costa
2022-03-28 13:15
has joined #pact-go

jeffrey2011998
2022-03-28 13:58
Right now I got it working by retrieving the git branch in code and adding it as a tag. Although for convenience I also made a PR: https://github.com/pact-foundation/pact-go/pull/209

jeffrey2011998
2022-03-28 14:41
Just noticed an error occurs when using the change: "unknown field 'TagWithGitBranch' in struct literal of type types.VerifyRequest". I probably need to add some definition somewhere, looking into it

mark.hopper
2022-03-28 14:53
has joined #pact-go

ashraf.anwar
2022-03-28 15:08
has joined #pact-go

damianruizdev
2022-03-28 18:44
has joined #pact-go

matthew.churcher
2022-03-29 08:48
has joined #pact-go

ben.brugman
2022-03-29 14:32
has joined #pact-go

hassan.shaikley
2022-03-29 16:14
has joined #pact-go

oakkub.1995
2022-03-30 07:10
has joined #pact-go

ancyaziz
2022-03-30 11:13
is it possible to update the pact generated contract json before uploading to pact-broker by consumer or before verification by provider? I want to replace my path variable with a different value.

matt.fellows
2022-03-30 11:42
You definitely can, but I'd love to know more about the use case. It could be a rather fragile approach

ancyaziz
2022-03-30 11:46
my provider path is something like this "/api/xyz/v2/envs?pageSize=1&filter=state(ENABLED)&abc=false&bcd=false&xyz=false&env=uvw" and I am using a mock client with path mock/uvw for consumer

ancyaziz
2022-03-30 11:48
so while verification it fails saying expected and actual path is different, so I am looking for a way to use the same path. Previously I was updating the path value before provider verification as I was copying the contracts manually, but now I start using pact-broker, so I am rying to find a way to update the path before it gets uploaded to the pact-broker

matt.fellows
2022-03-30 11:53
Why aren't you using the correct path in your mock?

ancyaziz
2022-03-30 11:54
I tried using the same path, but it was giving me error, maybe I am doing something wrong

hiqbal
2022-03-30 15:16
has joined #pact-go

sstenhouse
2022-03-30 15:16
has joined #pact-go

bmeyres
2022-03-30 17:37
has joined #pact-go

alejandro.velez
2022-03-30 18:42
has joined #pact-go

justin
2022-03-30 20:07
has joined #pact-go

leo.adriano1994
2022-03-31 00:00
has joined #pact-go

ancyaziz
2022-03-31 03:35
I was able to fix it!! Thank you for responding even while you are on vacation.

hitesh.patadia
2022-03-31 04:27
has joined #pact-go

matt.cockayne
2022-03-31 11:02
has joined #pact-go

jimmy
2022-03-31 15:39
has joined #pact-go

justin
2022-03-31 18:12
Trying to get v2 running on windows, I've got gcc installed via msys2/mingw64 Running pact-go install returns ```2022/03/31 11:24:39 [INFO] package libpact_ffi not found 2022/03/31 11:24:39 [INFO] downloading library from https://github.com/pact-foundation/pact-reference/releases/download/libpact_ffi-v0.1.2/libpact_ffi-windows-x86_64.dll.gz to /usr/local/lib/libpact_ffi.dll 2022/03/31 11:24:39 [ERROR] Your Pact library installation is out of date and we were unable to download a newer one for you: bad response code: 404``` I tried manually downloading and copying the `libpact_ffi.dll` and `libpact_ffi.so` to C:\msys64\mingw64\lib And it's running the tests now (got some failures to work out first)

justin
2022-03-31 18:14
Was initially getting failures when I tried C:\msys64\usr\local\lib

justin
2022-03-31 18:16
```[DEBUG] executing verifier FFI with args [--hostname localhost --port 51603 --state-change-url http://localhost:51603/__setup --broker-url https://paxi.pactflow.io --token MyTokenValue --provider-version 1.0.0 --provider-name Notifications --publish --loglevel info] ERROR pact_ffi::verifier::verifier] error verifying Pact: "error: The argument '--token <token>' requires 1 values, but 2 were provided USAGE: pact_verifier_cli --broker-url <broker-url> --dir <dir>... --file <file>... --hostname <hostname> --loglevel <loglevel> --port <port> --provider-name <provider-name> --provider-version <provider-version> --publish --scheme <scheme> --state-change-url <state-change-url> --token <token> --url <url>... For more information try --help" Error { message: "error: The argument '--token <token>' requires 1 values, but 2 were provided USAGE: pact_verifier_cli --broker-url <broker-url> --dir <dir>... --file <file>... --hostname <hostname> --loglevel <loglevel> --port <port> --provider-name <provider-name> --provider-version <provider-version> --publish --scheme <scheme> --state-change-url <state-change-url> --token <token> --url <url>... For more information try --help", kind: WrongNumberOfValues, info: Some(["token"]) }``` I don't see it passing 2 tokens in, and no spaces or symbols in the token. Using http://pactflow.io

justin
2022-03-31 18:19
``` // Verify the Provider - Latest Published Pacts for any known consumers err := verifier.VerifyProvider(t, VerifyRequest{ Provider: "Notifications", ProviderBaseURL: fmt.Sprintf("http://127.0.0.1:%d", port), BrokerURL: os.Getenv("PACT_BROKER_BASE_URL"), PublishVerificationResults: true, ProviderVersion: "1.0.0", StateHandlers: stateHandlers, EnablePending: pending, BrokerToken: os.Getenv("PACT_BROKER_TOKEN"), })```

matt.fellows
2022-03-31 21:27
Ah. Double check you don't also have PACT_ env vars set. The underlying argument parser sees them as duplicates, not a hierarchy

bret.mcclory538
2022-04-01 01:10
has joined #pact-go

michael.d
2022-04-01 04:40
has joined #pact-go

yash.deole
2022-04-01 07:07
has joined #pact-go

alan.alie
2022-04-01 08:10
has joined #pact-go

ricardo.cruz
2022-04-01 11:54
has joined #pact-go

lauren.corderoy
2022-04-01 12:24
has joined #pact-go

jiayao.xu
2022-04-01 12:24
has joined #pact-go

shiva.velde0413
2022-04-01 14:44
has joined #pact-go

justin
2022-04-01 15:24
I definitely do have them set, Gotta remove those.

npc1222
2022-04-04 04:37
has joined #pact-go

arthur
2022-04-04 14:28
has joined #pact-go

agastiya.mohammad
2022-04-05 01:19
has joined #pact-go

paul.stapleton
2022-04-05 07:33
has joined #pact-go

iurisoares1012
2022-04-05 09:53
has joined #pact-go

gocool9996
2022-04-05 10:04
has joined #pact-go

simrat.sidhu
2022-04-05 16:07
has joined #pact-go

gabriel.brazao
2022-04-05 17:42
has joined #pact-go

jhonataok01
2022-04-05 17:43
has joined #pact-go

andre.mariano
2022-04-05 19:10
has joined #pact-go

alex.zuliqiaer
2022-04-05 20:31
has joined #pact-go

lflores
2022-04-05 20:33
has joined #pact-go

keoma4
2022-04-05 21:17
has joined #pact-go

erick.belf
2022-04-05 21:46
has joined #pact-go

michaele
2022-04-06 03:40
has joined #pact-go

ancyaziz
2022-04-06 11:47
I am getting this error while running the tests in pact-go: 2022/04/06 17:11:53 [INFO] checking pact-mock-service within range >= 3.5.0, < 4.0.0 2022/04/06 17:11:53 [ERROR] CLI tools are out of date, please upgrade before continuing I have tried to reinstall pact ruby standalone release, but still same error. Can anyone please suggest a resolution?

matt.fellows
2022-04-06 12:00
What happens if you run `pact-mock-service version` in the same terminal you're running the tests?

guillaume.camus
2022-04-06 12:47
has joined #pact-go

ancyaziz
2022-04-06 13:38
3.9.0

guillaume.camus
2022-04-06 13:58
Hi all, I use Pact-go http://v2.XXX. And I try to describe a float number with a matcher like this: ```WithJSONBody(Map{ "id": Integer(21), "name": S("foo 2"), "brand": S("bar 2"), "price_incl_vat": Regex("23.125", "[0-9]+\\.[0-9]+"), "price_excl_tax": Regex("18.185", "[0-9]+\\.[0-9]+"), }).``` but that generates a string and not a float, so when I unmarshal the response I have errors. How I can generate a float ?

guillaume.camus
2022-04-06 14:02
Oh sorry, I found the right matcher, for that. `Decimal`

matt.fellows
2022-04-06 14:10
Yep - you can?t regex a number :wink:

guillaume.camus
2022-04-06 15:56
Is there a command with pact-go to publish contracts in pact-brocker?

danielglazer123
2022-04-06 19:06
has joined #pact-go

ashish.goyal
2022-04-06 23:14
has joined #pact-go

matt.fellows
2022-04-07 01:15
strange

matt.fellows
2022-04-07 01:15
are you positive the go tests are running in the same shell configuration?

matt.fellows
2022-04-07 01:15
You might get more insight with DEBUG level logging

pennellbeth
2022-04-07 08:04
has joined #pact-go

dominic.gara
2022-04-07 08:57
has joined #pact-go

ivan.cheung
2022-04-07 08:58
has joined #pact-go

omrieyal
2022-04-07 08:58
has joined #pact-go

drakulavich
2022-04-07 08:58
has joined #pact-go

ancyaziz
2022-04-07 09:01
I was running the tests from zsh terminal, pact-mock-service version command was not recognized there. I tried the command in bash terminal and the tests also run without error there. The tests used to run in both zsh and bash terminals before, now only running in bash.

jonoar22
2022-04-07 09:06
has joined #pact-go

josh.king
2022-04-07 09:06
has joined #pact-go

matt.fellows
2022-04-07 09:09
that tells me there is a configuration issue in zsh (i use ZSH fwiw)

matt.fellows
2022-04-07 09:09
i?m guessing you added an export to your bash profile, but not your zsh one

ancyaziz
2022-04-07 09:11
yes, that must be correct

ancyaziz
2022-04-07 09:12
let me try to add my export to zsh profile file and try again

ancyaziz
2022-04-07 09:12
thank you so much!!

pitas01_lope
2022-04-07 09:35
has joined #pact-go

rarestomos
2022-04-07 09:40
has joined #pact-go

shuba.paripoornam
2022-04-07 09:59
has joined #pact-go

shivam.kumar
2022-04-07 11:00
has joined #pact-go

dgupta2
2022-04-07 13:26
has joined #pact-go

justin
2022-04-07 19:44
Almost have v2 pact provider verification working in github action, but it's failing to publish for some reason when running in the github action (ubuntu-based) But not when running locally on windows, with manually setting matching environment variables ```Publishing verification results back to the Pact Broker Fetching path '/pacticipants/Notifications' from pact broker Failed to push branch feature/pact-v2 for provider version 1.214.1-a2d64f325200e3b5931ce5e9623041dbd8f50773 Publishing of verification results failed with an error: Error with the content of a HAL resource - Request to pact broker URL 'https://paxi.pactflow.io/pacticipants/Notifications/branches/feature/pact-v2/versions/1.214.1-a2d64f325200e3b5931ce5e9623041dbd8f50773' failed - HTTP status client error (404 Not Found) for url (https://paxi.pactflow.io/pacticipants/Notifications/branches/feature/pact-v2/versions/1.214.1-a2d64f325200e3b5931ce5e9623041dbd8f50773)```

justin
2022-04-07 19:52
It does appear to be auto-escaping the `/` on windows, but not on linux (replaced the / with %2F, and it published.

pankajarora512
2022-04-07 22:50
has joined #pact-go

aruncontacts
2022-04-07 22:54
has joined #pact-go

mira.kim
2022-04-07 23:59
has joined #pact-go

matt.fellows
2022-04-08 00:51
how are you publishing may I ask - using the CLI or the publisher in the Golang code? If the latter, i?d suggest using the CLI - I?m going to deprecate the Golang publisher because it is lacking a number of useful features (tagging, branches, etc.)

alphonse.bendt
2022-04-08 11:44
has joined #pact-go

wim.dupont
2022-04-08 11:49
has joined #pact-go

wilsonmar
2022-04-08 13:41
has joined #pact-go

henit.laxmicant
2022-04-08 14:19
has joined #pact-go

justin
2022-04-08 15:05
I was using the publish built into the golang code.

mateustalles
2022-04-08 17:35
has joined #pact-go

matt.fellows
2022-04-08 22:24
Thanks, that'll be the problem. I can fix that problem but if still highly recommend switching to the CLI

bioflash1
2022-04-11 09:21
has joined #pact-go

stambolaolya
2022-04-11 13:20
has joined #pact-go

souravmalhotra007
2022-04-11 15:56
has joined #pact-go

akshay.nm92
2022-04-11 17:48
has joined #pact-go

luxfactaest
2022-04-11 18:25
has joined #pact-go

cameron.allan
2022-04-12 00:15
has joined #pact-go

kendrickbong1996
2022-04-12 04:12
has joined #pact-go

timothy.osm
2022-04-12 05:16
has joined #pact-go

pact270
2022-04-12 08:53
has joined #pact-go

oytun
2022-04-12 13:12
has joined #pact-go

alessandrovermeulen
2022-04-12 14:00
has joined #pact-go

lucka
2022-04-12 15:25
has joined #pact-go

damon_walker
2022-04-12 15:26
has joined #pact-go

anusha_matti
2022-04-12 18:24
has joined #pact-go

albert.pincevic
2022-04-12 21:48
has joined #pact-go

marcello.rigan335
2022-04-13 12:07
has joined #pact-go

koel.misra
2022-04-13 13:31
has joined #pact-go

johnmichael.bullen
2022-04-13 15:04
has joined #pact-go

wng
2022-04-13 17:54
has joined #pact-go

connor.mcneil
2022-04-13 19:45
has joined #pact-go

henrry.salinas
2022-04-13 20:10
has joined #pact-go

danielflieger
2022-04-14 06:37
has joined #pact-go

jeroen.vandijk
2022-04-14 08:39

jeroen.vandijk
2022-04-14 08:39
the same as the `--provider-version-branch $GIT_BRANCH` in the `provider-verifier` CLI? I think not, as it is not officially supported yet (https://docs.pact.io/pact_broker/branches#support)?

matt.fellows
2022-04-14 09:35
It is, I think that table is out of date. Apologies, I will have it updated.

jeroen.vandijk
2022-04-14 09:50
cool, good news :thumbsup:

elyas.najafizada
2022-04-14 11:01
has joined #pact-go

jeroen.vandijk
2022-04-14 14:37
When using *consumer version selector* `{ "deployedOrReleased": true }` am I right in thinking that when that results in more than one Pact needing to be verified, then the Broker will serve each Pact one at a time and publish back these multiple results back to the broker? All done within a single call to `err = verifier.VerifyProvider(t, provider.VerifyRequest{`?

tasaki
2022-04-14 14:46
has joined #pact-go

jithinjacob2011
2022-04-18 02:43
has joined #pact-go

bkapadia
2022-04-18 17:25
has joined #pact-go

lewiscowles
2022-04-18 19:10
has joined #pact-go

florent
2022-04-19 16:02
has joined #pact-go

b.1.alpha
2022-04-19 18:57
@b.1.alpha has left the channel

testingterrasoft
2022-04-19 19:19
has joined #pact-go

olivia.c
2022-04-19 23:27
has joined #pact-go

testingterrasoft
2022-04-20 14:30
@testingterrasoft has left the channel

ysuei.ygui
2022-04-20 20:42
has joined #pact-go

guillaume.camus
2022-04-21 13:30
Hi, I?m trying to play with `StateHandlers` but I don?t see how I can change the response status code. Do you have an example?

matt.fellows
2022-04-22 00:58
StateHandlers don?t exist to change the response directly from the verification, they exist to setup the internal state of the provider, such that they can return as needed

matt.fellows
2022-04-22 00:58
e.g. if you want a `404` you make sure a resource isn?t in the database vs a `200` where you ensure the resource does exist


guillaume.camus
2022-04-22 07:34
@matt.fellows mmh, Are you sure ? I?m using the pact-go V2 and the StateHandler must return a `ProviderStateV3Response` https://github.com/pact-foundation/pact-go/blob/2.x.x/examples/provider_test.go#L74-L88 My Pb is that _ProviderStateV3Response_ is a map of fields used to generate the response body. But I cannot interact with other parts of the response. And If I return `nil` instead of the ProviderStateV3Response, that doesn?t call my ms. Do you have an example to interact with the database and `ProviderStateV3Response` ?

giuseppe.torchia
2022-04-22 08:25
has joined #pact-go

matt.fellows
2022-04-22 08:46
`StateHandlers` don?t have access to the request/response at all

matt.fellows
2022-04-22 08:47
They are like a hook for a specific test (interaction). They give you the opportunity to modify the internal state of the provider - but don?t give you access to the request/response

matt.fellows
2022-04-22 08:47
(`RequestFilters` can do that, but it?s not really used for this purpose)

matt.fellows
2022-04-22 08:50
> My Pb is that _ProviderStateV3Response_ is a map of fields used to generate the response body no, the `ProviderStateV3Response` is not a response body for the provider test. It?s parameters to configure the current state setup

guillaume.camus
2022-04-22 12:51
ok thank, I understand the point

thadamski
2022-04-22 14:00
has joined #pact-go

druiz
2022-04-22 15:02
has joined #pact-go

tord.brokvist
2022-04-22 15:08
has joined #pact-go

gnanasekar69
2022-04-22 17:23
has joined #pact-go

himanshu.1046
2022-04-24 18:25
has joined #pact-go

edouard.lopez
2022-04-25 08:39
Hello, I'm trying to execute my test on a Ubuntu machine using `pact-go@2.x.x branch`. However, the `pact-go` install command fails ```pact-go -l DEBUG install 2022/04/25 10:40:43 [INFO] package libpact_ffi found 2022/04/25 10:40:43 [DEBUG] unable to determine current version of package libpact_ffi this is probably because the package is currently being installed``` And the `go test` command throws a `ld` related error; ```? go test ./... ? ?/pact-consumer-b2c-example-for-go/cmd/pactgoconsumerexample [no test files] ? ?/pact-consumer-b2c-example-for-go/cmd/pactgoconsumerexample/docs [no test files] # http://github.com/pact-foundation/pact-go/v2/internal/native /usr/bin/ld: cannot find -lpact_ffi collect2: error: ld returned 1 exit status FAIL ?/pact-consumer-b2c-example-for-go/internal/b2b [build failed] FAIL ?/pact-consumer-b2c-example-for-go/internal/b2c [build failed] FAIL```

matt.fellows
2022-04-25 09:11
Have you installed the pact_ffi lib?

chris196
2022-04-25 09:51
has joined #pact-go

manu.vereecken
2022-04-25 11:06
has joined #pact-go

maltechristian.neuman
2022-04-25 11:52
has joined #pact-go

prashanth.ramadass
2022-04-25 14:04
has joined #pact-go

edouard.lopez
2022-04-25 15:05
Yep: ```? ls ~/.local/lib/ libpact_ffi.so```

nuno.frias
2022-04-25 15:10
Hello I am experiencing this issue (2.x.x: Support for Arm64 Architecture) https://github.com/pact-foundation/pact-go/issues/199 I attempted to solve it by pulling the `pact-reference` project (https://github.com/pact-foundation/pact-reference), build it locally following this instructions (https://github.com/pact-foundation/pact-reference) and then copy the compiled `libpact_ffi.dylib` to `/usr/local/lib` -- following the advice in the manual installation instructions https://github.com/pact-foundation/pact-go/blob/2.x.x/README.md#manual Still when I run the tests I get the error:

nuno.frias
2022-04-25 15:10
```# http://github.com/pact-foundation/pact-go/v2/internal/native Undefined symbols for architecture arm64: "_pactffi_cleanup_mock_server", referenced from: __cgo_c5f0653e4b8d_Cfunc_pactffi_cleanup_mock_server in _x004.o (maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_cleanup_mock_server) "_pactffi_create_mock_server", referenced from: __cgo_c5f0653e4b8d_Cfunc_pactffi_create_mock_server in _x004.o (maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_create_mock_server, __cgo_c5f0653e4b8d_Cfunc_pactffi_create_mock_server_for_pact )```

nuno.frias
2022-04-25 15:16
I don't think the `libpact_ffi.dylib` in `/usr/local/lib` is being used -- when I remove that file altogether I get the exact same error.

nuno.frias
2022-04-25 15:17
Any ideas ?


matt.fellows
2022-04-25 22:12
Hmmmm I don't think it can go there

janarthanan.rajendras
2022-04-25 22:35
has joined #pact-go

matt.fellows
2022-04-25 22:42
Hello!

aparnachaudhari
2022-04-25 22:43
Hey hey! how are you

aparnachaudhari
2022-04-25 22:43
one of our service engineers wants to add pact tests for gPRC and wanted to get some updated on this ^

matt.fellows
2022-04-25 22:44
So, I?ve spiked the plugin work and tested protobufs

matt.fellows
2022-04-25 22:44
my colleague (Ron) is currently working on the gRPC transport plugin. that?s getting pretty close

matt.fellows
2022-04-25 22:45
Once these have some good examples in Rust (the core) and Java (the example language) I?ll add support to the API in the v2 interface

shreyas.gowda
2022-04-26 02:14
has joined #pact-go

marxjo
2022-04-26 07:09
has joined #pact-go

andrew.fraser
2022-04-26 07:19
has joined #pact-go

lei.shi
2022-04-26 07:46
has joined #pact-go

nuno.frias
2022-04-26 08:44
Got it sorted.

nuno.frias
2022-04-26 08:50
I need to do a few more tests, but I'll try to submit a merge request to branch https://github.com/pact-foundation/pact-go/tree/2.x.xhttp://2.x.as soon as I can.

edouard.lopez
2022-04-26 09:01
Importing `"http://github.com/pact-foundation/pact-go/v2/sugar"` and running the linter I got this error: ```golangci-lint run --skip-dirs cmd/pactgoconsumerexample_tester WARN [runner] Can't run linter goanalysis_metalinter: inspect: failed to load package sugar: could not load export data: no export data for "http://github.com/pact-foundation/pact-go/v2/sugar" ERRO Running error: 1 error occurred: * can't run linter goanalysis_metalinter: inspect: failed to load package sugar: could not load export data: no export data for "http://github.com/pact-foundation/pact-go/v2/sugar"```

matt.fellows
2022-04-26 09:11
Do you know what a possible remedy is for it?

edouard.lopez
2022-04-26 09:14
nope

matt.fellows
2022-04-26 09:15
Can you please raise an issue? I'll have to investigate

matt.fellows
2022-04-26 09:15
It might be because it only contains aliases


matt.fellows
2022-04-26 11:46
ty

akash.sharma5253
2022-04-26 11:50
has joined #pact-go

kannan.jai
2022-04-27 07:49
has joined #pact-go

edouard.lopez
2022-04-27 09:11
Same error when I ```? sudo cp ~/.local/lib/libpact_ffi.so /usr/local/lib/```

edouard.lopez
2022-04-27 09:15
The issue seem to be with `gotestsum`: ```? gotestsum --junitfile .ignore/report.xml --format standard-verbose -- -count=1 -race -coverprofile=.ignore/coverage.txt -covermode=atomic (go list ./...) ? git.manomano.tech/qraft/contract-testing/pact-consumer-b2c-example-for-go/cmd/pactgoconsumerexample [no test files] ? git.manomano.tech/qraft/contract-testing/pact-consumer-b2c-example-for-go/cmd/pactgoconsumerexample/docs [no test files] # http://github.com/pact-foundation/pact-go/v2/internal/native /usr/bin/ld: cannot find -lpact_ffi collect2: error: ld returned 1 exit status WARN invalid TestEvent: FAIL git.manomano.tech/qraft/contract-testing/pact-consumer-b2c-example-for-go/internal/b2b [build failed] bad output from test2json: FAIL git.manomano.tech/qraft/contract-testing/pact-consumer-b2c-example-for-go/internal/b2b [build failed] WARN invalid TestEvent: FAIL git.manomano.tech/qraft/contract-testing/pact-consumer-b2c-example-for-go/internal/b2c [build failed] bad output from test2json: FAIL git.manomano.tech/qraft/contract-testing/pact-consumer-b2c-example-for-go/internal/b2c [build failed] === Errors /usr/bin/ld: cannot find -lpact_ffi collect2: error: ld returned 1 exit status``` As `pact-go` find the lib ```? pact-go -l DEBUG install 2022/04/27 11:13:48 [INFO] package libpact_ffi found 2022/04/27 11:13:48 [DEBUG] unable to determine current version of package libpact_ffi this is probably because the package is currently being installed```



c.giannakopoulos
2022-04-27 10:47
has joined #pact-go

sebastian.spiess
2022-04-27 11:43
has joined #pact-go

oury.diallo
2022-04-27 13:46
has joined #pact-go

jean.paiva42
2022-04-27 18:58
has joined #pact-go

christoffer.vig
2022-04-28 06:09
has joined #pact-go

andrea.sangiorgio
2022-04-28 13:01
has joined #pact-go

jason.mcinerney
2022-04-28 19:14
has joined #pact-go

psnyder
2022-04-28 19:22
has joined #pact-go

dominique.cote
2022-04-29 01:17
has joined #pact-go

edouard.lopez
2022-04-29 08:59
This issue seems similar, but my lack of acquaintance with `go` is limiting my understanding of the solution https://github.com/golangci/golangci-lint/issues/2280

edouard.lopez
2022-04-29 09:12
It's talking about > can't run linter goanalysis_metalinter: *buildir* while my issue is > can't run linter goanalysis_metalinter: *inspect* Not sure how relevant that is

edouard.lopez
2022-04-29 13:24
@matt.fellows would you mind having a look at https://github.com/golangci/golangci-lint/issues/2788 ? The author of `golangci-lint` mention you are using `CGO` and not `go`

laura.walsh
2022-04-29 13:40
has joined #pact-go

yousafn
2022-04-29 14:38
has joined #pact-go

matt.fellows
2022-04-30 00:02
> The author of `golangci-lint` mention you are using `CGO` and not `go` (edited) we have to use CGO, because we rely on and link to a shared library.

matt.fellows
2022-04-30 00:15
Does the linter not support CGo libraries? :thinking_face:

mailtoadnan.ahmed
2022-04-30 08:56
has joined #pact-go

prasanna.mallisetty
2022-04-30 12:11
has joined #pact-go

marcelo.jaeggi
2022-05-02 16:26
has joined #pact-go

jaswanth.ooty
2022-05-03 00:26
has joined #pact-go

james.weng
2022-05-03 05:13
has joined #pact-go

jochen.kraushaar
2022-05-03 09:16
has joined #pact-go

anurag.soni1984
2022-05-03 10:58
has joined #pact-go

stephen.taylor
2022-05-03 14:26
has joined #pact-go

conrad
2022-05-03 18:41
has joined #pact-go

qamarlonalmeida
2022-05-05 05:24
has joined #pact-go

ben.pilgrim
2022-05-05 10:19
has joined #pact-go

lredpath
2022-05-05 11:21
has joined #pact-go

alex834
2022-05-05 11:26
has joined #pact-go

nachogonzalez
2022-05-05 15:51
has joined #pact-go

mounaouar
2022-05-05 18:00
has joined #pact-go

joanna.schloss
2022-05-06 04:45
has joined #pact-go

frank.kilcommins
2022-05-06 04:46
has joined #pact-go

douglas.clark
2022-05-06 04:46
has joined #pact-go

aaron.m.williams24
2022-05-06 07:50
has joined #pact-go

joanna.janiec
2022-05-06 08:14
has joined #pact-go

tati.shep
2022-05-06 09:58
has joined #pact-go

nicholas.simons
2022-05-06 11:02
has joined #pact-go

matias.cardenas
2022-05-06 13:44
has joined #pact-go

akash.srivastava.1911
2022-05-08 09:38
has joined #pact-go

gustavs.slutins
2022-05-09 11:51
has joined #pact-go

yhiamdan
2022-05-09 13:51
has joined #pact-go

thomas.cederholm
2022-05-09 14:48
has joined #pact-go

rakesh.arrepu
2022-05-09 15:22
has joined #pact-go

abhinavsharma333
2022-05-09 17:44
has joined #pact-go

orbit
2022-05-09 17:57
has joined #pact-go

eric.barrow
2022-05-10 03:50
has joined #pact-go

oprisor.cata24
2022-05-10 09:42
has joined #pact-go

jonathan.rice
2022-05-10 10:50
has joined #pact-go

vijayasaratha.v
2022-05-10 14:28
has joined #pact-go

radhika.madala
2022-05-10 18:10
has joined #pact-go

oscar.lopez
2022-05-10 20:39
has joined #pact-go

johnathan.pestano
2022-05-11 00:43
has joined #pact-go

milda.abromaviciute
2022-05-11 12:47
has joined #pact-go

matiasleandronunez
2022-05-11 13:22
has joined #pact-go

croudet
2022-05-11 14:07
has joined #pact-go

alex.bonstrom
2022-05-11 16:19
has joined #pact-go

cody.sims
2022-05-11 16:45
has joined #pact-go

harii.ravii
2022-05-11 22:02
has joined #pact-go

josh.kilazoglou
2022-05-12 04:17
has joined #pact-go

poojakunder1997
2022-05-12 07:25
has joined #pact-go

pekka.kiviniemi
2022-05-12 10:46
has joined #pact-go

sophie.bosse2
2022-05-12 12:45
has joined #pact-go

dimitris.schizas
2022-05-12 16:04
has joined #pact-go

j.shankarnath
2022-05-12 16:37
has joined #pact-go

yesh.veera
2022-05-12 17:35
has joined #pact-go

fabio.been
2022-05-12 18:04
has joined #pact-go

aliboztemir
2022-05-12 19:47
has joined #pact-go

luis.garcia
2022-05-13 09:06
has joined #pact-go

andreas.wiig
2022-05-13 14:18
has joined #pact-go

ocalderin14
2022-05-13 15:20
has joined #pact-go

jyoti.yennam
2022-05-13 17:28
has joined #pact-go

rberger
2022-05-13 21:06
has joined #pact-go

jsb0545
2022-05-15 18:55
has joined #pact-go

leon.luu2
2022-05-16 06:43
has joined #pact-go

tjones
2022-05-16 08:48
@tjones has left the channel

samikshaphulzele
2022-05-16 09:53
has joined #pact-go

shiva.idc
2022-05-17 00:33
has joined #pact-go

joseph.joyce
2022-05-17 12:15
has joined #pact-go

vasanth.s
2022-05-17 13:36
has joined #pact-go

sri.kasturi
2022-05-17 14:21
has joined #pact-go

carlosh.carmo2
2022-05-17 22:43
has joined #pact-go

gchursov
2022-05-18 09:43
has joined #pact-go

berk.safranbolulu
2022-05-18 10:18
has joined #pact-go

larshoogma
2022-05-18 11:34
has joined #pact-go

malvika0810
2022-05-18 12:17
has joined #pact-go

nishant.shah
2022-05-18 13:38
has joined #pact-go

vorashil.farzaliyev
2022-05-19 10:59
has joined #pact-go

jlcrazzy
2022-05-19 13:38
has joined #pact-go

galveznairon
2022-05-19 13:40
has joined #pact-go

sunny.cheung
2022-05-19 20:43
has joined #pact-go

chantalnitz
2022-05-20 07:22
has joined #pact-go

robert
2022-05-20 08:47
has joined #pact-go

baris.kucuk.atilim
2022-05-20 09:47
has joined #pact-go

rajnavakoti
2022-05-20 12:42
has joined #pact-go

jeroen.vandijk
2022-05-20 13:53
can confirm it works :sunglasses:

mlund
2022-05-20 21:04
has joined #pact-go

matt.fellows
2022-05-21 02:03
Thanks!

pavi.dealwis
2022-05-21 03:28
has joined #pact-go

endika2
2022-05-21 10:52
has joined #pact-go

6eo2ge
2022-05-22 13:17
has joined #pact-go

eugene.baranovsky
2022-05-22 23:25
has joined #pact-go

harris
2022-05-23 03:04
has joined #pact-go

abhiattipra
2022-05-23 06:04
has joined #pact-go

max.bruns
2022-05-23 07:13
has joined #pact-go

hello560
2022-05-23 12:23
has joined #pact-go

venky.hodigere
2022-05-23 14:54
has joined #pact-go

prerit.jain
2022-05-23 16:27
has joined #pact-go

evan
2022-05-23 16:48
has joined #pact-go

manuel.porto
2022-05-23 17:56
has joined #pact-go

abhishek.lamba
2022-05-24 09:25
has joined #pact-go

stefan.friese
2022-05-24 09:32
has joined #pact-go

bharath.shetty
2022-05-24 09:33
has joined #pact-go

rivanitskiy
2022-05-24 14:23
has joined #pact-go

marti92
2022-05-24 21:40
has joined #pact-go

yasarenver
2022-05-25 05:22
has joined #pact-go

brian.quinn
2022-05-25 08:53
has joined #pact-go

jarekrzdbk
2022-05-25 12:45
has joined #pact-go

shaun.mendham
2022-05-25 16:32
has joined #pact-go

plourded
2022-05-25 19:43
has joined #pact-go

emirhan.emmez
2022-05-26 06:31
has joined #pact-go

yasir27uk
2022-05-26 17:56
has joined #pact-go

lcs2019022
2022-05-27 05:27
has joined #pact-go

wieslaw.bondyra
2022-05-27 08:09
has joined #pact-go

rafaelcebulla
2022-05-27 15:20
has joined #pact-go

orbit.mjs
2022-05-27 17:45
has joined #pact-go

msparks
2022-05-27 19:56
has joined #pact-go

falvarez
2022-05-30 14:17
has joined #pact-go

ruslan.ponomarev
2022-05-31 06:28
has joined #pact-go

alexander.maiburg
2022-05-31 07:31
has joined #pact-go

drakulavich
2022-05-31 08:01
@drakulavich has left the channel

aherbst
2022-05-31 17:31
has joined #pact-go

vipul.pachauri
2022-06-01 08:02
has joined #pact-go

komal.sharma1
2022-06-01 08:02
has joined #pact-go

chris169
2022-06-01 11:53
has joined #pact-go

nuno.frias
2022-06-01 15:38
Hello I am hitting an odd issue with my provider tests. Most of the times the Pact test does not run. It hangs after the last entry. ```nunofrias@Nunos-MacBook-Pro entitlement-orchestrator % go test -tags="provider dynamic" -run ^TestEntitlementsOrchestrator$ entitlement-orchestrator/cmd -v === RUN TestEntitlementsOrchestrator 2022/06/01 16:29:45 [INFO] package libpact_ffi found 2022/06/01 16:29:45 [INFO] checking version 0.2.6 for lib libpact_ffi within semver range >= 0.1.2, < 1.0.0 2022/06/01 16:29:45 [INFO] checking version 0.2.6 of libpact_ffi against semver constraint >= 0.1.2, < 1.0.0 2022/06/01 16:29:45 [DEBUG] 0.2.6 satisfies constraints 0.2.6 >= 0.1.2, < 1.0.0 2022/06/01 16:29:45 [DEBUG] version check completed 2022/06/01 16:29:45 [DEBUG] starting new proxy with opts {http localhost:8080 0 [0x1054322c0] /__setup <nil>} 2022/06/01 16:29:45 [DEBUG] starting reverse proxy on port 59826 2022/06/01 16:29:45 [DEBUG] waiting for port 59826 to become available 2022/06/01 16:29:45 [DEBUG] pact provider verification 2022/06/01 16:29:45 [DEBUG] initialising rust mock server interface 2022/06/01 16:29:45 [DEBUG] waiting for port 59826 to become available 2022/06/01 16:29:45 [DEBUG] executing verifier FFI with args [--file /Users/nunofrias/Documents/repos/entitlement-orchestrator/cmd/pacts/reseller-entitlement-service-entitlement-orchestrator.json --hostname localhost --port 59826 --provider-name entitlement-orchestrator --loglevel trace]```


nuno.frias
2022-06-01 15:45
Btw I am using `v2.x.x`

m.shi
2022-06-01 19:07
has joined #pact-go

nuno.frias
2022-06-01 20:11
Some progress regarding the error above. Turns out the issue was in the `libpact_ffi.dylib`

nuno.frias
2022-06-01 20:12
It was not compiled for my platform (I am using Mac M1)

matt.fellows
2022-06-01 21:54
1.x.x should work under rosetta mode (it might actually work without it). The latest version of the 2.x.x works on an M1 (I know, because I fixed and tested it the other day :stuck_out_tongue: )

asa.anudeep4
2022-06-02 04:33
has joined #pact-go

diede
2022-06-02 10:01
has joined #pact-go

nuno.frias
2022-06-02 12:13
Looks like my problem persists. First I followed the automatic install instructions https://github.com/pact-foundation/pact-go/tree/2.x.x#installation ```sudo pact-go -l DEBUG install 2022/06/02 12:36:47 [INFO] package libpact_ffi not found 2022/06/02 12:36:47 [INFO] downloading library from https://github.com/pact-foundation/pact-reference/releases/download/libpact_ffi-v0.1.2/libpact_ffi-osx-aarch64-apple-darwin.dylib.gz to /usr/local/lib/libpact_ffi.dylib 2022/06/02 12:36:49 [INFO] setting install_name on library libpact_ffi for osx 2022/06/02 12:36:49 [DEBUG] output from command [] 2022/06/02 12:36:49 [INFO] package libpact_ffi found 2022/06/02 12:36:49 [DEBUG] unable to determine current version of package libpact_ffi this is probably because the package is currently being installed``` But the binary did not work: ```go test -tags="provider dynamic" -run ^MyTest$ my-service/cmd -v # my-service/cmd.test /opt/homebrew/Cellar/go/1.17.6/libexec/pkg/tool/darwin_arm64/link: running clang failed: exit status 1 ld: 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)``` Then I cloned the latest `pact-reference` project and built it locally ```cd rust cargo clean cargo build``` and copied the `*.dylib` to `/usr/local/lib/` This time it hangs on the last entry: ```2022/06/02 13:09:55 [INFO] package libpact_ffi found 2022/06/02 13:09:55 [INFO] checking version 0.3.3 for lib libpact_ffi within semver range >= 0.1.2, < 1.0.0 2022/06/02 13:09:55 [INFO] checking version 0.3.3 of libpact_ffi against semver constraint >= 0.1.2, < 1.0.0 2022/06/02 13:09:55 [DEBUG] 0.3.3 satisfies constraints 0.3.3 >= 0.1.2, < 1.0.0 2022/06/02 13:09:55 [DEBUG] version check completed 2022/06/02 13:10:21 [DEBUG] starting new proxy with opts {http localhost:8080 0 [0x1036d5910] /__setup <nil>} 2022/06/02 13:10:21 [DEBUG] starting reverse proxy on port 49359 2022/06/02 13:10:21 [DEBUG] waiting for port 49359 to become available 2022/06/02 13:10:21 [DEBUG] pact provider verification 2022/06/02 13:10:21 [DEBUG] initialising rust mock server interface 2022/06/02 13:10:22 [DEBUG] waiting for port 49359 to become available 2022/06/02 13:10:24 [DEBUG] executing verifier FFI with args [--file /Users/nunofrias/Documents/repos/entitlement-orchestrator/cmd/pacts/reseller-entitlement-service-entitlement-orchestrator.json --hostname localhost --port 49359 --provider-name entitlement-orchestrator --loglevel trace] Hangs here !``` Mind you. Sometimes it does work. ```2022/06/02 13:12:05 [DEBUG] executing verifier FFI with args [--file /Users/nunofrias/Documents/repos/entitlement-orchestrator/cmd/pacts/reseller-entitlement-service-entitlement-orchestrator.json --hostname localhost --port 49369 --provider-name entitlement-orchestrator --loglevel trace] Given merchant-entitlement-service create entitlement WARNING: State Change ignored as there is no state change URL provided 2022/06/02 13:12:07 [DEBUG] http reverse proxy received connection from [::1]:49375 on path /entitlements 2022/06/02 13:12:07 [DEBUG] setting proxy to target 2022/06/02 13:12:07 [DEBUG] incoming request /entitlements 2022/06/02 13:12:07 [DEBUG] outgoing request to target http://localhost:8080/entitlements 2022/06/02 13:12:07 [TRACE] proxy outgoing request POST /entitlements HTTP/1.1 Host: localhost:8080 User-Agent: Pact Go Content-Length: 293 Accept: */* Accept-Encoding: gzip, deflate Content-Type: application/json X-Forwarded-For: ::1```

nuno.frias
2022-06-02 12:14
Any ideas ?

mateusz.zaborowski
2022-06-02 17:54
has joined #pact-go

rchord23
2022-06-05 19:30
has joined #pact-go

divya.parameswaran
2022-06-05 20:16
has joined #pact-go

nuno.frias
2022-06-06 00:36
After a bit more debugging I have traced the issue to the rust executable `libpact_ffi`. More precisely the `make_provider_request` function in `http://provider_client.rs` . It hangs when sending the request:

nuno.frias
2022-06-06 00:36
```let response = request.send() .map_err(|err| anyhow!(err)) .and_then(native_response_to_pact_response) .await?;```

alexey.shchukin
2022-06-06 11:46
has joined #pact-go

afang
2022-06-06 22:17
has joined #pact-go

pratish.mp
2022-06-07 00:58
has joined #pact-go

nuno.frias
2022-06-07 08:26
I'll perhaps move this to the #libpact_ffi-users channel. It seems more appropriate.

dasarih
2022-06-08 00:20
has joined #pact-go

benjamhawk
2022-06-08 02:37
has joined #pact-go

sclaros
2022-06-08 13:07
has joined #pact-go

daniel.tjondro
2022-06-08 15:25
has joined #pact-go

slacksync
2022-06-08 17:21
has joined #pact-go

sandro
2022-06-08 18:26
has joined #pact-go

hazem
2022-06-08 23:14
has joined #pact-go

leonardo.lanni
2022-06-09 14:51
has joined #pact-go

jcamilovasquezm
2022-06-10 02:47
has joined #pact-go

markrkell
2022-06-10 08:13
has joined #pact-go

eva-maria.schaller
2022-06-10 08:24
has joined #pact-go

michel.kaporin
2022-06-10 14:43
has joined #pact-go

pooja.sharma4099
2022-06-11 08:39
has joined #pact-go

srinivas.vaddi
2022-06-11 16:31
has joined #pact-go

igor.sharfman
2022-06-12 11:25
has joined #pact-go

nuno.frias
2022-06-13 06:34
Hello all On a consumer test is there a way for me to set an expectation for the metadata? The `.WithMetadata` function only accepts fix values `map[string]string`

nuno.frias
2022-06-13 06:39
I would like to use pact DSL to set the metadata as we have properties on the metadata that are not constants -- namely a timestamp.

chituru.chinwah
2022-06-13 08:48
has joined #pact-go

matt.fellows
2022-06-13 09:08
You should be able to actually. Could you please raise an issue?

cchinwah1
2022-06-13 09:45
has joined #pact-go

nuno.frias
2022-06-13 13:52
Will do it :+1:

negrolyze
2022-06-13 15:14
Hey does anyone know why my linter fails?


negrolyze
2022-06-13 15:14
i have an issue similar to this issue^

julian.alvarezv
2022-06-13 17:10
has joined #pact-go

negrolyze
2022-06-13 17:21
Did we come to a conclusion?

matt.fellows
2022-06-14 04:42
I don?t think so, but I?m going to kill the sugar package anyway

matt.fellows
2022-06-14 04:42
that?s my conclusion :wink:

negrolyze
2022-06-14 07:26
My issue isn't linked to the sugar package but it's something like: ```"[runner] Can't run linter goanalysis_metalinter: buildir: failed to load package native: could not load export data: no export data for \"http://github.com/pact-foundation/pact-go/v2/internal/native\""```

matt.fellows
2022-06-14 07:26
cool. I have no idea what it means on what to do about it, but happy to fix it if you know what it is

matt.fellows
2022-06-14 07:26
I suspect it could be unhappy about it being CGo (we have a native dependency)

negrolyze
2022-06-14 07:27
Yeah i am not entirely sure what it means either but i will take a look.

negrolyze
2022-06-14 07:27
Any ideas on how to debug this?

matt.fellows
2022-06-14 07:28
you could run the linter on a local version of pact go, and remove/change code until it stops complaining

matt.fellows
2022-06-14 07:28
and then you?ll know which bit it doesn?t like

negrolyze
2022-06-14 07:29
the linter doesn't fail locally in my repo, just on the github ci/cd runner

negrolyze
2022-06-14 07:29
but i will clone the pact-go repo and run the linter to see

negrolyze
2022-06-14 08:11
just did this and locally golangci-lint did not complain. Is there a difference between github actions golangci-lint and the local one? I am using the same version

matt.fellows
2022-06-14 08:12
:man-shrugging:

negrolyze
2022-06-14 08:13
So v1.41.1 of golangci-lint works

negrolyze
2022-06-14 08:13
but v1.46.2 does not

matt.fellows
2022-06-14 08:15
I don't use this tool, I'm happy to support a fix but my guess is it's an issue with the linter or it needs Pact Go to be configured with e.g. an ignore rule They'll need a minimal reproducible example to be able to fix tho


negrolyze
2022-06-14 08:22
Currently incrementing each version to see the main culprit

negrolyze
2022-06-14 08:23
and what changes were implemented that affected that

negrolyze
2022-06-14 08:53
V1.42.0 seems to be the last working version with go1.18. After that it fails

negrolyze
2022-06-14 09:23
So the fix was to install pact_go for the ci/cd runner and run the lint

matt.fellows
2022-06-14 09:25
interesting

negrolyze
2022-06-14 09:25
when i put pact_go into a docker image and called that image in the github runner, it worked

matt.fellows
2022-06-14 09:25
which say install, do you mean something like `pact-go install`? or installing the package via `go get` or something?

negrolyze
2022-06-14 09:26
i have both go get and and pact-go install

matt.fellows
2022-06-14 09:26
Perhaps it needs the ffi lib to be on it (e.g `libpact_ffi.so`)

matt.fellows
2022-06-14 09:26
that?s?. bizarre

negrolyze
2022-06-14 09:26
yeah it most likely is the need for a ffi lib

negrolyze
2022-06-14 09:26
i probably don't need both but i added both just so i didn't have to go backwards and forward

negrolyze
2022-06-14 09:26
i will dig deeper

matt.fellows
2022-06-14 09:27
but doing either of the things above you listed doesn?t do that, so that?s fasctinating

matt.fellows
2022-06-14 09:27
great work

malukenho.dev
2022-06-14 14:33
has joined #pact-go

vikki.read
2022-06-14 18:58
has joined #pact-go

omer.khalil
2022-06-14 19:33
has joined #pact-go

rxiao
2022-06-15 04:29
has joined #pact-go

james.demaine373
2022-06-15 10:22
has joined #pact-go

dmoll
2022-06-15 21:10
has joined #pact-go

kurt3402
2022-06-16 04:29
has joined #pact-go

kyo.tang
2022-06-16 06:03
has joined #pact-go

prasadsolanki
2022-06-16 10:58
has joined #pact-go

mairtin.conneely
2022-06-16 12:02
has joined #pact-go

laura.kennedy
2022-06-16 14:32
has joined #pact-go


gaurav.bajpai
2022-06-17 03:41
has joined #pact-go

salmanjamali
2022-06-17 06:49
has joined #pact-go

alansimonalie
2022-06-17 12:57
has joined #pact-go

ben.a.hubbard
2022-06-17 13:47
has joined #pact-go

lafriakh.rachid
2022-06-18 14:24
has joined #pact-go

courtney.lum
2022-06-20 04:02
has joined #pact-go

woojos
2022-06-20 09:58
has joined #pact-go

abdou.ahzab
2022-06-20 10:08
has joined #pact-go

dstekanov.tech
2022-06-20 15:28
has joined #pact-go

rohit.thadhani
2022-06-21 04:39
has joined #pact-go

jvieira
2022-06-21 22:28
has joined #pact-go

marcus.james
2022-06-22 15:28
has joined #pact-go

jonas.pena
2022-06-22 15:50
has joined #pact-go

abudi.hijazi.01
2022-06-22 16:44
has joined #pact-go

vaddisrinivas170497
2022-06-22 18:57
has joined #pact-go

adam.anderson
2022-06-23 03:46
has joined #pact-go

yegorisa
2022-06-23 03:47
has joined #pact-go

swapnil.jagdale
2022-06-23 05:19
has joined #pact-go

mark.mcmurray
2022-06-23 08:33
has joined #pact-go

jacek.maciag
2022-06-23 09:15
has joined #pact-go

sandor.arpa
2022-06-24 09:30
has joined #pact-go

mwilso29
2022-06-24 11:19
has joined #pact-go

mwilso29
2022-06-24 12:34
Hello, can anyone help me with my issue: ```2022/06/24 11:08:29 [INFO] checking pact-mock-service within range >= 3.5.0, < 4.0.0 2022/06/24 11:08:29 [ERROR] CLI tools are out of date, please upgrade before continuing FAIL http://github.com/pact-foundation/pact-workshop-go/consumer/client 0.002s``` When I run "sudo pact-mock-service version" it returns 3.10.0 I am following the https://github.com/pact-foundation/pact-workshop-go/tree/step3 but stuck on the end of step3 and receiving the above issue. Any ideas?

renaud.meurisse
2022-06-24 12:47
has joined #pact-go

matt.fellows
2022-06-25 07:48
is it possible that the version you?ve installed is not on the path that Pact go sees and there as an old version on the path somewhere?

matt.fellows
2022-06-25 07:54
Something like this should put the path of your known correct version as the default ```export PATH="<add folder containing your version here>:${PATH}"``` then `go test ?`

rk8085858
2022-06-26 08:12
has joined #pact-go

alex.savage
2022-06-27 08:26
has joined #pact-go

simon.selvadurai
2022-06-27 08:28
has joined #pact-go

yasir.khan
2022-06-27 11:21
has joined #pact-go

willem.basson
2022-06-27 11:25
has joined #pact-go

edward.francis
2022-06-27 11:32
has joined #pact-go

laura.cabantous
2022-06-27 11:35
has joined #pact-go

ruslan.charuh
2022-06-27 12:18
has joined #pact-go

ringo
2022-06-27 12:49
Hello, does pact-go (v2 beta) work with the standalone rust mock server?

pramod-arjun.bhalerao
2022-06-27 12:54
has joined #pact-go

matt.fellows
2022-06-27 13:07
It doesn?t use the standalone rust server, it uses the FFI lib. Why do you ask?

ringo
2022-06-27 13:15
Curiosity. As far as I?m following up from the sideline, I understood the FFI setup will be phased out, right?

matt.fellows
2022-06-27 13:15
no! Where did you get that impression?

ringo
2022-06-27 13:19
Then the misunderstanding is fully on my side. With moving to rust, I though I once read this would lower the need for FFI. My bad it remained stuck in my head.

ssomepalli
2022-06-27 14:30
has joined #pact-go

owen.oclee.old
2022-06-27 16:13
has joined #pact-go

oherescu
2022-06-27 19:21
has joined #pact-go

matt.fellows
2022-06-27 22:24
Ah, the move to rust is primarily aiming to remove the Ruby core dependency. Is the FFI causing issues for you?

nathan.tejuco
2022-06-28 03:50
has joined #pact-go

jun.ito
2022-06-28 07:47
has joined #pact-go

daniel.shamaeli
2022-06-28 09:01
has joined #pact-go

michael.oloyede
2022-06-28 09:55
has joined #pact-go

matt.fellows
2022-06-28 12:43
Attention Golang users - the latest 2.x.x is out (2.0.0-beta.13)! :rocket: This is quite a big change from the past release, namely I?ve been thinking on the API design with the introduction of V4 and plugins. Summary: ? V4 Pact support ? Support for synchronous messages ? Support for plugins (e.g. for gRPC support https://github.com/pact-foundation/pact-go/tree/2.x.x/examples/grpc) Because the API is more complex, i?ve used a type state builder pattern to force which options can be used at any point in time, and ensure that pre-requisite methods are called in sequence. I?m still not 100% happy with the HTTP package layout (and requiring V2/V3/V4 prefixes on a number of types), so there might be another refactor in that space, but mainly I think it would just be the names of types and packages that could change. I?ll tidy up the documentation over the next few days, but look to the examples folder in the short term if you?re wondering what?s changed. I found refactoring the existing examples fairly straightforward, so I hope you do too. Feedback welcome :pray:

yousafn
2022-06-28 12:50
Epic work Matt :rocket: Is there a couple of reference PR's or commit refs that show the examples change delta, as that would form a great basis for an upgrade guide?

yousafn
2022-06-28 12:51
Looking forward to feedback from our lovely community of go builders!

matt.fellows
2022-06-28 13:02
Could definitely diff between v2.0.0-beta.11 and v2.0.0-beta.14

matt.fellows
2022-06-28 13:02
I have a migration guide from the previous major/stable, which I?ll update over the next few days.

matt.fellows
2022-06-28 13:03
I?m hopeful that with the new API, it should guide the users with the ?next step? and the refactor.

matt.fellows
2022-06-28 13:03
the types say ?ok you can do this next? and in some cases, it?s just one or two options. So once you have the starting point, the code writes itself :wink:

lucas.azzola
2022-06-29 04:18
has joined #pact-go

jens.suhr
2022-06-29 09:25
has joined #pact-go

jens.suhr
2022-06-29 09:26
@jens.suhr has left the channel

thammarith.likittheer
2022-06-29 10:46
has joined #pact-go

guillaume.camus
2022-06-29 13:29
Hi guys, I have errors when I perform tests on the content type. And I don?t understand why! I have this message: ``` 2.1) includes header 'Content-Type' with value 'application/json; charset=utf-8' Expected header 'Content-Type' to have value 'application/json; charset=utf-8' but was 'application/json; charset=utf-8'``` But for me the 2 strings are equal. How can I fix this?

andrevpuc
2022-06-29 14:24
has joined #pact-go

mylesjj
2022-06-29 16:26
has joined #pact-go

matt.fellows
2022-06-30 00:58
strange. Given the error looks obviously confusing, we?re going to need more detail in order to look into this. 1. Logs (ideally at debug or trace level, which will contain the HTTP response from the provider we can inspect) 2. Code - consumer pact

oliviawalsh1
2022-06-30 09:49
has joined #pact-go

ringo
2022-06-30 10:35
I have this near the end of a test I?m trying to write: ``` err = mockProvider.ExecuteTest(t, doTestCreateGithubRepo)``` With this as definition: ```var doTestCreateGithubRepo = func() func(config MockServerConfig) error { return executeTestCreateGithubRepo("foo") }() var executeTestCreateGithubRepo = func(repo string) func(config MockServerConfig) error { ... }``` I would like to have access to `t *testing.T` within `executeTestCreateGithubRepo` for the test logging functions. How can I do that?

matt.fellows
2022-06-30 11:11
I don?t think you need the `doTestCreateGithubRepo` function at all. I think you can just do something like this: ``` err = mockProvider.ExecuteTest(t, executeTestCreateGithubRepo("foo", t))``` and then ```var executeTestCreateGithubRepo = func(repo string, t *testing.T) func(config MockServerConfig) error { ... }```

ringo
2022-06-30 13:20
How should I write that one property in a `Map` is another composite object (not array)? ```WithJSONBody(Map{ "id": Integer(1296269), "node_id": S("MDEwOlJlcG9zaXRvcnkxMjk2MjY5"), "name": S("foo"), "full_name": S("theorg/foo"), "owner": Map{ "login": S("theorg"), }, })``` The above gives me an error on the line where I specify another `Map` for `owner`.

ringo
2022-06-30 13:27
```cannot use (Map literal) (value of type matchers.MapMatcher) as matchers.Matcher value in map literal: matchers.MapMatcher does not implement matchers.Matcher (missing method GetValue)compilerInvalidIfaceAssign```

hiepluong2205
2022-07-01 06:40
has joined #pact-go

saleh.elnagar
2022-07-01 13:20
has joined #pact-go

animesh.kumar
2022-07-03 16:54
has joined #pact-go

omri.benyair
2022-07-04 03:14
has joined #pact-go

chriswilliamsef
2022-07-04 13:11
has joined #pact-go

rioka68
2022-07-04 13:32
has joined #pact-go

heinenm
2022-07-04 14:01
has joined #pact-go

omri.eyal
2022-07-05 06:22
has joined #pact-go

shen-yu
2022-07-05 15:35
has joined #pact-go

ben.foster
2022-07-05 15:42
has joined #pact-go

maarten.gryp
2022-07-05 16:20
has joined #pact-go

matt.fellows
2022-07-05 22:56
If you want to put an object in there, you?ll need to use a more general data structure - e.g. an `map[string]interface{}` as the root object where the values are matchers or nested map structures

megha.t
2022-07-06 06:56
has joined #pact-go

ravindra.dhaka
2022-07-06 07:08
has joined #pact-go

mrigendra.ranjan
2022-07-06 07:08
has joined #pact-go

deepak.bhoria
2022-07-06 07:11
has joined #pact-go

ravindra.dhaka
2022-07-06 07:14
@matt.fellows when i was runing in local machine its working fine but in gitlab ci/cd getting this error ```make consumer #/builds/panamera/fcg/service/dapi/pact/bin run --no-config --deadline=10m --enable=misspell --enable=nakedret --- ?Running Consumer Pact tests go test -count=1 ./consumer/client -run 'TestClientPact' go: finding http://github.com/pact-foundation/pact-go v1.7.1-0.20220627045253-94d333263e43 go: finding http://cloud.google.com/go v0.46.3 go: finding http://github.com/hashicorp/logutils v1.0.0 go: finding http://github.com/hashicorp/go-version v1.5.0 go: finding http://google.golang.org/api v0.13.0 go: finding http://github.com/stretchr/testify v1.7.4 go: finding http://github.com/gorilla/websocket v1.4.2 go: finding http://golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 go: finding http://github.com/stretchr/objx v0.4.0 go: finding http://golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 go: finding http://golang.org/x/text v0.3.3 go: finding http://github.com/gin-gonic/gin v1.7.7 go: finding http://gopkg.in/yaml.v3 v3.0.1 go: finding http://github.com/google/uuid v1.3.0 go: finding http://github.com/klauspost/compress v1.14.2 2022/07/06 05:25:48 [ERROR] service: /builds/panamera/fcg/service/dapi/pact/lib/ruby/bin/ruby: line 6: /builds/panamera/fcg/service/dapi/pact/lib/ruby/bin.real/ruby: No such file or directory 2022/07/06 05:25:58 [ERROR] Expected server to start < 10s. Timed out waiting for Mock Server to start on port 39773 - are you sure it's running? 2022/07/06 05:25:58 [ERROR] client: failed to wait for Mock Server: Expected server to start < 10s. Timed out waiting for Mock Server to start on port 39773 - are you sure it's running? 2022/07/06 05:25:58 Error on Verify: Post http://localhost:39773/interactions: dial tcp 127.0.0.1:39773: connect: connection refused FAIL http://frontiercargroup.org/dealer/consumer/client 10.026s FAIL make: *** [Makefile:221: consumer] Error 1```

ravindra.dhaka
2022-07-06 07:14
MakeFile ```PACT := $(PWD)/pact/bin $(PACT): curl -sfL https://raw.githubusercontent.com/pact-foundation/pact-ruby-standalone/master/install.sh | sh -s -- -b $(GOPATH)/bin .PHONY: pact pact: $(PACT) #$(PACT) run --no-config --deadline=10m --enable=misspell --enable=nakedret .PHONY: consumer consumer: pact @echo "--- ?Running Consumer Pact tests " go test -count=1 ./consumer/client -run 'TestClientPact'```

ravindra.dhaka
2022-07-06 07:15
DockerFile -> i used ```RUN make $GOPATH/bin/pact```

cjenkins
2022-07-06 07:17
has joined #pact-go

gustavo.chain
2022-07-06 08:04
has joined #pact-go

tobias.friedrich
2022-07-06 08:31
has joined #pact-go

ravindra.dhaka
2022-07-06 10:16
@matt.fellows could you pls check this

matt.fellows
2022-07-06 11:41
Just an FYI you don?t need to tag maintainers in the channels - we?re all here and we?ll answer when we can :slightly_smiling_face:

matt.fellows
2022-07-06 11:46
as per the issue you raised, we need some more detail. You mentioned you?re running in docker - have you read https://docs.pact.io/docker ?

matt.fellows
2022-07-06 11:47
have you tried basic debugging within the container, to see if the CLI tools are properly installed?

matt.fellows
2022-07-06 11:47
What other troubleshooting steps have you tried?

ganesh.panchagnula-no
2022-07-06 11:50
has joined #pact-go

morten.gejl
2022-07-06 13:02
has joined #pact-go

varunthaper
2022-07-06 15:17
has joined #pact-go

jwheatley
2022-07-06 17:12
has joined #pact-go

noor.hashem
2022-07-06 20:23
has joined #pact-go

dormeiri
2022-07-07 09:41
has joined #pact-go

andreaschung1
2022-07-07 12:28
has joined #pact-go

ravindra.dhaka
2022-07-07 16:48
@matt.fellows i have diffrent stage on ci/cd pipeline

ravindra.dhaka
2022-07-07 16:49
@matt.fellows can we connect ?.?

parvatshiva
2022-07-07 22:05
has joined #pact-go

jonathan.dowling
2022-07-08 11:37
has joined #pact-go

alex423
2022-07-08 13:59
has joined #pact-go

francis.williams
2022-07-08 19:52
has joined #pact-go

dmitry.sarkisov
2022-07-08 20:07
has joined #pact-go

neokree
2022-07-09 10:50
has joined #pact-go

ravindra.dhaka
2022-07-10 14:41
???

ravindra.dhaka
2022-07-10 17:13
getting below error while running *make consumer* ```/builds/panamera/fcg/service/dapi/pact/lib/ruby/bin/ruby: line 6: /builds/panamera/fcg/service/dapi/pact/lib/ruby/bin.real/ruby: No such file or directory 2022/07/06 05:25:58 [ERROR] Expected server to start < 10s. Timed out waiting for Mock Server to start on port 39773 - are you sure it's running? 2022/07/06 05:25:58 [ERROR] client: failed to wait for Mock Server: Expected server to start < 10s. Timed out waiting for Mock Server to start on port 39773 - are you sure it's running? 2022/07/06 05:25:58 Error on Verify: Post http://localhost:39773/interactions: dial tcp 127.0.0.1:39```

ravindra.dhaka
2022-07-10 17:14
@oherescu

lynn.alhaimy
2022-07-10 18:20
has joined #pact-go

matt.fellows
2022-07-10 21:38
Please stop addressing me directly or any maintainers unless requested. I have been traveling and so have not seen your messages, moreover we will see and respond to any message at our discretion and at a time convenient to us. I have tried to be patient and have asked you several clarifying questions which you've not responded to, including on the several GitHub issues you've raised/commented on. Please answer these first and we'll try to help.

ravindra.dhaka
2022-07-11 05:18
@bethskurrie could pls help me on this

ravindra.dhaka
2022-07-11 05:18
while runing DockerFIle then its giving error

eirikval
2022-07-11 15:08
has joined #pact-go

eirikval
2022-07-11 15:31
Hello pact-go team, this may have been answered somewhere already and my channel and repo search terms may be off-point, but is there a timeline for the v.2.xx.xx release out of beta? I am doing some proof of concept work for my company, work which is moving rapidly. Stability is obviously a priority as we get more serious with it, so v1.xx.xx seems correct for now, but just getting a sense of a timeline for a stable release of v2.xx.xx, at your convenience. Cheers!

srinagasai.krishnasan
2022-07-11 15:37
so @matt.fellows, everything is ready for pact to support grpc for golang, right?

srinagasai.krishnasan
2022-07-11 17:32
is it safe to say that pact can talk over http 2.0?

matt.fellows
2022-07-12 03:33
> is it safe to say that pact can talk over http 2.0? It depends on what you mean by that

matt.fellows
2022-07-12 03:33
> , everything is ready for pact to support grpc for golang, right? There is a beta branch (2.x.x) that is ready for testing, yes. There will likely be some API changes as we smooth it out, but the gRPC support is there and there is an example project you can base off

2022-07-12 08:24
This message was deleted.

sahil.jain
2022-07-12 10:21
has joined #pact-go

guillaume.camus
2022-07-12 12:55
hello, I made this request : ```curl --location --request GET 'http://localhost:8080/api/v1/product/21' -vvv Note: Unnecessary use of -X or --request, GET is already inferred. * Trying ::1:8080... * Connected to localhost (::1) port 8080 (#0) > GET /api/v1/product/21 HTTP/1.1 > Host: localhost:8080 > User-Agent: curl/7.77.0 > Accept: */* > * Mark bundle as not supporting multiuse < HTTP/1.1 200 OK < Content-Type: application/json; charset=utf-8 < Date: Tue, 12 Jul 2022 12:51:27 GMT < Content-Length: 88 < * Connection #0 to host localhost left intact {"id":21,"name":"foo 2","brand":"bar 2","price_incl_vat":23.125,"price_excl_tax":20.125}% ```

guillaume.camus
2022-07-12 13:00
@matt.fellows And here with TRACE, ```Verifying a pact between ms.pact-consumer-example-for-go.b2c and ms.pact-provider-example-for-go Given The product with ID 21 exists 2022/07/12 14:50:46 [INFO] executing state handler middleware 2022/07/12 14:50:46 [TRACE] state handler received raw input {"action":"setup","params":{},"state":"The product with ID 21 exists"} 2022/07/12 14:50:46 [TRACE] state handler parsed input (without params) {setup The product with ID 21 exists map[]} 2022/07/12 14:50:46 [TRACE] state handler completed parsing input (with params) {setup The product with ID 21 exists map[params:map[]]} 2022/07/12 14:50:46 [TRACE] skipping state handler for request /api/v1/product/21 2022/07/12 14:50:46 [DEBUG] http reverse proxy received connection from [::1]:54332 on path /api/v1/product/21 2022/07/12 14:50:46 [DEBUG] setting proxy to target 2022/07/12 14:50:46 [DEBUG] incoming request /api/v1/product/21 2022/07/12 14:50:46 [DEBUG] outgoing request to target http://localhost:8080/api/v1/product/21 2022/07/12 14:50:46 [TRACE] proxy outgoing request GET /api/v1/product/21 HTTP/1.1 Host: localhost:8080 User-Agent: Pact Go Accept: */* Accept-Encoding: gzip, deflate X-Forwarded-For: ::1 2022/07/12 14:50:46 [TRACE] proxied server response HTTP/1.1 200 OK Content-Length: 88 Content-Type: application/json; charset=utf-8 Date: Tue, 12 Jul 2022 12:50:46 GMT {"id":21,"name":"foo 2","brand":"bar 2","price_incl_vat":23.125,"price_excl_tax":20.125} 2022/07/12 14:50:46 [INFO] executing state handler middleware 2022/07/12 14:50:46 [TRACE] state handler received raw input {"action":"teardown","params":{},"state":"The product with ID 21 exists"} 2022/07/12 14:50:46 [TRACE] state handler parsed input (without params) {teardown The product with ID 21 exists map[]} 2022/07/12 14:50:46 [TRACE] state handler completed parsing input (with params) {teardown The product with ID 21 exists map[params:map[]]} Given The product with ID 66 doesn't exists 2022/07/12 14:50:46 [INFO] executing state handler middleware 2022/07/12 14:50:46 [TRACE] state handler received raw input {"action":"setup","params":{},"state":"The product with ID 66 doesn't exists"} 2022/07/12 14:50:46 [TRACE] state handler parsed input (without params) {setup The product with ID 66 doesn't exists map[]} 2022/07/12 14:50:46 [TRACE] state handler completed parsing input (with params) {setup The product with ID 66 doesn't exists map[params:map[]]} 2022/07/12 14:50:46 [WARN] no state handler found for state: The product with ID 66 doesn't exists 2022/07/12 14:50:46 [TRACE] skipping state handler for request /api/v1/product/66 2022/07/12 14:50:46 [DEBUG] http reverse proxy received connection from [::1]:54336 on path /api/v1/product/66 2022/07/12 14:50:46 [DEBUG] setting proxy to target 2022/07/12 14:50:46 [DEBUG] incoming request /api/v1/product/66 2022/07/12 14:50:46 [DEBUG] outgoing request to target http://localhost:8080/api/v1/product/66 2022/07/12 14:50:46 [TRACE] proxy outgoing request GET /api/v1/product/66 HTTP/1.1 Host: localhost:8080 User-Agent: Pact Go Accept: */* Accept-Encoding: gzip, deflate X-Forwarded-For: ::1 2022/07/12 14:50:46 [TRACE] proxied server response HTTP/1.1 404 Not Found Content-Length: 2 Content-Type: application/json; charset=utf-8 Date: Tue, 12 Jul 2022 12:50:46 GMT {} 2022/07/12 14:50:46 [INFO] executing state handler middleware 2022/07/12 14:50:46 [TRACE] state handler received raw input {"action":"teardown","params":{},"state":"The product with ID 66 doesn't exists"} 2022/07/12 14:50:46 [TRACE] state handler parsed input (without params) {teardown The product with ID 66 doesn't exists map[]} 2022/07/12 14:50:46 [TRACE] state handler completed parsing input (with params) {teardown The product with ID 66 doesn't exists map[params:map[]]} 2022/07/12 14:50:46 [WARN] no state handler found for state: The product with ID 66 doesn't exists a request Product 21 returns a response which has status code 200 (OK) includes headers "Content-Type" with value "application/json; charset=utf-8" (FAILED) has a matching body (OK) a request Product 66 returns a response which has status code 404 (OK) includes headers "Content-Type" with value "application/json; charset=utf-8" (FAILED) has a matching body (OK)```

kyriacos.elia
2022-07-12 15:43
has joined #pact-go

nuno.frias
2022-07-12 16:24
Hi all, In `Pact-jvm` you have the option to define different matching rules for an attribute using the OR condition. I have recently gone through the rust codebase of the `libpact_ffi` library which is used by pact-go and I didn't see any support for `OR` matching rules, at least for Pact V3 and V4. Is there any plan to introduce this feature? This is kind of useful as i have to deal with some cases when an attribute may be null, but if it isn't it must obey a certain regex.

fabricio.mendes.ti
2022-07-12 16:33
has joined #pact-go

cameron.allan853
2022-07-12 23:18
has joined #pact-go

matt.fellows
2022-07-13 02:52
No, OR is really not recommended and will not be supported in other languages. See the docs for why we don't support optional attributes

matt.fellows
2022-07-13 02:54
You're downloading an OSX package z are you running on OSX?

matt.fellows
2022-07-13 02:54
Next couple of months. API is almost stable and any changes will be fairly minor leading into the major release

matt.fellows
2022-07-13 02:55
Can't give exact dates, but I'd recommended not using 1.x.x right now. Most future investment will be in the V2 line

eirikval
2022-07-13 04:48
Thanks Matt, I really appreciate it and the work you all have put into it.

ravindra.dhaka
2022-07-13 06:05
when i am running on git pipeline then its failing

ravindra.dhaka
2022-07-13 06:07
@bethskurrie @matt.fellows ```FROM alpine:3.5 AS base RUN apk update && \ apk add --no-cache \ bc \ ruby \ ruby-bigdecimal \ ruby-bundler \ ruby-io-console \ libressl \ ca-certificates \ python3 \ g++ \ curl \ git \ make \ gcc \ nodejs \ openssl \ tzdata RUN rm -rf /var/lib/apt/lists/* RUN mkdir -p /srv/app RUN mkdir -p $GOPATH/bin/pact WORKDIR /srv/app FROM golang:1.16.6-alpine3.13 AS build-env RUN apk add --no-cache \ bc \ ca-certificates \ python3 \ g++ \ curl \ git \ make \ less \ groff \ gcc \ bash \ nodejs \ nodejs-npm \ openssl \ tzdata \ openssl \ tzdata RUN curl -fsSL https://raw.githubusercontent.com/pact-foundation/pact-ruby-standalone/master/install.sh | sh -s -- -b $(GOPATH)/bin # RUN curl -LO https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v1.88.78/pact-1.88.78-linux-x86_64.tar.gz; \ # tar xzf pact-1.88.78-linux-x86_64.tar.gz; \ # rm pact-1.88.78-linux-x86_64.tar.gz RUN apk add --no-cache openssh RUN apk add --no-cache --virtual build-dependencies build-base RUN apk --no-cache add ca-certificates wget bash \ && wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub \ && wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.29-r0/glibc-2.29-r0.apk \ && apk add glibc-2.29-r0.apk SHELL ["/bin/bash", "-c"] RUN go get http://golang.org/x/tools/cmd/cover ENV CGO_ENABLED=0 ENV GO111MODULE=on RUN curl -LO https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v1.88.78/pact-1.88.78-linux-x86_64.tar.gz; \ tar -C /usr/local -xzf pact-1.88.78-linux-x86_64.tar.gz; \ rm pact-1.88.78-linux-x86_64.tar.gz ENV PATH /usr/local/pact/bin:$PATH ```

ravindra.dhaka
2022-07-13 06:07
my DockerFile

ravindra.dhaka
2022-07-13 06:09
when i am printing the os name in pipeline ```$ go version go version go1.13.1 linux/amd64 $ uname -a Linux runner-zq4mqcga-project-21507-concurrent-0 4.15.0-1057-aws #59-Ubuntu SMP Wed Dec 4 10:02:00 UTC 2019 x86_64 Linux $ go mod vendor $ echo $GOPATH /go $ echo $pwd```

ravindra.dhaka
2022-07-13 06:10
its `Linux runner-zq4mqcga-project-21507-concurrent-0 4.15.0-1057-aws #59-Ubuntu SMP Wed Dec 4 10:02:00 UTC 2019 x86_64 Linux`

jeroen.lamain
2022-07-13 08:49
has joined #pact-go

programmingwithbangal
2022-07-13 12:48
has joined #pact-go

rohitkeshwani07
2022-07-13 13:28
has joined #pact-go

nuno.frias
2022-07-13 18:09
Thank you :+1:

gjvengelen
2022-07-13 18:18
has joined #pact-go

lorenz.ammon
2022-07-14 08:52
has joined #pact-go

remigijus.mazulis
2022-07-14 08:53
has joined #pact-go

seanruffatti
2022-07-14 14:40
has joined #pact-go

matt.fellows
2022-07-14 20:38
I just built and ran that docker container, and the binary runs fine. Please update your issues with step by step instructions that reproduce the problem ```docker run -it --rm --entrypoint bash test-pact bash-5.1# /usr/local/pact/bin/pact-broker /usr/local/pact/lib/ruby/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/shared_helpers.rb:78: warning: Insecure world writable dir /go/bin in PATH, mode 040777 Commands: pact-broker can-i-deploy -a, --pacticipant=PACTICIPANT -b, --broker-base-url=BROKER_BASE_URL # pact-broker create-environment --name=NAME -b, --broker-base-url=BROKER_BASE_URL # Create an environment resource in the Pact Broker to represent a real world deployment o... pact-broker create-or-update-pacticipant --name=NAME -b, --broker-base-url=BROKER_BASE_URL # Create or update pacticipant by name pact-broker create-or-update-webhook URL --uuid=UUID -X, --request=METHOD -b, --broker-base-url=BROKER_BASE_URL # Creates or updates a webhook with a provided uuid and using the same switches as a curl ... pact-broker create-version-tag -a, --pacticipant=PACTICIPANT -b, --broker-base-url=BROKER_BASE_URL -e, --version=VERSION # Add a tag to a pacticipant version pact-broker create-webhook URL -X, --request=METHOD -b, --broker-base-url=BROKER_BASE_URL # Creates a webhook using the same switches as a curl request. pact-broker delete-environment --uuid=UUID -b, --broker-base-url=BROKER_BASE_URL # Delete an environment pact-broker describe-environment --uuid=UUID -b, --broker-base-url=BROKER_BASE_URL # Describe an environment pact-broker describe-pacticipant --name=NAME -b, --broker-base-url=BROKER_BASE_URL # Describe a pacticipant pact-broker describe-version -a, --pacticipant=PACTICIPANT -b, --broker-base-url=BROKER_BASE_URL # Describes a pacticipant version. If no version or tag is specified, the latest version i... pact-broker generate-uuid # Generate a UUID for use when calling create-or-update-webhook pact-broker help [COMMAND] # Describe available commands or one specific command pact-broker list-environments -b, --broker-base-url=BROKER_BASE_URL # List environments pact-broker list-latest-pact-versions -b, --broker-base-url=BROKER_BASE_URL # List the latest pact for each integration pact-broker list-pacticipants -b, --broker-base-url=BROKER_BASE_URL # List pacticipants pact-broker publish PACT_DIRS_OR_FILES ... -a, --consumer-app-version=CONSUMER_APP_VERSION -b, --broker-base-url=BROKER_BASE_URL # Publish pacts to a Pact Broker. pact-broker record-deployment --environment=ENVIRONMENT -a, --pacticipant=PACTICIPANT -b, --broker-base-url=BROKER_BASE_URL -e, --version=VERSION # Record deployment of a pacticipant version to an environment. See https://docs.pact.io/g... pact-broker record-release --environment=ENVIRONMENT -a, --pacticipant=PACTICIPANT -b, --broker-base-url=BROKER_BASE_URL -e, --version=VERSION # Record release of a pacticipant version to an environment. See See https://docs.pact.io/... pact-broker record-support-ended --environment=ENVIRONMENT -a, --pacticipant=PACTICIPANT -b, --broker-base-url=BROKER_BASE_URL -e, --version=VERSION # Record the end of support for a pacticipant version in an environment. See https://docs.... pact-broker record-undeployment --environment=ENVIRONMENT -a, --pacticipant=PACTICIPANT -b, --broker-base-url=BROKER_BASE_URL # Record undeployment of a pacticipant from an environment. pact-broker test-webhook --uuid=UUID -b, --broker-base-url=BROKER_BASE_URL # Test the execution of a webhook pact-broker update-environment --uuid=UUID -b, --broker-base-url=BROKER_BASE_URL # Update an environment resource in the Pact Broker. pact-broker version # Show the pact_broker-client gem version```

matt.fellows
2022-07-14 20:39
Also please, final warning - do not `@` any body unless prior requested. We monitor the channels as best we can, an additional notification is not going to get a faster response

nico.neirinck
2022-07-15 06:10
has joined #pact-go

k.bangarusamy
2022-07-15 14:36
has joined #pact-go

harinder.kaur
2022-07-15 17:19
has joined #pact-go

mahidasp
2022-07-16 17:30
has joined #pact-go

juan.aa.espiritu
2022-07-17 08:39
has joined #pact-go

thomas.loudon
2022-07-18 11:05
has joined #pact-go

david.hayden
2022-07-18 11:12
has joined #pact-go

hakan.b.jansson
2022-07-18 14:04
has joined #pact-go

jakehowden
2022-07-18 15:54
has joined #pact-go

remigijus.mazulis
2022-07-19 09:18
@remigijus.mazulis has left the channel

chrstnklb
2022-07-19 10:58
has joined #pact-go

andrew.favaloro
2022-07-19 19:36
has joined #pact-go

tarun.gulati1988
2022-07-19 19:41
has joined #pact-go

boweixu
2022-07-19 20:39
has joined #pact-go

juanalvarezarquillos
2022-07-20 05:46
has joined #pact-go

jkaur
2022-07-20 06:32
has joined #pact-go

steve.heasman
2022-07-20 09:08
has joined #pact-go

je.alvinez
2022-07-20 11:17
has joined #pact-go

je.alvinez
2022-07-20 11:51
hi pact-go team, apologies for the long question. thanks in advance for your help! :pray: i've upgraded my `pact-go` to `v2.0.0-beta.14` and updated my consumer test to use Pact V4 such as replacing `NewV3Pact()` with `NewV4Pact()`. i understand that Pact V4 adds a `key`https://github.com/pact-foundation/pact-specification/tree/version-4#interactions and its value seems to be some hash when i looked at its value in the pact generated when i ran my test. i'm guessing the hash is calculated using the `description`, `provider_states`, `request`, `response` and `pending` fields in https://github.com/pact-foundation/pact-reference/blob/9d30a4411dfab9f0993070ef34d2ea8bf8d28a6d/rust/pact_models/src/v4/synch_http.rs#L397 i ran my consumer test several times without changing the interactions. when i inspected the value of the `key` field in the pact file generated, i was surprised to see that its value changes between runs. should its value stay the same instead since the pact didn't change? the pact broker thinks my consumer published a new pact, but it shouldn't be the case since i just generated again the same pact and published it without changing anything. i've attached a snippet of my simplified setup of the mock provider with interactions in this thread for reference.

je.alvinez
2022-07-20 11:55
when i tried removing the 3rd argument (request builder func) from `WithRequestPathMatcher()`, the `key` field's value in the pact generated stayed the same between runs though. but this is not an option for me since i need that 3rd argument :sweat_smile:

matkruse
2022-07-20 14:53
has joined #pact-go

2billy
2022-07-20 16:56
has joined #pact-go

matt.fellows
2022-07-20 22:21
Haha well it's expected to be used! Are you using any dynamic values, E.g. in the bearer token?

matt.fellows
2022-07-20 22:21
If the values change I could see why that would impact the hash

je.alvinez
2022-07-20 23:22
hey Matt! thanks for the reply. i'm not using any dynamic values in any of the matchers in the request builder of the interaction. for instance, the bearer token is set to just a constant string as in the snippet above :sweat_smile: when i compared the generated pact json files between test runs, it's only the `key` value that's different. everything else is the same :sob:

matt.fellows
2022-07-20 23:44
If you could please raise an issue that reproduces the problem we can look into it

je.alvinez
2022-07-20 23:50
i'll do this Matt. thanks! :pray:

christopher.forbes
2022-07-21 09:27
has joined #pact-go

tarun.gulati1988
2022-07-21 18:49
Hey :wave: We are trying to use pact for creating contracts for kinesis events, the consumer listens for proto?s that are sent through. We are creating matchers using similar code as below: ```WithContent(map[string]interface{}{ "moneyToMove": term(), }).WithType(&myproto.MyProtoName)``` The issue we are running into is that the unmarshaller is not able to unmarshal to proto types. Is there some methods that can be overriden to achieve this? The error that we end up getting is: ```VerifyMessageConsumer failed: unable to narrow type to : json: cannot unmarshal string into Go struct field myproto.created_at of type timestamppb.Timestamp```

sandy.oberoi
2022-07-21 18:57
has joined #pact-go

adelamarre
2022-07-21 19:37
has joined #pact-go

matt.fellows
2022-07-21 23:30
We actually do support protobufs in the latest https://github.com/pact-foundation/pact-go/tree/2.x.x version. However I don?t have an example there for you yet (the gRPC is probably closest, if that?s what you need).

matt.fellows
2022-07-21 23:30
You can?t specify a custom unmarshaller, because we use a shared core that needs to be aware of it.

matt.fellows
2022-07-21 23:31
Support is via plugins, and specifically this https://github.com/pactflow/pact-protobuf-plugin/

sandy.oberoi
2022-07-22 00:17
thanks, we can look into integrating with 2.x.x. For our use-case we do not need gRPC as the events flow through kinesis

matt.fellows
2022-07-22 00:34
sorry, you did say kinesis - did I mention I just got back to Australia after a trip to US (aka I?m blaming jetlag :laughing: )

husamhindustani
2022-07-22 06:52
has joined #pact-go

sandy.oberoi
2022-07-22 14:29
it seems we need the proto file to be available with this new approach. in our case we have the proto schema in a central place which is responsible for generating the models. in the project we just import the generated models. Also, the proto message refers to types in other proto files, not sure how to provide this to the plugin. Any guidance on how to work with this setup?

harley
2022-07-23 02:15
has joined #pact-go

matt.fellows
2022-07-25 00:32
At this stage we need the proto file at test time. I think tools exist to resolve references (e.g. buf.build). Could you download from the central place?

japlavaren
2022-07-25 09:21
has joined #pact-go

alasdair.ryan
2022-07-25 10:45
has joined #pact-go

je.alvinez
2022-07-25 13:10
created https://github.com/pact-foundation/pact-go/issues/230. please let me know if you have any concerns about it. thanks! again! :pray:

hui.supat
2022-07-25 13:22
has joined #pact-go

balaramvineethvenugop
2022-07-25 17:06
has joined #pact-go

alan.still
2022-07-25 18:18
has joined #pact-go

sandy.oberoi
2022-07-25 19:48
thanks for the suggestion. We can download the proto files. Will look into other suggestion as well

yshkedi
2022-07-25 21:16
has joined #pact-go

apapia
2022-07-26 02:27
has joined #pact-go

matt.fellows
2022-07-26 03:20
Thanks - let us know how you go!

matt.fellows
2022-07-26 03:47
that?s great, thank you!

rziembicki
2022-07-26 10:47
has joined #pact-go

dpal
2022-07-26 10:58
has joined #pact-go

dgrace
2022-07-26 11:02
has joined #pact-go

dgowdappa
2022-07-26 11:02
has joined #pact-go

mwilso29
2022-07-26 14:20
Hey does anyone know how to set the port for the mock server during the pact setup in golang?

negrolyze
2022-07-26 15:23
i am having issues intsalling pact-go on my m1 mac

sascha_pactflow
2022-07-26 20:29
has joined #pact-go

hunsolitude
2022-07-26 22:34
has joined #pact-go

matt.fellows
2022-07-26 22:47
It definitely works on M1 (I have one)

matt.fellows
2022-07-26 22:47
what?s the issue?

matt.fellows
2022-07-26 22:47
Are you running Rosetta or standard?

matt.fellows
2022-07-26 22:48
In the 1.x.x branch you can set `AllowedMockServerPorts` but really it?s best practice to have it set dynamically (https://github.com/pact-foundation/pact-go/blob/master/dsl/pact.go#L88)


maksym_odanets
2022-07-27 08:07
has joined #pact-go

andrew.january
2022-07-27 09:03
has joined #pact-go

davidf
2022-07-27 09:17
has joined #pact-go

mwilso29
2022-07-27 12:38
So our issue is that we are trying to run the pact mock server on a function that exists in a different package so we don't have access to the client object within that other package. What would be the best practice there? In the example here https://github.com/pact-foundation/pact-workshop-go/blob/step3/consumer/client/client.go the client.go and test file are within the same package so the baseurl of the mock service can be passed into it easily.

mwilso29
2022-07-27 12:41
The function in the different package allows a string and a jwt value and we call a get httprequest within it. So we would look to update that URL to be the baseurl from the pact mock server. We are trying to hardcode the URL for POC testing but obviously having issues if we don't know which port it is going to be ran on

matt.fellows
2022-07-27 12:55
If you?re new to Pact, i?d look start straight away with the 2.x.x package, which is almost stable. You can specify a port in that.

matt.fellows
2022-07-27 12:55
Or you can used the `AllowedMockServerPorts` and just pass a single port for the 1.x.x

ankit.mittal
2022-07-28 10:00
has joined #pact-go

vishal.kukreja
2022-07-28 10:22
has joined #pact-go

mwilso29
2022-07-28 12:52
The AllowedMockServerPorts does not work - when we set this it still selects a random port

mwilso29
2022-07-28 12:52
```func createPact() dsl.Pact { return dsl.Pact{ Consumer: "car_config", Provider: "vehicle_targeting", LogDir: "/home/mwilso29/git/car-configuration/tests/contract/consumer/logs", PactDir: "/home/mwilso29/git/car-configuration/tests/contract/consumer/pacts", LogLevel: "INFO", Host: "localhost", AllowedMockServerPorts: "8111", } }```

mwilso29
2022-07-28 12:52
I will take a look at the 2.x.x package now

hazem
2022-07-28 17:40
Question about 2.x.x. I'm trying out the latest beta and was wondering how to configure the `PactLogDir` for a provider verification. In the latest 1.7, the field is on `VerifyRequest` Is this still configurable?

robert.henzel
2022-07-28 19:50
has joined #pact-go

robert.henzel
2022-07-28 19:53
Hey I'm using pact v2.x.x to write a contract test between two of my grpc services. Andfor consumer get such error: ```=== RUN TestGrpcInteraction 2022/07/28 21:46:13 [DEBUG] pact synchronous message validate config 2022/07/28 21:46:13 [DEBUG] initialising rust mock server interface 2022/07/28 21:46:13 [DEBUG] log_to_stdout res 0 proto: /home/robert/go/src/giltab.elona.com/elona/dev/rosi/module/card/pact_tests/consumer_tests/../../../secure/pb/service_modulesecure.proto 2022-07-28T19:46:13.789357Z ERROR ThreadId(01) pact_ffi::mock_server::handles: Interaction 0x10001 is not a message interaction, it is V4 Synchronous/Messages 2022-07-28T19:46:14.410508Z ERROR ThreadId(01) pact_ffi::plugins: Failed to call out to plugin - Request to configure interaction failed: Failed to process protobuf: Failed to invoke protoc binary: exit code exit status: 1 2022-07-28T19:46:14.411990Z ERROR ThreadId(01) pactffi_create_mock_server_for_transport{pact=PactHandle { pact_ref: 1 } addr=0x2248e10 port=0 transport=0x2248df0 transport_config=0x2248dd0}: pact_ffi::mock_server: Failed to start mock server - Mock server failed to start: Failed to start gRPC mock server: Pact file does not contain any Protobuf descriptors 2022/07/28 21:46:14 unable to start plugin transport: unable to start the mock server FAIL command-line-arguments 0.628s FAIL``` is it because the .proto file is not reachable when I do ```cat /home/robert/go/src/giltab.elona.com/elona/dev/rosi/module/card/pact_tests/consumer_tests/../../../secure/pb/service_modulesecure.proto ``` it prints the protofile.

matt.fellows
2022-07-28 22:57
There is no option to log to file in the 2.x.x line, hence why that field doesn?t exist

matt.fellows
2022-07-28 22:58
> Failed to invoke protoc binary: exit code exit status: 1 I?m not sure if this is the cause, but it seems to not be able to run the `protoc` binary.

matt.fellows
2022-07-28 22:58
There should also be logginsg at the plugin level that may indicate what is going on.

matt.fellows
2022-07-28 22:59
In your ~/.pact/plugins directory there should be the installed protobuf plugin. Please double check the permissions there and ensure the binary can run.

matt.fellows
2022-07-28 22:59
The framework attempts to automatically install protoc if it doesn?t exist, this may have failed also

robert.henzel
2022-07-29 06:37
Funny thing happend. When I regenerated the proto file with name `servicemodulesecure.proto` instead of `service_modulesecure.proto` I could reach it and the `protoc` binary was invoked. At first I thought that it cannot parse `_` from path but after I changed it back to `service_modulesecure.proto` it alswo worked. :confused: Edit: I think the permissions are all right because I was able to run the tests from `pact-go/examples/grpc` directory without problems.

adrianminnock123
2022-07-29 08:53
has joined #pact-go

adam.witko
2022-07-29 09:38
@adam.witko has left the channel

massimiliano.devivo
2022-07-29 12:12
has joined #pact-go

robert.henzel
2022-07-29 12:13
What if a providers grpc handler calls another grpc method (provider is a consumer here e.g crypt service). How can I test provider in that case. Right now I have it mocked but it does not work.

robert.henzel
2022-07-29 12:14
```1) Verifying a pact between module-card and module-secure - Secure Module - GetSecureDetails - Verification failed with an error - Failed to verify the request: transport error There were 1 pact failures === RUN TestGrpcProvider/Provider_pact_verification plugin_verifier.go:56: the verifier failed to successfully verify the pacts, this indicates an issue with the provider API === CONT TestGrpcProvider get_card_secure_details_test.go:129: Error Trace: get_card_secure_details_test.go:129 Error: Received unexpected error: the verifier failed to successfully verify the pacts, this indicates an issue with the provider API Test: TestGrpcProvider controller.go:269: missing call(s) to *mock_pb.MockHsmModuleServiceClient.DecryptPin(is anything, is equal to pinBlock:"567891234567" pan:"1234567891234567" keyGroup:"visa" (*modulehsm.DecryptPinRequest)) /home/robert/go/src/gitlab.elona.com/elona/dev/rosi/module/secure/pact_tests/provider_tests/get_card_secure_details_test.go:81 controller.go:269: aborting test due to missing call(s) --- FAIL: TestGrpcProvider (10.51s) --- FAIL: TestGrpcProvider/Provider_pact_verification (0.00s) FAIL```

matt.fellows
2022-07-29 12:27
The failure seems to be because your code is not calling the downstream service, which is currently mocked. I can't say much more because I don't know your code, but mocking/stubbing is totally reasonable here and is what I'd recommend

guillaume.camus
2022-07-29 13:43
hi, when i try to install pact with `pact-go -l DEBUG install` , I have some errors ```2022/07/29 13:40:25 [INFO] package libpact_ffi not found 2022/07/29 13:40:25 [INFO] downloading library from https://github.com/pact-foundation/pact-reference/releases/download/libpact_ffi-v0.3.2/libpact_ffi-linux-x86_64.so.gz to /usr/local/lib/libpact_ffi.so 2022/07/29 13:40:27 [ERROR] Your Pact library installation is out of date and we were unable to download a newer one for you: open /usr/local/lib/libpact_ffi.so: permission denied make: *** [Makefile:13: install] Error 1 ``` How I could fix this ?

robert.henzel
2022-07-29 14:32
you have to change the permissions of /usr/local/lib/libpact_ffi.so file

robert.henzel
2022-07-29 14:33
I 'have changed owner of this file with chown

hareesh.dj
2022-07-30 12:01
has joined #pact-go

heera
2022-07-31 08:00
has joined #pact-go

adam.redlisiak
2022-08-01 10:18
has joined #pact-go

altan.demirkiran846
2022-08-01 14:38
has joined #pact-go

nick080
2022-08-01 14:44
has joined #pact-go

ali.ustek
2022-08-01 15:09
has joined #pact-go

adam.redlisiak
2022-08-01 15:56
@adam.redlisiak has left the channel

momarquez
2022-08-01 19:37
has joined #pact-go

rubemfsv15
2022-08-02 20:13
has joined #pact-go

rene.klatt
2022-08-03 06:13
has joined #pact-go

imayat
2022-08-03 09:42
has joined #pact-go

mark.shand
2022-08-03 10:15
has joined #pact-go

gunjan.titiya
2022-08-03 11:51
has joined #pact-go

chaitanya.guttula
2022-08-03 12:43
has joined #pact-go

deb.kimnach
2022-08-03 12:48
has joined #pact-go

robert.henzel
2022-08-03 17:47
How to run pact-go@v2.x.x in container? The grpc plugin needs bunch of files.

yousafn
2022-08-03 19:45
Assuming looking at the output that this is an alpine container? I believe it isn't supported https://github.com/pact-foundation/pact-net/issues/387#issuecomment-1114365283 You could try a debian stretch which should have all the necessary deps

robert.henzel
2022-08-03 19:50
Yes, it's alpine. I tried in on golang:latest and it worked, only had change the binding address. Thanks for the link I figured out I have to build new docker image for pact tests in Ci. Thank for the tip about deban strech.

yousafn
2022-08-03 19:52
Fab mate, did you find this page in our docs at all? https://docs.pact.io/docker#alpine-linux it is where we will update to state for v3 users , the warning about Alpine, as I imagine it will come up a bit. I wonder if we could actually detect if its running in a container and that container is alpine and put a note to the user, so you wouldn't have to go searching

yousafn
2022-08-03 19:52
thx for confirming

robert.henzel
2022-08-03 19:56
Sadly no, I haven't gotten to the docker section yet. I just started to implement it in container as I just succeed to make the test work on my local machine. Yes, some kind of prompt would be nice.

kaiquan.shi
2022-08-04 03:38
has joined #pact-go

aalexandrumihai
2022-08-04 10:15
has joined #pact-go

alex.makdessi
2022-08-04 13:03
has joined #pact-go

ynechaieva
2022-08-04 14:11
has joined #pact-go

matt.fellows
2022-08-05 00:57
> I wonder if we could actually detect if its running in a container and that container is alpine and put a note to the user, so you wouldn?t have to go searching We could do that in the `pact-go install` command. Unfortunately, trying to run the tests is too late with golang (it needs to be able to link to the shared library before the Go code can run, which is obviously too late)


edouard.lopez
2022-08-05 09:58
Hello, on your `v2.0.0-beta.14` branch, in https://github.com/pact-foundation/pact-go/blob/v2.0.0-beta.14/examples/consumer_v3_test.go#L89 you do: ``` ExecuteTest(t, test)``` Where does the `test` come from?

dineshh.wot2021
2022-08-05 10:17
has joined #pact-go

matt.fellows
2022-08-05 10:19
That's the unit test you define to make sure your code does what it says it does.

fernandapontual5
2022-08-05 11:34
has joined #pact-go

sridhar140895
2022-08-05 11:58
has joined #pact-go

glenn
2022-08-06 18:13
has joined #pact-go

sandy.mechie
2022-08-07 21:46
has joined #pact-go

prapurna.manda3
2022-08-08 07:38
has joined #pact-go

jaroslavburi
2022-08-08 14:44
has joined #pact-go

manumahendran
2022-08-08 16:14
has joined #pact-go

lmendonca
2022-08-08 22:18
has joined #pact-go

jbrauchler
2022-08-08 22:44
has joined #pact-go

cristideacc
2022-08-09 09:05
has joined #pact-go

thanuxxxx
2022-08-09 15:15
@thanuxxxx has left the channel

alison.stuart.contrac
2022-08-09 20:41
has joined #pact-go

jaroslavburi
2022-08-10 06:08
@jaroslavburi has left the channel

tischnerd
2022-08-11 06:49
has joined #pact-go

joel.wochele
2022-08-11 12:53
has joined #pact-go

evert.vanloo
2022-08-12 12:16
has joined #pact-go

jors.matthys
2022-08-12 13:27
has joined #pact-go

ricardo.maury
2022-08-12 18:34
has joined #pact-go

prateekm33
2022-08-15 00:46
has joined #pact-go

ahmed.fahmy
2022-08-15 09:10
has joined #pact-go

tpaktopsp
2022-08-15 18:47
has joined #pact-go

julian.schmidt
2022-08-16 09:03
has joined #pact-go

jack340
2022-08-16 09:11
has joined #pact-go

g.varga
2022-08-16 11:55
has joined #pact-go

lnthai2002
2022-08-16 15:02
has joined #pact-go

sarunas.kavaliauskas
2022-08-16 19:15
has joined #pact-go

tbansal
2022-08-17 10:30
has joined #pact-go

dekkofilms
2022-08-17 21:14
has joined #pact-go

nirajlalr
2022-08-18 09:46
has joined #pact-go

jon669
2022-08-18 11:14
has joined #pact-go

michael.birchmeier
2022-08-18 19:27
has joined #pact-go

jwang
2022-08-18 21:07
has joined #pact-go

msiyaj1
2022-08-18 22:03
has joined #pact-go

ben.hansen
2022-08-19 00:44
has joined #pact-go

lottie.kett
2022-08-19 12:08
has joined #pact-go

paul.lynn
2022-08-19 14:18
has joined #pact-go

duynguyenptithcm
2022-08-20 07:22
has joined #pact-go

gaudenz.halter
2022-08-22 07:52
has joined #pact-go

harold.robson
2022-08-22 13:07
has joined #pact-go

bentzion.schochet
2022-08-22 13:27
has joined #pact-go

mat.delong
2022-08-22 14:03
has joined #pact-go

volker.wengert
2022-08-23 10:59
has joined #pact-go

sathish.sundararajan
2022-08-23 19:32
has joined #pact-go

patrick.lu
2022-08-24 02:12
has joined #pact-go

krishna.cv
2022-08-24 04:38
has joined #pact-go

ravishankar.emc
2022-08-24 06:00
has joined #pact-go

alan.zhu
2022-08-24 08:54
has joined #pact-go

nabil.bourenane
2022-08-24 14:19
has joined #pact-go

ami.ta
2022-08-25 06:05
has joined #pact-go

me1001
2022-08-25 07:24
has joined #pact-go

nidzgorskiadrian
2022-08-25 08:05
has joined #pact-go

dealandi
2022-08-25 11:50
has joined #pact-go

jreynolds
2022-08-25 12:44
has joined #pact-go

josh.steffensmeier
2022-08-25 13:18
has joined #pact-go

hazem
2022-08-25 16:23
It's possible there might be a bug with libpact_ffi install on mac M1. I dont have an M1 laptop but one of my developers experienced a similar issue reported in this thread https://pact-foundation.slack.com/archives/C9UTHTFFB/p1654172034425639. Following the instructions https://github.com/pact-foundation/pact-go/tree/2.x.x#installation, the error reported on M1 was: ```ld: 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 https://github.com/pact-foundation/pact-reference/releases/download/libpact_ffi-v0.3.8/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.fellows
2022-08-25 21:44
If I can get a reliable big report that would help. I use M1 exclusively now but on Rosetta mode (because there are just so many inconveniences otherwise)

hazem
2022-08-25 21:53
if this was a reply for https://pact-foundation.slack.com/archives/C9UTHTFFB/p1661444633201449, then what sort of information would be help? eg, what a big report? > If I can get a reliable big report that would help.

matt.fellows
2022-08-25 22:28
I think: ? A dump of the go environment ? A report of what the `pact go install` command returns with verbose enabled (try removing the `~/.pact` dir and any existing lib) ? Try also a `file /use/local/lib/libpact_ffi.dylib`

hazem
2022-08-25 23:21
hey matt, i'll write up some instructions for our developer to try and reproduce. however, while running on my mac, i noticed this error ```2022/08/25 16:18:11 [ERROR] Your Pact library installation is out of date and we were unable to download a newer one for you: open /Users/me/.pact/pact-go.yml: permission denied``` curious if this https://github.com/pact-foundation/pact-go/blob/bb647dd3be75d4fffdae10941a77eee012464267/installer/installer.go#L423 s/b `0755` instead. i dont think this relates to the underlying problem tho. just an annoying error instead

matt.fellows
2022-08-25 23:28
good spot, it probably should!

matt.fellows
2022-08-25 23:29
thanks

hazem
2022-08-26 00:12
here's some more info without having rerun pact go install ```#### go env GO111MODULE="on" GOARCH="arm64" GOBIN="" GOCACHE="/Users/dev/Library/Caches/go-build" GOENV="/Users/dev/Library/Application Support/go/env" GOEXE="" GOEXPERIMENT="" GOFLAGS="" GOHOSTARCH="arm64" GOHOSTOS="darwin" GOINSECURE="" GOMODCACHE="/Users/dev/go/pkg/mod" GONOPROXY="http://bitbucket.org/dev/*,bitbucket.org/dev/*export" GONOSUMDB="http://bitbucket.org/acme/*,bitbucket.org/dev/*export" GOOS="darwin" GOPATH="/Users/dev/go" GOPRIVATE="http://bitbucket.org/acme/*,bitbucket.org/dev/*export" GOPROXY="https://proxy.golang.org,direct" GOROOT="/opt/homebrew/Cellar/go@1.17/1.17.11/libexec" GOSUMDB="http://sum.golang.org" GOTMPDIR="" GOTOOLDIR="/opt/homebrew/Cellar/go@1.17/1.17.11/libexec/pkg/tool/darwin_arm64" GOVCS="" GOVERSION="go1.17.11" GCCGO="gccgo" AR="ar" CC="clang" CXX="clang++" CGO_ENABLED="1" GOMOD="/Users/dev/code/fun-engine/go.mod" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/9d/j7s32bkx70j85cchpy1fvdvc0000gn/T/go-build945175549=/tmp/go-build -gno-record-gcc-switches -fno-common" #### sudo file /usr/local/lib/libpact_ffi.dylib /usr/local/lib/libpact_ffi.dylib: Mach-O 64-bit dynamically linked shared library arm64```

hazem
2022-08-26 00:13
curious what's the best way to re-run the install? is this good ```rm -rf ~/.pact && pact-go -v -l DEBUG install```

matt.fellows
2022-08-26 00:27
there is a `-f` flag I think to force the reinstall

mhtkandpal10
2022-08-26 11:29
has joined #pact-go

hazem
2022-08-26 17:20
more info on install ```rm -rf ~/.pact && pact-go -v -l DEBUG install -f 2022/08/26 09:59:16 [INFO] downloading library from https://github.com/pact-foundation/pact-reference/releases/download/libpact_ffi-v0.3.8/libpact_ffi-osx-aarch64-apple-darwin.dylib.gz to /usr/local/lib/libpact_ffi.dylib 2022/08/26 09:59:17 [ERROR] Your Pact library installation is out of date and we were unable to download a newer one for you: open /usr/local/lib/libpact_ffi.dylib: permission denied``` dylib file info ```ls -l /usr/local/lib/libpact_ffi.dylib -rw------- 1 root wheel 19531936 Aug 25 10:39 /usr/local/lib/libpact_ffi.dylib``` and ```stat -f %A /usr/local/lib/libpact_ffi.dylib 600``` my none m1 mac is `622`

dwalleck
2022-08-26 20:51
has joined #pact-go

lijinze01
2022-08-26 22:20
has joined #pact-go

mhaller
2022-08-27 00:19
has joined #pact-go

matt.fellows
2022-08-27 12:09
Strange that `/usr/local/lib/libpact_ffi.dylib` is root - `/usr/local/lib` is editable by me on my M1 and I?m positive I haven?t changed those perms from the default. Did you run the install with `sudo` or manually drop the file there?

matt.fellows
2022-08-27 12:09
It looks like it couldn?t overwrite the existing library. I think you?re right in that the perm need adjusting though.

matt.fellows
2022-08-27 12:10
Also I was hopinsg for a `file` on the dylib so I could see what the architecture etc. was, but I think it won?t be too helpful until we?ve removed the existing file and reliably can get pact-go to install it for you

mvliannoi
2022-08-29 03:41
has joined #pact-go

haobei.ma
2022-08-29 06:06
has joined #pact-go

maram.elsayed
2022-08-29 08:52
has joined #pact-go

helloitsdave
2022-08-29 14:51
has joined #pact-go

mberkowitz
2022-08-29 16:16
has joined #pact-go

hazem
2022-08-29 17:12
the instructions i passed off to developers did not include `sudo`, they have since tried using that as well

hazem
2022-08-29 17:12
but still same occurs.

hazem
2022-08-29 17:14
yeah, i think re-install is somewhat a separate but tangentially related issue. the initial issue is after original install the error is ` can't open file, errno=13 file '/usr/local/lib/libpact_ffi.dylib' for architecture arm64`

hazem
2022-08-29 17:14
which seems like the permission issue to read the file after install

matt.bremer
2022-08-29 20:10
has joined #pact-go

lennart.querter
2022-08-30 09:24
has joined #pact-go

veaceslav.gaidarji
2022-08-30 15:29
has joined #pact-go

sharonw
2022-08-30 15:29
has joined #pact-go

grace.quek
2022-08-30 15:32
has joined #pact-go

s.kadium1
2022-08-30 16:12
has joined #pact-go

sumanta.roy
2022-08-31 01:33
has joined #pact-go

shuying.lin
2022-08-31 05:45
has joined #pact-go

victor.lopez
2022-08-31 10:08
has joined #pact-go

nfinley
2022-08-31 15:52
has joined #pact-go

hartror
2022-09-01 06:26
has joined #pact-go

uralsmh
2022-09-01 10:37
has joined #pact-go

krystof.sykora
2022-09-01 12:34
has joined #pact-go

lesa
2022-09-01 14:34
has joined #pact-go

gunesmes
2022-09-01 15:31
has joined #pact-go

hazem
2022-09-01 19:28
:wave::skin-tone-4: not sure if there's some sort of mismatch issue for my build ci image, but i keep hitting an issue. see thread for details.

hazem
2022-09-01 19:30
```/usr/bin/ld: $WORK/b514/_x004.o: in function `_cgo_4d7c60128d63_Cfunc_pactffi_with_header_v2': /tmp/go-build/cgo-gcc-prolog:328: undefined reference to `pactffi_with_header_v2' /usr/bin/ld: $WORK/b514/_x004.o: in function `_cgo_4d7c60128d63_Cfunc_pactffi_with_query_parameter_v2': /tmp/go-build/cgo-gcc-prolog:384: undefined reference to `pactffi_with_query_parameter_v2' collect2: error: ld returned 1 exit status @``` it seems to coincide with this https://github.com/pact-foundation/pact-go/commit/2e09eb70615706397bd911dfb79d793ba2cf0ed4, and downgrading the module to the commit prior resolves the issue.

matt.fellows
2022-09-01 22:59
You'll need to get the latest FFI, it has a new versioned method to use.

matt.fellows
2022-09-01 23:02
You can set `LD_DEBUG=all` and it should show you what library it is loading from

alanwallaceross
2022-09-02 16:27
has joined #pact-go

wdridi1
2022-09-02 18:59
has joined #pact-go

daviseago
2022-09-03 02:16
has joined #pact-go

hsanghavi538
2022-09-06 02:33
has joined #pact-go

thibaut.bodart
2022-09-06 10:41
has joined #pact-go

bastien.decroix
2022-09-06 11:45
has joined #pact-go

pabcagi
2022-09-06 12:28
has joined #pact-go

patrickbadley
2022-09-06 13:25
has joined #pact-go

james.grubb
2022-09-06 19:19
has joined #pact-go

snehasingh291506
2022-09-06 19:42
has joined #pact-go

patrickbadley
2022-09-06 19:54
@patrickbadley has left the channel

senchu.pampoorickal
2022-09-06 20:15
has joined #pact-go

nagasrinivas.thota
2022-09-07 06:56
has joined #pact-go

mahinsyeda99
2022-09-07 09:40
has joined #pact-go

lisnychyis
2022-09-07 14:00
has joined #pact-go

marek.czerwinski
2022-09-07 16:07
has joined #pact-go

glenn
2022-09-07 16:39
@glenn has left the channel

xiaofeng02111
2022-09-08 03:20
has joined #pact-go

jayvdb
2022-09-08 06:22
has joined #pact-go

lennart.querter
2022-09-08 12:05
@lennart.querter has left the channel

vvarunbajpai1988
2022-09-08 12:13
has joined #pact-go

zakir
2022-09-08 12:55
has joined #pact-go

gregory.hanson
2022-09-08 12:56
has joined #pact-go

snehasingh291506
2022-09-08 13:36
need help.. getting this while running the provider's test

matt.fellows
2022-09-08 13:44
there?s an error in your provider test - check the error!

matt.fellows
2022-09-08 13:45
this error says your provider test `func` returned an error - you?ll need to look at that error (Pact returns it to the test for you to handle)

yousafn
2022-09-08 14:03
Hi @snehasingh291506 please note our guidelines for asking for support questions in Slack https://docs.pact.io/help/how_to_ask_for_help It is quite difficult to help without full context and a screenshot and the audience is made up on primarily community users whose time is precious :thumbsup:

snehasingh291506
2022-09-08 14:05
sure..

ashishmerani
2022-09-08 21:54
has joined #pact-go

snehasingh291506
2022-09-09 00:39
Need Clarification on this: According to the Pact-Go instructions, we must have our provider API running in the background in order to perform provider verification. Additionally, I could see in the example that there is code to start the server as well as for the API handler. However, in one of the videos I watched about adding provider verification in go, the person didn't set up a mock server. I'm confused. Do we need to set up a mock server in the test.go file for provider verification, or could I just leave my backend server running in the background and pact will pull API details from the contract, make the request, and validate the response received against what we have in the contract since we are providing pactUrls in the pact.VerifyProvider or something else?

matt.fellows
2022-09-09 02:08
The mock server is only used in the consumer test

matt.fellows
2022-09-09 02:08
> could I just leave my backend server running in the background and pact will pull API details from the contract, make the request, and validate the response received against what we have in the contract since we are providing pactUrls in the pact.VerifyProvider or something else? ( Yes exactly, this is what you do for the provider test.

matt.fellows
2022-09-09 02:09
Start your local provider and point Pact at it, and tell Pact where to find the contracts (e.g. from local files, but more likely from a Pact Broker / Pactflow)

snehasingh291506
2022-09-09 05:58
Okiee thanks..

matt.fellows
2022-09-09 05:58
There is a go workshop available and examples if you?d like to look at those

matt.fellows
2022-09-09 05:58
see howtoexamples


matt.fellows
2022-09-09 05:59
and howtolearn

2022-09-09 05:59
Here are a number of useful hands-on labs that teach all of the key concepts: https://docs.pactflow.io/docs/workshops and https://docs.pact.io/implementation_guides/workshops

snehasingh291506
2022-09-09 06:36
just curious though, why are starting the server and adding api route handler in the below example.. could you please clarify that? https://github.com/pact-foundation/pact-go/blob/master/examples/provider_test.go

matt.fellows
2022-09-09 06:37
what additional route?


matt.fellows
2022-09-09 06:38
> just curious though, why are starting the server and adding api route handler in the below example.. could you please clarify that? in that example, that _is_ the API provider. You have to run the provider for the pact test to work

matt.fellows
2022-09-09 06:39
the consumer needs that route to work, which is why it?s in the consumer test

snehasingh291506
2022-09-09 06:39
owww...thankss...

matt.fellows
2022-09-09 06:40
1. Write a unit test of your Consumer API client, using Pact to mock the provider 2. This should generate a pact file, which you should upload to a pact broker / Pactflow 3. Write a provider test that fetches the pacts, and replays the request against your real provider (running locally, stubbing out dependencies)

ramesh.ambastha
2022-09-09 11:06
has joined #pact-go

oak155online
2022-09-11 19:24
@oak155online has left the channel

nickm
2022-09-12 17:15
has joined #pact-go

uzma_khan
2022-09-12 18:13
has joined #pact-go

hazem
2022-09-12 18:19
Does the _Auto-generate matchers from struct tags_ documented https://github.com/pact-foundation/pact-go/blob/2.x.x/docs/consumer.md#auto-generate-matchers-from-struct-tags support injecting _FromProviderState_? I really like both of these features and opt to always use the Auto-generate, but in cases where I need to inject the provider state then I just go old school. Curious if this is supported and if not what would it take?

matt.fellows
2022-09-13 00:07
It does not at this stage

matt.fellows
2022-09-13 00:07
It could probably be added, but I think the struct tags would end up getting so complicated they would end up a first class language in themselves

matt.fellows
2022-09-13 00:08
You could take a look and propose an API though. I could imagine a `fromProviderState` component that would override the others perhaps?

stefan.tertan
2022-09-13 15:28
has joined #pact-go

konitzert
2022-09-14 07:11
has joined #pact-go

daniel.puiu
2022-09-14 13:43
has joined #pact-go

l.heluszko
2022-09-15 13:12
has joined #pact-go

alecat88
2022-09-16 10:25
has joined #pact-go

chris.armbrester
2022-09-16 11:45
has joined #pact-go

zohaibse011
2022-09-16 13:28
has joined #pact-go

nvenkataraman
2022-09-16 17:17
has joined #pact-go

zach.davis
2022-09-16 20:18
has joined #pact-go

jorbraken
2022-09-16 20:29
has joined #pact-go

paul.ologeh
2022-09-16 23:25
has joined #pact-go

purushothamv02
2022-09-19 14:19
has joined #pact-go

lcruz
2022-09-19 23:05
has joined #pact-go

sweiba
2022-09-20 07:26
has joined #pact-go

adam910
2022-09-20 12:32
has joined #pact-go

p.pommerencke
2022-09-20 14:00
has joined #pact-go

nickm
2022-09-20 16:29
Hey all? curious if the v2 beta is close to stable/ready to go, and if people are using it without issues. We desperately need to get off of the Ruby tooling, but I can?t just swap one set of problems my team is having for a whole new set :lol: It doesn?t appear there?s been much activity the past couple months, but not sure if that?s because it?s stable or just contributor time constraints.

matt.fellows
2022-09-21 00:09
Very close Nick

matt.fellows
2022-09-21 00:10
there is a branch off the side of the 2.x.x branch which is finalising the plugins interface, as well as the async/sync messaging for V4 pact support. A few of the interfaces are changing as we work through user feedback etc.

matt.fellows
2022-09-21 00:10
so I wouldn?t jump just yet if you need a perfectly stable API

matt.fellows
2022-09-21 00:10
if you?re not using Plugins or sync messages (V4 spec), it?ll probably be mostly OK

nickm
2022-09-21 00:19
Yeah, we're still on v2 so no issues there. Appreciate the response!

anhtvuong
2022-09-21 01:39
has joined #pact-go

timothee.ville
2022-09-21 08:09
has joined #pact-go

tymoschuk.jane
2022-09-21 12:38
has joined #pact-go

tony.nguyen
2022-09-21 13:41
has joined #pact-go

sashi.kandru
2022-09-21 13:45
has joined #pact-go

khaled.bali
2022-09-21 18:01
has joined #pact-go

m.mertens
2022-09-21 18:41
has joined #pact-go

mforsman
2022-09-22 09:13
has joined #pact-go

shivendra.singh1
2022-09-22 10:04
has joined #pact-go

vaibhav.tiwari
2022-09-22 10:04
has joined #pact-go

akshaythakur2905
2022-09-22 10:06
has joined #pact-go

sukriti.kumari
2022-09-22 10:07
has joined #pact-go

p.kowalska
2022-09-22 10:35
has joined #pact-go

mazin.inaad
2022-09-22 13:21
has joined #pact-go

mastahfreak
2022-09-23 09:47
has joined #pact-go

kellie.persson
2022-09-23 17:50
has joined #pact-go

dkwak
2022-09-26 06:31
Using `pact-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.

matt.fellows
2022-09-26 07:25
1. No, it should just append. do you have anything setup to clear the pact file prior to writing to it? Do the `debug` level logs indicate any reason as to why? It?s possible if you use the same description + state it will be overwritten 2. No, it should work as per any other test Could you please share your test so we can see?

kbon
2022-09-26 13:58
has joined #pact-go

tanyaryzhova93
2022-09-26 18:53
has joined #pact-go

dkwak
2022-09-26 22:50
Thanks for the response, it was helpful. re: #1, it was indeed the ?UponReceiving? statement that was duplicated that was leading to overwritten interactions, so I was able to address that issue. re: #2, it seems that ?not returning? an error upon a `404` response for the client library resulted in the interaction being recorded. Is there another way to write my test to work with the existing client (I don?t own that code) AND work with `pact-go`? I?m a total noob to `golang` so I am quite unfamiliar with what is acceptable or not. a code snippet of the issue ```t.Run("404test", func(t *testing.T) { // mockProvider is instance of consumer.NewV2Pact mockProvider. AddInteraction(). Given("resource does not exist")). UponReceiving("GET for resource"). WithRequest(<GET request>). WillRespondWith(404) } err = mockProvider.ExecuteTest(t, func(config consumer.MockServerConfig) error { var client Client client = Client{ ServiceURL: fmt.Sprintf("http://%s:%d", config.Host, config.Port), <additional client config> } _, err := client.GetCall(<params>) assert.Error(t, err) return err }) assert.Error(t, err) })```

matt.fellows
2022-09-27 01:14
For #2 the `ExecuteTest` function accepts a user defined test. If the test errors (i.e. the test did not work as expected) you should return an error. If the error is expected, you should test for that. I can see you are doing an `assert.Error(?)` . That?s probably correct, albeit you might want to check the type of that error, because it could potentially fail for other reasons and give you a false positive. I would `return nil` in the case there is no issue with your test, and the assertions are correct. Best to talk to somebody who knows this code better though to ensure what is being tested here is correct and valid

dkwak
2022-09-27 02:38
thanks for the explanation. i?ll go talk with the code owners to see what can be modified. I appreciate the support here.

anand.krishnan
2022-09-27 10:45
has joined #pact-go

estelle.margoutin
2022-09-27 12:00
has joined #pact-go

criss.trifan
2022-09-28 05:36
has joined #pact-go

vipatel
2022-09-28 15:29
has joined #pact-go

olaoluphilip
2022-09-28 15:51
has joined #pact-go

vieira.jluiz
2022-09-28 17:20
has joined #pact-go

shuo.yang.2006
2022-09-28 19:48
has joined #pact-go

nirmalcbaral
2022-09-29 15:27
has joined #pact-go

ruppel.julian
2022-09-29 20:03
has joined #pact-go

alipala.ist
2022-09-29 20:28
has joined #pact-go

educationextended
2022-09-30 04:59
has joined #pact-go

ross.butler
2022-09-30 11:22
has joined #pact-go

koen.jans
2022-09-30 15:06
has joined #pact-go

ksawery.karwacki
2022-10-01 13:12
has joined #pact-go

jesper.nilsson
2022-10-01 13:59
has joined #pact-go

mansillamarcelo90
2022-10-02 22:06
has joined #pact-go

yulia.tekin.86
2022-10-02 22:55
has joined #pact-go

rachel.anderson
2022-10-02 23:39
has joined #pact-go

edouard.lopez
2022-10-03 10:19
The v1.x.x docs for Golang says https://docs.pact.io/implementation_guides/go/readme#pending-pacts and WIP Pact work only on PactFlow, is it still the case? > _NOTE_: This feature is currently only available on https://pactflow.io

matt.fellows
2022-10-03 19:38
Should work on the OSS one too

jason.stahl
2022-10-03 22:19
has joined #pact-go

sreeragsa
2022-10-04 03:03
has joined #pact-go

tara.costin
2022-10-04 14:45
has joined #pact-go

oscar.barbamanzano
2022-10-05 14:18
has joined #pact-go

yanov.alexander
2022-10-06 08:39
has joined #pact-go

bxbivc
2022-10-06 10:05
has joined #pact-go

curtis.scott
2022-10-06 11:27
has joined #pact-go

riley.lee
2022-10-06 11:30
has joined #pact-go

oliver.smyth
2022-10-06 11:34
has joined #pact-go

kevin.campos
2022-10-06 11:35
has joined #pact-go

pstrnad
2022-10-06 12:04
has joined #pact-go

rachelxelizabethh
2022-10-06 13:20
has joined #pact-go

pratish
2022-10-06 21:08
has joined #pact-go

ilia
2022-10-06 22:18
has joined #pact-go

edudelta
2022-10-07 15:57
has joined #pact-go

olsen.lee.r
2022-10-07 18:29
has joined #pact-go

johndunning
2022-10-08 18:05
has joined #pact-go

kentooooo.1230
2022-10-09 17:49
has joined #pact-go

gpapadakis84
2022-10-10 12:32
has joined #pact-go

daftpunkapi
2022-10-11 09:22
has joined #pact-go

matteo.demasi
2022-10-11 12:08
has joined #pact-go

raul.romitan.ext
2022-10-11 12:17
has joined #pact-go

dominikdieter.krichba
2022-10-11 13:23
has joined #pact-go

ulrich.keil
2022-10-11 13:26
has joined #pact-go

mitchell.l.cooper
2022-10-11 13:45
has joined #pact-go

torsten.wiederkehr
2022-10-11 14:24
has joined #pact-go

mikey214
2022-10-11 22:32
has joined #pact-go

xi.luo
2022-10-12 05:11
has joined #pact-go

kim.crowe
2022-10-12 10:15
has joined #pact-go

suganyamuthukumar03
2022-10-13 11:01
has joined #pact-go

francis.bonneau
2022-10-13 18:30
has joined #pact-go

naf
2022-10-14 10:55
has joined #pact-go

werner.lauterfeld
2022-10-14 11:09
has joined #pact-go

jharms
2022-10-14 15:04
has joined #pact-go

daniel.cronin
2022-10-14 16:15
has joined #pact-go

txomin.sirera
2022-10-14 18:57
has joined #pact-go

jr
2022-10-15 20:48
has joined #pact-go

sasankdts
2022-10-16 08:48
has joined #pact-go

wil.pannell
2022-10-16 16:56
has joined #pact-go

sirisha.kunaparaju
2022-10-17 11:01
has joined #pact-go

gardeepti
2022-10-17 11:02
has joined #pact-go

vedant3620
2022-10-17 11:08
has joined #pact-go

priyanka.bbit
2022-10-17 11:11
has joined #pact-go

nvourlakis
2022-10-17 11:21
has joined #pact-go

oliwia.koch
2022-10-17 13:51
has joined #pact-go

bluediamondpc
2022-10-17 14:18
has joined #pact-go

nicholas.difelice
2022-10-17 15:16
has joined #pact-go

remington.otoole
2022-10-17 15:20
has joined #pact-go

matt.lucido
2022-10-17 15:23
has joined #pact-go

molly.mccarthy
2022-10-17 15:28
has joined #pact-go

slack1211
2022-10-18 07:24
has joined #pact-go

mekala.kalyan
2022-10-18 12:49
has joined #pact-go

jpullifrone
2022-10-18 17:05
has joined #pact-go

jorge.bo
2022-10-18 18:42
has joined #pact-go

orhun
2022-10-18 19:42
has joined #pact-go

kwo.ding
2022-10-19 08:24
has joined #pact-go

ankit.jain
2022-10-19 10:41
has joined #pact-go

edeandre
2022-10-19 12:09
has joined #pact-go

stanlisaus
2022-10-19 12:11
has joined #pact-go

sam.tavakoli
2022-10-19 13:17
has joined #pact-go

sam.tavakoli
2022-10-19 13:18
Hello :wave: The https://github.com/pact-foundation/pact-go README mentioned that the support for async interaction is experimental. Why is it considered to be experimental and is there anything to read about it?

matt.fellows
2022-10-19 13:43
Ah, that text should definitely be removed now. Thanks for spotting, I can remove tomorrow (or feel free to send a PR if you're so inclined)


sam.tavakoli
2022-10-19 13:48
Does `pact-go` have support for V4 of the specification for the sync message feature using Rust stand alone server?

nikolaasrondon
2022-10-19 17:29
has joined #pact-go

matt.fellows
2022-10-19 20:42
Yep. The 2.x.x branch does

fquijada
2022-10-19 21:25
has joined #pact-go

kkalan
2022-10-20 03:52
has joined #pact-go

dyptorden
2022-10-20 10:24
has joined #pact-go

olawale.akande
2022-10-20 11:52
has joined #pact-go

olawale92.tech
2022-10-20 11:56
has joined #pact-go

calen.pennington
2022-10-20 13:43
has joined #pact-go

muhammud.naseeruddin
2022-10-20 16:04
has joined #pact-go

xuw
2022-10-20 16:38
has joined #pact-go

matt.johnson
2022-10-20 17:25
has joined #pact-go

bhavyashree.r
2022-10-22 06:10
has joined #pact-go

mosesgwenne
2022-10-24 06:10
has joined #pact-go

j.watkins12
2022-10-24 21:13
has joined #pact-go

tony.odonnell
2022-10-25 07:56
has joined #pact-go

martin.schlegel
2022-10-25 11:24
has joined #pact-go

stefan.zivkovic
2022-10-25 12:35
has joined #pact-go

alexander.friesen
2022-10-25 14:07
has joined #pact-go

mspector
2022-10-25 14:45
has joined #pact-go

thomas.peyregne
2022-10-25 14:53
has joined #pact-go

jsirju
2022-10-25 20:22
has joined #pact-go

a.emmanuelmendoza
2022-10-25 23:42
has joined #pact-go

emma.colleran
2022-10-26 13:05
has joined #pact-go

aaron.swerlein
2022-10-26 15:10
has joined #pact-go

stefan.zivkovic
2022-10-26 16:32
@stefan.zivkovic has left the channel

jeronimo
2022-10-26 17:50
has joined #pact-go

matthew.beattie
2022-10-26 20:14
has joined #pact-go

harrison.le
2022-10-26 21:47
has joined #pact-go

amandasstecz
2022-10-26 21:57
has joined #pact-go

christianoliver.table
2022-10-27 06:15
has joined #pact-go

zehra.lichtenberg
2022-10-27 08:08
has joined #pact-go

vzviaruha
2022-10-27 11:29
has joined #pact-go

michael.laird
2022-10-27 13:38
has joined #pact-go

pedropho18
2022-10-27 21:33
has joined #pact-go

juancesarvillalba
2022-10-27 21:43
has joined #pact-go

angad.singh
2022-10-28 11:07
has joined #pact-go

jeronimo
2022-10-28 18:20
@jeronimo has left the channel

oroceo.ian
2022-10-28 20:04
has joined #pact-go

benjamin
2022-10-28 21:09
has joined #pact-go

emailpankaj.agarwal
2022-10-29 13:26
has joined #pact-go

krishnakanth219
2022-10-30 22:59
has joined #pact-go

joshua.mclatchie
2022-10-31 02:21
has joined #pact-go

jason.taylor2
2022-10-31 13:55
has joined #pact-go

kedar.ghate
2022-10-31 14:02
has joined #pact-go

jason.taylor2
2022-11-01 22:33
trying to follow the v4 example consumer for 2.x.x but can?t seem to get the matcher to work. it seems to want to do an exact match on the request no matter which matcher I select. this is in my WithRequest block: ```Header("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
2022-11-01 23:26
curious if this is a bug with `atLeastOneLike` . 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.

hazem
2022-11-01 23:28
```1.1) has a matching body $.events[2].data.image -> Actual map is missing the following keys: imageUrl $.events[0] -> Actual map is missing the following keys: appointment $.events[0].data.image -> Actual map is missing the following keys: imageUrl $.events[2] -> Actual map is missing the following keys: appointment```

hazem
2022-11-01 23:28
the above implies i matched 1 event, right?

matt.fellows
2022-11-01 23:36
All of the objects in `atLeastOneLike` must have the same minimum shape

matt.fellows
2022-11-01 23:36
the above errors are saying that some of the objects in the array are missing key elements

hazem
2022-11-01 23:38
yeah, that's seems to be how it works then... although the name is kind of confusing, `atLeastOneLike`. thanks for the quick reply.

matt.fellows
2022-11-01 23:40
yes, in hindsight I can see that!

usama.mumtaz
2022-11-02 09:45
has joined #pact-go

gsouza
2022-11-02 14:29
has joined #pact-go

jason.taylor2
2022-11-02 19:39
seeing same thing when using V3. for v3 matchers and injection from provider state callbacks should I be instead using the pact-go 1.7.0 version?

jason.taylor2
2022-11-02 21:32
@matt.fellows for 1.7, i see some code in message.go with provider state params, but not seeing references anywhere else. am i missing something?

jason.taylor2
2022-11-02 21:49
ah - looks like the callbacks are tied to v3 generators? so would need to stick with 2.x.x. so just need to sort out how to get the matcher to work

zhangjingqiang
2022-11-02 23:49
has joined #pact-go

bmorton
2022-11-02 23:58
has joined #pact-go

andrew.brindle
2022-11-03 10:44
has joined #pact-go

jason.taylor2
2022-11-03 14:07
after reinstalling things looks like v3 matchers are working as expected with 2.x.x

vladislav.ledniov
2022-11-03 14:13
has joined #pact-go

grace.quek
2022-11-03 16:31
@vladislav.ledniov - here is where you can post your questions about Go integration.

jonathan
2022-11-03 16:43
has joined #pact-go

ldicesaro.scvsoft
2022-11-03 20:55
has joined #pact-go

matt.fellows
2022-11-04 02:04
sorry, was late to this party, but looks like you?ve sorted it. You?re right though,only 2.x.x supports the callbacks

carlosmarange
2022-11-04 06:09
has joined #pact-go

stevet
2022-11-04 06:31
has joined #pact-go

seikyo.cho
2022-11-04 08:58
has joined #pact-go

poornimakrishnarajan
2022-11-04 13:56
has joined #pact-go

michalkras
2022-11-05 01:05
has joined #pact-go

vladislav.ledniov
2022-11-07 08:54
good time of the day everybody ! I?m having some troubles launching Provider tests on golang, specifically, I?m getting a message that my Pact CLI is out of date: ```2022/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 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.

matt.fellows
2022-11-07 09:02
Hello! :wave: Have you installed the latest CLI tools?

vladislav.ledniov
2022-11-07 09:06
I?m launching PactFlow tests on PR creation / pushed via CircleCI, here?s the dependency installation step form Makefile: ```pact-dependencies: echo "--- ? Installing Pact CLI dependencies";\ curl -fsSL https://raw.githubusercontent.com/pact-foundation/pact-ruby-standalone/master/install.sh | bash; export PATH=$(PATH):/opt/pact/bin```

matt.fellows
2022-11-07 09:07
Is that step running from the `/opt/` folder?

matt.fellows
2022-11-07 09:08
That `install.sh` script doesn?t put the files in `/opt/pact/bin` it extracts the files into the current working directory. So you would end up with `/<cwd>/pact/bin` at the end of it.

matt.fellows
2022-11-07 09:09
so you could simply change the last line (that exports the PATH) to use `$PWD` in place of `/opt`

vladislav.ledniov
2022-11-07 09:11
okay okay, thank you, let me try and update these steps on my side :thankyou:

matt.fellows
2022-11-07 09:12
no worries!

maria.botnari
2022-11-07 12:07
has joined #pact-go

tomasz.sosnowski
2022-11-07 13:52
has joined #pact-go

bpadhalni
2022-11-07 15:26
has joined #pact-go

ajay.chinnam
2022-11-08 10:08
has joined #pact-go

sprengo
2022-11-08 10:57
has joined #pact-go

james.ferguson
2022-11-08 12:33
has joined #pact-go

gururaghavendrar98
2022-11-08 13:04
has joined #pact-go

steven
2022-11-08 23:09
has joined #pact-go

alan.barr
2022-11-09 03:14
has joined #pact-go

wojciech.bachur
2022-11-09 13:55
has joined #pact-go

arek92
2022-11-09 13:58
has joined #pact-go

dariusz.duleba
2022-11-09 14:00
has joined #pact-go

cgodsey
2022-11-10 19:45
has joined #pact-go

saweniger
2022-11-14 17:29
has joined #pact-go

miguel.roldan
2022-11-15 11:06
has joined #pact-go

robin.lungwitz
2022-11-15 13:32
has joined #pact-go

laith
2022-11-15 16:15
has joined #pact-go

elluru.kri.mohan
2022-11-15 18:14
has joined #pact-go

rmartine
2022-11-15 20:35
has joined #pact-go

sameena9010
2022-11-16 06:49
has joined #pact-go

jason.taylor2
2022-11-16 14:25
any chance VerifyPluginRequest will be getting support for StateHandlers and RequestFilter in the near future?

ryanthomas840310
2022-11-16 20:52
has joined #pact-go

mike.hideaki
2022-11-16 21:48
has joined #pact-go

vwaters
2022-11-16 22:31
has joined #pact-go

matt.fellows
2022-11-17 00:44
Yes. I have a branch that actually will amalgamate the verifier into an all in one verifier

juergen.unfried
2022-11-17 20:43
has joined #pact-go

jose.anastacio
2022-11-18 13:34
has joined #pact-go

shawn305
2022-11-18 13:42
has joined #pact-go

tronghuy
2022-11-19 01:38
has joined #pact-go

mwilso29
2022-11-19 16:09
Hi Matt thanks a lot for this it resolved my issues locally. I am now seeing this when running it in the gitlab runner in my pipeline. Do you know what I would need to export the PATH to be within the pipeline? / Where does the pact binary get installed in a gitlab runner?

matt.fellows
2022-11-21 07:10
> Hi Matt thanks a lot for this it resolved my issues locally. I am now seeing this when running it in the gitlab runner in my pipeline. Do you know what I would need to export the PATH to be within the pipeline? / Where does the pact binary get installed in a gitlab runner? If you?re running that bash script, it?s relative to the current working directory. So wherever the default `$PWD` is

glauco.carvalho
2022-11-21 15:47
has joined #pact-go

soner.ay
2022-11-21 16:57
has joined #pact-go

flafla.mattos
2022-11-22 19:10
has joined #pact-go

chrisjburnscg
2022-11-22 22:11
has joined #pact-go

imer.muhovic
2022-11-24 08:57
has joined #pact-go

mohitsoni
2022-11-24 10:19
has joined #pact-go

celia
2022-11-24 14:32
has joined #pact-go

harald.bittermann
2022-11-25 10:01
has joined #pact-go

ad
2022-11-25 13:23
has joined #pact-go

sree
2022-11-25 14:22
has joined #pact-go

soumya.aithal
2022-11-27 17:15
has joined #pact-go

nathan.pine
2022-11-28 09:19
has joined #pact-go

sanmicad
2022-11-28 12:20
has joined #pact-go

marcin.nawrocki
2022-11-29 09:25
has joined #pact-go

sergewar
2022-11-30 08:54
has joined #pact-go

diego
2022-11-30 09:50
has joined #pact-go

surya.sidharthan
2022-11-30 11:13
has joined #pact-go

nicolas.chara
2022-11-30 13:16
has joined #pact-go

daniel
2022-11-30 18:30
has joined #pact-go

denis
2022-11-30 22:07
has joined #pact-go

dbarne24
2022-12-01 11:35
has joined #pact-go

min.zaw.mra
2022-12-01 11:36
has joined #pact-go

kevin.lau
2022-12-01 11:41
has joined #pact-go

bojanmarjanovic1980
2022-12-01 13:09
has joined #pact-go

ivona.sovic
2022-12-01 13:13
has joined #pact-go

orbit
2022-12-01 15:45
has joined #pact-go

david.dudley
2022-12-01 19:55
has joined #pact-go

brian.coan
2022-12-01 20:22
has joined #pact-go

manishmitraba
2022-12-02 02:16
has joined #pact-go

lepdiana01
2022-12-02 03:53
has joined #pact-go

arpan.agr
2022-12-02 08:06
has joined #pact-go

goksel00
2022-12-02 17:41
has joined #pact-go

aibosun900614
2022-12-04 02:18
has joined #pact-go

mayank.mahajan04
2022-12-05 10:51
has joined #pact-go

mailtoshinu
2022-12-06 07:42
has joined #pact-go

youri.thielen
2022-12-07 07:52
has joined #pact-go

cpopovici
2022-12-07 09:02
has joined #pact-go

hendrik916
2022-12-07 12:07
has joined #pact-go

matcheckep
2022-12-07 13:55
has joined #pact-go

wesley.nutley
2022-12-07 19:48
has joined #pact-go

github2
2022-12-07 20:21
The GitHub user https://github.com/bethesque has signed out. Use the following command/s to recreate subscriptions /github subscribe pact-foundation/pact-go

dagmara.krent
2022-12-08 10:19
has joined #pact-go

komathypriya
2022-12-08 11:35
has joined #pact-go

neethu.santhosh
2022-12-08 14:22
has joined #pact-go

janga.nagamallika
2022-12-08 17:49
has joined #pact-go

jason.taylor2
2022-12-08 21:11
latest update to pact-go 2.x.x seems to have issues retrieving pacts from the broker: ```[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 ```

matt.fellows
2022-12-08 21:14
Mind popping it into trace mode and sharing the logs?

jason.taylor2
2022-12-08 21:19
sure - how do i enable extra logging? i am making the SetLogLevel to trace but i think this is down inside the pactffi_verifier_execute call?

jason.taylor2
2022-12-08 21:37
also for 2.x.x the provider state doesn?t seem to be getting put into the contract and i don?t see the state handlers getting called for gRPC - opened https://github.com/pact-foundation/pact-go/issues/253

yousafn
2022-12-08 22:10
try `LOG_LEVEL=trace go test -v .` ?

jason.taylor2
2022-12-08 22:24
tx, much more detail in the output with that. as expected it seems to not be using the Provider param from the VerifyRequest and is just sending ?provider? for that name so the url ends up provider/provider: ```2022-12-08T22:17:00.954892Z DEBUG ThreadId(01) pact_ffi::verifier::handle: Pact source to verify = PactBrokerWithDynamicConfiguration(https://redacted.com, provider_name='provider', enable_pending=false, include_wip_since=None, provider_tags=[], provider_branch=Some(""), consumer_version_selectors='[ConsumerVersionSelector { consumer: None, tag: None, fallback_tag: None, latest: None, deployed_or_released: None, deployed: None, released: None, environment: None, main_branch: Some(true), branch: None, matching_branch: None }], auth=None')```

jason.taylor2
2022-12-08 22:52
and one more 2.x.x issue - the HTTP request filter seems to no longer be getting called: https://github.com/pact-foundation/pact-go/issues/254

jampala_1988
2022-12-08 23:47
has joined #pact-go

krishnaraj.pk
2022-12-09 05:35
has joined #pact-go

rajavadootha04
2022-12-09 07:56
has joined #pact-go

tomaszrdzak
2022-12-09 11:54
has joined #pact-go

maxime.raverdy
2022-12-12 09:22
has joined #pact-go


matt.fellows
2022-12-12 20:57
Thanks. I think I have fixed this in the latest HEAD also Jason

sambhavi.chinnu
2022-12-13 04:11
has joined #pact-go

david.turner
2022-12-13 09:01
has joined #pact-go

mateusz.dudek03
2022-12-13 14:10
has joined #pact-go

mateusz.dudek
2022-12-13 14:22
has joined #pact-go

dmitrij.bogomyakov
2022-12-13 16:09
has joined #pact-go

victor.lau841
2022-12-13 16:30
has joined #pact-go

roblesjm
2022-12-14 11:40
has joined #pact-go

ahmidat
2022-12-14 12:44
has joined #pact-go

sergey.ledniov
2022-12-14 16:46
has joined #pact-go

abhimanu.sehgal
2022-12-14 20:40
has joined #pact-go

abraham.gonzalez93
2022-12-14 21:38
@abraham.gonzalez93 has left the channel

enrique.decoss
2022-12-15 02:25
has joined #pact-go

kirankishore4
2022-12-15 06:12
has joined #pact-go

maxime.raverdy
2022-12-15 09:57
@maxime.raverdy has left the channel

alvaro.navarroiborra
2022-12-15 10:47
has joined #pact-go

leelavathi.sundaram
2022-12-15 10:55
has joined #pact-go

paula.muldoon
2022-12-15 11:40
has joined #pact-go

james.sun
2022-12-15 22:42
has joined #pact-go

dominic.matabilas
2022-12-15 22:42
has joined #pact-go

tlemmonds
2022-12-16 19:55
has joined #pact-go

vejeta
2022-12-18 02:27
@vejeta has left the channel

samuel.woodbridge
2022-12-19 09:44
has joined #pact-go

paula.muldoon
2022-12-19 12:19
@paula.muldoon has left the channel

mwojcik
2022-12-19 13:43
has joined #pact-go

robinsmit
2022-12-19 15:08
has joined #pact-go

jungjae.lim
2022-12-19 16:24
has joined #pact-go

saurwein
2022-12-21 14:48
has joined #pact-go

ssharma
2022-12-21 15:17
has joined #pact-go

alejandro.depablos
2022-12-21 18:56
has joined #pact-go

tomas.cerkasas
2022-12-21 23:14
has joined #pact-go

priyanka.soni
2022-12-22 08:24
has joined #pact-go

zijian.wang1
2022-12-22 10:51
has joined #pact-go

anyi.huang
2022-12-22 11:02
has joined #pact-go

varnit.garg2424
2022-12-23 07:53
Hi, we use https://github.com/onsi/ginkgo testing library to write unit tests! Would it be compatible with pact-go?

matt.fellows
2022-12-23 08:12
Hmmmm good question. I think it mostly is, but the verification process currently accepts a testing.T type. Does ginkgo wrap that or is it completely separate?

matt.fellows
2022-12-23 08:13
I think we expose the raw variant which could be wrapped by ginkgo otherwise

matt.fellows
2022-12-23 08:13
(or if not, it wouldn't be hard)

stepik02
2022-12-23 10:36
has joined #pact-go

prajwalg
2022-12-25 14:28
has joined #pact-go

raksha.baskaran
2022-12-27 06:01
has joined #pact-go

venkatesh.madas
2022-12-27 06:36
has joined #pact-go

anthony.bennett
2022-12-27 20:15
has joined #pact-go

livinglogic.nl
2022-12-28 10:50
has joined #pact-go

pawel.szczerbicki
2022-12-29 13:22
has joined #pact-go

anandhiemail
2022-12-29 17:37
has joined #pact-go

varnit.garg2424
2022-12-30 02:55
Thanks for the response! Yep, realised that raw variant is already exposed and that should work out of the box:slightly_smiling_face:

arika.goyal
2022-12-30 12:18
has joined #pact-go

m.marquez
2022-12-31 16:05
has joined #pact-go

guoxin.rick33
2023-01-03 08:45
has joined #pact-go

will
2023-01-03 09:59
has joined #pact-go

mario.pires
2023-01-03 11:42
has joined #pact-go

will
2023-01-03 11:54
Hey Pact folks, and happy new year! I?ve followed the README for pact-go that talks about installing the standalone CLI tools, and adding their location to the PATH var. I?ve also cloned the `pact-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.

vtft1988
2023-01-03 16:38
has joined #pact-go

matt.fellows
2023-01-03 23:17
Hi Will, happy new year to you too!

matt.fellows
2023-01-03 23:18
First up, I'd recommend jumping straight to the 2.x.x release. It's close to stable now and has more features and better support

matt.fellows
2023-01-03 23:24
The fact the workshop project works tells me it's likely you haven't got the tools properly added to the path and the runtime is unable to find the binaries. But with 2.x.x there is no dependency on the standalone (which won't natively run on M1 outside of Rosetta, btw). The docker image can then be used for publishing etc (albeit really that's a CI only thing anyway)

will
2023-01-04 09:30
Thanks a lot Matt, appreciate your help, will take a gander at the 2.x.x releases and see where I get to.

matt.thompson
2023-01-04 10:54
has joined #pact-go

rytis.lisauskas
2023-01-04 14:20
has joined #pact-go

jason.taylor2
2023-01-04 15:59
looks like a regression in the gRPC provider verification with the 2.x.x branch: https://github.com/pact-foundation/pact-go/issues/260

morin.td
2023-01-04 16:54
has joined #pact-go

afernandez
2023-01-04 22:22
has joined #pact-go

vkaramoff
2023-01-05 10:00
has joined #pact-go

vkaramoff
2023-01-05 10:02
@vkaramoff has left the channel

morin.td
2023-01-05 10:17
@morin.td has left the channel

vika.karman
2023-01-05 10:32
has joined #pact-go

vika.karman
2023-01-05 10:46
Hello! I've got a question regarding request/response bodies matching. In my consumer test I describe interaction this way: ``` body := 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.

nickzakirov
2023-01-05 15:01
has joined #pact-go

yousafn
2023-01-06 13:13
Yes I believe so, it will look at every node in your response given by the provider and check that is matches the type specified in the interaction response Do you have a copy of the matchers generated from your older test? I assume they are v2.0.0 not v3? v4 is shown in your example

nam.nguyen
2023-01-07 04:00
has joined #pact-go

vika.karman
2023-01-07 19:04
Right..so this piece of code: ```Body: dsl.Like(map[string]interface{}{ "code": dsl.Term(code, uuidMatcher), "mfc-id": dsl.Like("D02"), "complete-at": dsl.Timestamp(), "started-at": dsl.Timestamp(), "picked-at": dsl.Timestamp(), "closed-at": dsl.Timestamp(), "cutoffs": dsl.EachLike(dsl.Timestamp(), 1), "status": dsl.Term("SPLIT", "INCOMPLETE|NEW|SPLIT|PROGRESS|COMPLETE"), "type": dsl.Term("PRELIM", "PRELIM|DELTA"), "zone": dsl.Term("STORE", "STORE|OSR|MANUAL"), "total-lines": dsl.Like(10), "total-lines-complete": dsl.Like(9), "total-units": dsl.Like(30), "total-units-picked": dsl.Like(25), "out-of-stock-units": dsl.Like(1), }),``` generates these matching rules for response body: ```"matchingRules": { "$.body": { "match": "type" }, "$.body.closed-at": { "match": "regex", "regex": "^([\\+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24\\:?00)([\\.,]\\d+(?!:))?)?(\\17[0-5]\\d([\\.,]\\d+)?)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" }, "$.body.code": { "match": "regex", "regex": "[0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12}" }, "$.body.complete-at": { "match": "regex", "regex": "^([\\+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24\\:?00)([\\.,]\\d+(?!:))?)?(\\17[0-5]\\d([\\.,]\\d+)?)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" }, "$.body.cutoffs": { "min": 1 }, "$.body.cutoffs[*].*": { "match": "type" }, "$.body.cutoffs[*]": { "match": "regex", "regex": "^([\\+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24\\:?00)([\\.,]\\d+(?!:))?)?(\\17[0-5]\\d([\\.,]\\d+)?)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" }, "$.body.mfc-id": { "match": "type" }, "$.body.out-of-stock-units": { "match": "type" }, "$.body.picked-at": { "match": "regex", "regex": "^([\\+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24\\:?00)([\\.,]\\d+(?!:))?)?(\\17[0-5]\\d([\\.,]\\d+)?)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" }, "$.body.started-at": { "match": "regex", "regex": "^([\\+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24\\:?00)([\\.,]\\d+(?!:))?)?(\\17[0-5]\\d([\\.,]\\d+)?)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" }, "$.body.status": { "match": "regex", "regex": "INCOMPLETE|NEW|SPLIT|PROGRESS|COMPLETE" }, "$.body.total-lines": { "match": "type" }, "$.body.total-lines-complete": { "match": "type" }, "$.body.total-units": { "match": "type" }, "$.body.total-units-picked": { "match": "type" }, "$.body.type": { "match": "regex", "regex": "PRELIM|DELTA" }, "$.body.zone": { "match": "regex", "regex": "STORE|OSR|MANUAL" } }```

dale.wells
2023-01-08 15:18
has joined #pact-go

matt.fellows
2023-01-09 01:12
Yep, that looks about right to me. ``` "$.body": { "match": "type" },``` Says ?recursively check the JSON to ensure it matches the same field types?. Then every specific matcher overrides that matching cascade, where there is a more specific matcher

matt.fellows
2023-01-09 01:12
Make sense?

matt.fellows
2023-01-09 01:13
BTW, how are you finding the 2.x.x interface compared to 1.x.x? I?m looking to release 2.x.x as stable soon, there is just one area I?d like to improve in the plugins/v4 interface

manohar.adepu
2023-01-09 02:58
has joined #pact-go

hsyogesh12
2023-01-09 05:54
has joined #pact-go

vika.karman
2023-01-09 09:01
it looks good so far, but I've just started and this was my first test for post request. Before I wrote tests only for GET and it was easier:) F.i., I've found that content-type header is added to the request automatically and your service has to have it also, right? Also I still have doubts regarding list matching and optional fields. My response has an array field that may contain some values or may be empty depending on the data. I'm using matchers.ArrayMinLike, but it requires man array length 1. So I ended up having 2 different interactions: one with empty list, the other one with list with some values. Maybe you could suggest another solution here.

sowmya.bhg
2023-01-09 10:32
has joined #pact-go

matt.fellows
2023-01-09 11:00
> F.i., I?ve found that content-type header is added to the request automatically and your service has to have it also, right? Pact must know the content-type, yes, I think that?s true

matt.fellows
2023-01-09 11:00
> Also I still have doubts regarding list matching and optional fields. My response has an array field that may contain some values or may be empty depending on the data. I?m using matchers.ArrayMinLike, but it requires man array length 1. So I ended up having 2 different interactions: one with empty list, the other one with list with some values. Maybe you could suggest another solution here. that?s the solution

matt.fellows
2023-01-09 11:00
see howtooptional for more :point_down:


matt.fellows
2023-01-09 11:24
Awesome!

ivan.mikhalka
2023-01-09 13:21
has joined #pact-go

klaudijus.rulys
2023-01-09 13:32
has joined #pact-go

boer.k
2023-01-09 15:10
has joined #pact-go

chris.aguirre11
2023-01-09 16:45
has joined #pact-go

nicolas.barbey
2023-01-09 17:06
has joined #pact-go

simon.petty
2023-01-09 21:11
has joined #pact-go

edisonjen13
2023-01-09 22:25
has joined #pact-go

boer.k
2023-01-10 10:18
@boer.k has left the channel

nuno.frias
2023-01-10 11:34
Hi all, I am using the latest v2.x.x and I am noticing that the BeforeHooks are running before each of the state handler functions. But going through the code comments on the `verify_request.go` file they should run only once.

nuno.frias
2023-01-10 11:35
Am I missing something?

matt.fellows
2023-01-10 12:20
Might be a bug Nuno. Could you please raise an issue on GH for me?

nuno.frias
2023-01-10 12:21
Will do

artem.z
2023-01-11 13:18
has joined #pact-go

vika.karman
2023-01-11 15:23
Hello. Can I have both versions of pact-go (v1 and v2) in my repo?

jrede
2023-01-11 17:57
has joined #pact-go

matt.fellows
2023-01-11 21:27
I don?t believe so, at least not as far as the Pact library is concerned. The packages are under different namespaces and should be separate go modules

vanitha.annamalai
2023-01-12 05:27
has joined #pact-go

jessy.li
2023-01-12 17:29
has joined #pact-go

vika.karman
2023-01-12 20:54
I continue to compare pact v1 and v2 and here is another diff: before this part of interaction ``` WillRespondWith( 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:

vika.karman
2023-01-12 20:55
with v2 the same piece of interaction looks this way: ```WillRespondWith(http.StatusOK, func(b *consumer.V4ResponseBuilder) { b. Header("Content-Type", matchers.S("application/json")). JSONBody(matchers.MapMatcher{ "code": matchers.Term(code, uuidMatcher), "closed-at": matchers.Timestamp(), }) }, )``` and the contract:

vika.karman
2023-01-12 20:56
we can see that there are 2 new fields added to the body: ```"contentType": "application/json", "encoded": false```

vika.karman
2023-01-12 20:57
why does pact add them if we have header content-type?..

hazem
2023-01-13 01:05
What do you say about an enhancement for pact-go 2.x.x Verifier as it relates to webhook re-verification? See thread https://pact-foundation.slack.com/archives/CLS16AVEE/p1673564994052859. It's probably easy to fall into this trap like I did. I have a webhook that triggers the provider verification during an event such as `Contract published that requires verification`. Utilizing the webhook template library https://docs.pact.io/pact_broker/webhooks/template_library#bitbucket---trigger-pipeline-run, 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?

aronlmin
2023-01-13 02:13
has joined #pact-go

vika.karman
2023-01-13 09:12
*Hello!* I continue to compare pact v1 and v2 and here is another diff: in v1 this part of interaction ``` WillRespondWith( 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:

vika.karman
2023-01-13 09:13
with v2 the same piece of interaction looks this way: ```WillRespondWith(http.StatusOK, func(b *consumer.V4ResponseBuilder) { b. Header("Content-Type", matchers.S("application/json")). JSONBody(matchers.MapMatcher{ "code": matchers.Term(code, uuidMatcher), "closed-at": matchers.Timestamp(), }) }, )``` and the contract:

vika.karman
2023-01-13 09:13
we can see that there are 2 new fields added to the body: ```"contentType": "application/json", "encoded": false``` why does pact add them if we have header content-type?..

buckley
2023-01-13 20:01
has joined #pact-go

matt.fellows
2023-01-14 07:48
Can you please share your full test setup? It's probably a bug.

vika.karman
2023-01-14 13:41
hi Matt! Sure: ```func (s *PicklistSuite) TestClosePicklist() { //contract description var retailer, env, code, token = "", "", "bbe797fd-b557-4549-9a5e-913a0d14b936", "token" mockProvider.AddInteraction(). Given(fmt.Sprintf("picklist with code '%s' exists", code)). UponReceiving(fmt.Sprintf("a request to close picklist by code '%s'", code)). WithRequest(http.MethodPost, fmt.Sprintf("/v3/picklists/%s/close", code), func(b *consumer.V4RequestBuilder) { b.Header("X-Token", matchers.S(token)) }). WillRespondWith(http.StatusOK, func(b *consumer.V4ResponseBuilder) { b. Header("Content-Type", matchers.S("application/json")). JSONBody(matchers.MapMatcher{ "code": matchers.S(code), "closed-at": matchers.Timestamp(), }) }, ) // define test err := mockProvider.ExecuteTest(s.T(), func(config consumer.MockServerConfig) error { isps.URLFormat = fmt.Sprintf("http://localhost:%d/v3/", config.Port) isps.URLFormat = isps.URLFormat + "%s" + "%s" ctx := context.Background() params := isps.ClosePicklistReqParams{ Retailer: retailer, Env: env, Token: token, PicklistCode: code, } // execute function response, err := app.inStorePickingService.ClosePicklist(ctx, params) s.NoError(err) s.NotNil(response) s.Equal(code, response.Code) s.NotNil(response.ClosedAt) return nil }) s.Require().NoError(err) }```

matt.fellows
2023-01-15 21:06
How is the mock provider setup? Also after you clearing out the existing Pact file? Anything else in the setup you can share?

vika.karman
2023-01-16 08:36
```mockProvider, err = consumer.NewV4Pact(consumer.MockHTTPProviderConfig{ Consumer: "outboundbff-picklist", Provider: "isps", PactDir: "../common/services/pacts", })``` btw didn't manage to setup logs... in prev version during pact init I specified LogDir...

vika.karman
2023-01-16 08:36
I init mockProvider in SetupSuite() func (before all the tests)

vika.karman
2023-01-16 08:37
nothing else is there...

vika.karman
2023-01-16 08:38
when I run tests locally I remove the existing pact file

sashizen
2023-01-16 09:09
has joined #pact-go

matt.fellows
2023-01-16 11:24
something is not right for sure. I?ll need a repro project if you wouldn?t mind so I can get to the bottom of it

vika.karman
2023-01-16 11:47
well....it is not a public repo

richardmccann
2023-01-16 15:37
has joined #pact-go

yousafn
2023-01-16 17:05
It should be feasible to create a minimal reproducible examples in a public repo. You could fork the pact-go repo and create examples in the test suite. Appreciate you cannot share your private code

vika.karman
2023-01-17 08:42
But it is not the first version of the test which does not work. The test worked with v1...and does not work with v2. Service code didn't change. The only part which seems different is how I describe the response body ```Body: dsl.Like(map[string]interface{}{ "code": dsl.Term(code, uuidMatcher), "closed-at": dsl.Timestamp(), }),``` and ``` JSONBody(matchers.MapMatcher{ "code": matchers.Term(code, uuidMatcher), "closed-at": matchers.Timestamp(), })``` What is the difference in these 2 descriptions?

eugene.malihins
2023-01-17 11:08
has joined #pact-go

yusufjamalazam
2023-01-17 12:24
has joined #pact-go

jbosca
2023-01-17 13:10
has joined #pact-go

hehecx
2023-01-17 22:16
has joined #pact-go

jawaharsurapaneni
2023-01-18 00:36
has joined #pact-go

kerrypmckeever
2023-01-18 02:12
has joined #pact-go

vika.karman
2023-01-18 10:40
@matt.fellows I've compared pacts generated with V2HTTPMockProvider, V3HTTPMockProvider and V4HTTPMockProvider. I guess this part ```"contentType": "application/json", "encoded": false``` appears only in V4 where we have body containing "content" and "contentType". Maybe pactflow should ignore contentType and encoded during pact and provide specification comparison.

paul
2023-01-18 16:56
has joined #pact-go

basma.eldesouky
2023-01-19 10:24
has joined #pact-go

alex.strizhak
2023-01-19 13:12
has joined #pact-go

laura.porpiglia
2023-01-19 13:56
has joined #pact-go

chimein.1234
2023-01-19 16:13
has joined #pact-go

john295
2023-01-19 23:12
has joined #pact-go

dominik.lukac.96
2023-01-20 10:33
has joined #pact-go

luca.narbone
2023-01-20 16:39
has joined #pact-go

bram.hautekiet
2023-01-22 22:32
has joined #pact-go

matt.fellows
2023-01-23 01:05
Yeah, something is definitely not right here Viktoriia. Could you please raise a bug on the git repo?

vika.karman
2023-01-23 07:03
sure , I will. Thank you!

nuno.frias
2023-01-23 10:21
Hi all, Just wanted confirmation regarding provider states. Pact only calls the next provider state when the previous one successfully returns (no panic or return error) correct? I.e. provider states are always synchronously executed in the order they were specified in the contract, correct?

nuno.frias
2023-01-23 10:22
I ask this because I am experiencing a race condition in one of my provider tests and I want to exclude Pact as a cause.

matt.fellows
2023-01-23 12:20
I?m not sure the order in the contract is guaranteed. But they are called synchronously before the test is called, yes, and subsequent states won?t be called if one fails

nuno.frias
2023-01-23 12:21
Thank you :+1:

benjamin.hess
2023-01-23 23:55
has joined #pact-go

steve.jefferies
2023-01-24 09:47
has joined #pact-go

will
2023-01-24 11:20
Hey all! I?m looking through the examples in pact-go, and in some of the tests where you?re specifying things like headers, some the values that are strings look like `S("string")` and I have absolutely no idea what the `S` relates to. GoLand obvs complains about it as well, but I?ve noticed if you add the flag to ignore the file by the build tool, it stops complaining. Anyone have any ideas what it?s for or what it does? I?m guessing it?s meant to represent a string value to Pact, but then not sure why GoLand doesn?t like it

matt.fellows
2023-01-24 11:23
In some examples `S` is aliased to a function, because the type it accepts is a matcher

matt.fellows
2023-01-24 11:23
I'm guessing goland doesn't like type aliases?

will
2023-01-24 11:32
Hmmm so looking in https://github.com/pact-foundation/pact-go/blob/2.x.x/examples/consumer_v3_test.go, I?m not sure what S is meant to alias too :thinking_face:

will
2023-01-24 11:33
Oh I?ve found it

will
2023-01-24 11:33
It?s in the basic_test.go file

will
2023-01-24 11:33
All fixed Matt, thanks for the quick response :smile:

will
2023-01-24 11:36
Also Matt, one other question whilst you?re here. How come all the pact libraries continue to support multiple versions of the Pact spec? It feels like it would be more straightforward to just deprecate the prior version of the spec when the new one is released, or at least, it?s felt kinda confusing coming into Pact with fresh eyes and not really understanding why there are multiple examples with diff versions of Pact and it not being super obvious what should or shouldn?t be used :smile:

aoife.drury
2023-01-24 14:36
has joined #pact-go

perger1984
2023-01-24 21:04
has joined #pact-go

ajaytaneja
2023-01-25 13:18
has joined #pact-go

will
2023-01-25 13:52
Anyone any ideas on printing out response after the verifier has run? Currently getting a 422 back from our provider, and the logs that are getting printed are super verbose and i?m not sure what?s meant to be what. Can I just stick something in an afterEach hook? And if so, how do I access the response?

petr.sebek
2023-01-25 14:20
has joined #pact-go

sean.mccann
2023-01-25 15:25
has joined #pact-go

nirob726
2023-01-26 12:25
has joined #pact-go

giuseppe.aina
2023-01-26 17:45
has joined #pact-go

boris.pogrebitskiy
2023-01-26 23:00
has joined #pact-go

matt.fellows
2023-01-26 23:26
hmmm I don?t think we provide access to the request/response cycle. We could potentially expose that though, as it?s just standard HTTP middleware

matt.fellows
2023-01-26 23:26
If you wanted to share the logs, I can see if I can help, and also improve the logging

rafael.luiz-cavalcant
2023-01-27 00:00
has joined #pact-go

zkocsihorvath
2023-01-27 13:47
has joined #pact-go

jorgen.x.andersson
2023-01-27 14:56
has joined #pact-go

mlapis
2023-01-29 10:56
has joined #pact-go

tim.malseed
2023-01-30 04:52
has joined #pact-go

matt.corby-eaglen
2023-01-30 11:47
has joined #pact-go

will
2023-01-30 11:56
Thanks Matt, I think it?s actually okay though, gonna leave it to my devs to figure out what the actual issue is. But yeah if I?m the first person asking, probably isn?t that much of a requirement. If anything it just suggests I?m too lazy to actually setup the service locally to figure it out :grin:

matt.fellows
2023-01-30 12:11
haha no probs

ulises.cervino
2023-01-30 12:38
has joined #pact-go

m.gruehn
2023-01-30 13:04
has joined #pact-go

will
2023-01-30 13:34
Actually Matt, so briefly, all our services are deployed in k8s. Some of the services have dependant services that means it?s difficult to just spin up a service by itself to test against. So we?re currently thinking that the way we?d want to use pact is? ? On PR, have a github action that deploys the branched version of the service into our dev env ? Run the Pact tests against it ? Redeploy the main branch back into dev env But in this scenario, if we get a 422 response back for a test that was expecting a 201, all we really get back in the error messaging from Pact is that the body doesn?t match, and that the status doesn?t match, but doesn?t return back anything we got from the error response, so makes it a bit more difficult to figure out any errors without trying to dive into logs/traces etc. Ideally, I?d love to be able to also print out the response body on error, so we can glean more info from the Pact test itself. Is there any way to handle this currently in Pact, or does it look like it would be a feature request of some kind? And if so, do I just need to raise that on Github?

martin.ineichen
2023-01-30 15:07
has joined #pact-go

ch.pascucci
2023-01-30 15:22
has joined #pact-go

grace.tree
2023-01-30 16:03
has joined #pact-go

pryan
2023-01-30 21:25
has joined #pact-go

andy.jenness
2023-01-30 21:29
has joined #pact-go

jcarlos.anast
2023-01-31 12:24
has joined #pact-go

leonardo.saragiotto
2023-01-31 12:32
has joined #pact-go

will
2023-01-31 15:32
Also sorry for the ping @matt.fellows, our hours are really out of sync with us being on almost opposite sides of the world :sweat_smile:, but if there?s any chance you?d have any suggestions or thoughts for the above, I?d really appreciate it :slightly_smiling_face:

barry.irvine
2023-02-01 15:52
has joined #pact-go

marcin.slowiak.007
2023-02-01 18:28
has joined #pact-go

hoon.jung
2023-02-01 23:53
has joined #pact-go

andhika.hasiholan06
2023-02-02 03:51
has joined #pact-go

jhordies
2023-02-02 09:59
has joined #pact-go

amanda.santos
2023-02-02 14:19
has joined #pact-go

keith.w
2023-02-02 15:57
has joined #pact-go

gazal.gafoor
2023-02-03 00:13
has joined #pact-go

eschroeder
2023-02-03 17:15
has joined #pact-go

marunachalam1
2023-02-04 02:16
has joined #pact-go

loc.daot
2023-02-06 07:37
has joined #pact-go

ondrej.hajek
2023-02-06 09:45
has joined #pact-go

shravan.baira
2023-02-06 11:16
has joined #pact-go

cameron.doyle
2023-02-06 11:17
has joined #pact-go

ckarlborg45
2023-02-06 11:29
has joined #pact-go

itzhak
2023-02-06 11:56
has joined #pact-go

prashant.singh
2023-02-06 14:05
has joined #pact-go

georgina.sallery
2023-02-06 15:18
has joined #pact-go

guptadaksh56
2023-02-06 20:40
has joined #pact-go

brendanmbliss
2023-02-06 23:14
has joined #pact-go

helloyuanyuan
2023-02-07 02:25
has joined #pact-go

matt.fellows
2023-02-07 03:45
My apologies, I did totally miss this (we had a number of workshops last week so was a bit flat out)

matt.fellows
2023-02-07 03:46
> Is there any way to handle this currently in Pact, or does it look like it would be a feature request of some kind? And if so, do I just need to raise that on Github? yes please, a feature request on GitHub would be great, and we?ll see if we can find a way

will
2023-02-07 09:42
Nice, thanks Matt, will raise one

will
2023-02-07 09:49
Hey all. I?m trying to run pact-go in docker in our CI/CD, but I?m having issues building the container in CI. The plan is to create a test binary in an initial build stage, and then copy that binary alone into the next stage to keep the image size down. So in the build stage, I?m downloading and unzipping the FFI library into the correct location, but when I then try to build the binary, pact-go seems to have issues with finding the library that cause the build to fail. There?s no other obvious setup thats mentioned on the github, has anyone else had any success in getting a docker image built with pact-go?

matt.fellows
2023-02-07 10:05
Mind sharing the Dockerfile? I can take a look for you

matt.fellows
2023-02-07 10:05
when you say ?build the binary? which one - pact go?

will
2023-02-07 10:06
```# syntax=docker/dockerfile:1 FROM europe-docker.pkg.dev/management1c0c88c4/oci/go:latest AS builder USER root ARG NAME ARG VERSION=unknown ARG GITHUB_AUTH_TOKEN ENV VERSION=$VERSION ENV GITHUB_AUTH_TOKEN=$GITHUB_AUTH_TOKEN ENV GOOUT=. COPY . . RUN \ wget https://github.com/pact-foundation/pact-reference/releases/download/libpact_ffi-v0.4.0/libpact_ffi-linux-x86_64.so.gz RUN gunzip libpact_ffi-linux-x86_64.so.gz RUN mv libpact_ffi-linux-x86_64.so /usr/local/lib/libpact_ffi.so RUN ldconfig /usr/local/lib/libpact_ffi.so RUN \ GOMODCACHE=/usr/src/.go/pkg/mod \ go test -c ./internal/provider/mas # Stage 2 - Copy binary from Build Stage FROM pactfoundation/pact-cli:latest COPY --from=builder /mas.test /go-tests COPY --from=builder /pact/entrypoint.sh /go-tests ENTRYPOINT ["/go-tests/entrypoint.sh"]``` There?s still some stuff I?ve been playing around with in there, but this is the current state

will
2023-02-07 10:07
And building the binary I mean the `go test -c` command

matt.fellows
2023-02-07 10:10
ta

geetika.joshi
2023-02-07 10:25
has joined #pact-go

erik.haartmans
2023-02-07 10:31
has joined #pact-go

matt.fellows
2023-02-07 10:35
OK so I can?t reproduce with your docker image for various reasons (which are no doubt obvious to you :laughing: ) But what is obviously standing out is that it can?t access the `native` package


matt.fellows
2023-02-07 10:37
I?m wondering if the mod file is incorrect and hasn?t pulled in the package properly?

will
2023-02-07 10:38
Haha yeah thought you?d struggle to replicate :smile: Okay let me take a gander at that package

will
2023-02-07 10:40
Hmmm so I?ve not explicitly got the native package called out anywhere, but I?m guessing it would just implicitly be apart of `http://github.com/pact-foundation/pact-go/v2` anyways right?

will
2023-02-07 10:42
Our `go.sum` currently has the following two lines ```http://github.com/pact-foundation/pact-go/v2 v2.0.0-beta.17.0.20230125022501-fa1a8deab0a0 h1:z0o1WaPGcDEHQ8uNRfwL0V6OfWqAt7/P26jWmMHn8TA= http://github.com/pact-foundation/pact-go/v2 v2.0.0-beta.17.0.20230125022501-fa1a8deab0a0/go.mod h1:kB2X26JGY+sd07XdG9LI4OK+aY8cTQ/IB56oBg2wT9o=``` And `go.mod` has ```http://github.com/pact-foundation/pact-go/v2 v2.0.0-beta.17.0.20230125022501-fa1a8deab0a0``` I?ve just used `go install` to add them

matt.fellows
2023-02-07 10:54
I think so

matt.fellows
2023-02-07 10:55
I don?t think you do need all of the sub packages there, but if it was just the consumer that could be a problem.

will
2023-02-07 10:56
Have you had any experience with running it in github actions? Part of the reason I am where I am is because there didn?t seem to be a clear way to generate the contract in one action, and then pass the contract into the CLI docker image in order to push it into the broker

will
2023-02-07 10:56
I?m not sure if I?m missing something and there?s actually a more sensible way to do it perhaps

matt.fellows
2023-02-07 10:57
oh right, then there is definitely a way to do that


matt.fellows
2023-02-07 10:57
I was about to question the whole enterprise of build stages, because I can?t see why that?s a good thing to do :laughing:

will
2023-02-07 10:57
I am all ears]

will
2023-02-07 10:58
Hahaha yeah it seemed like the most simple course when I was chatting with one of my devs. Because of the FFI lib pre-req, I didn?t know how to get that running in actions

matt.fellows
2023-02-07 10:58
> Have you had any experience with running it in github actions? Part of the reason I am where I am is because there didn?t seem to be a clear way to generate the contract in one action, and then pass the contract into the CLI docker image in order to push it into the broker so you just want to: 1. Run the pact tests 2. Publish the contract file In a single action, or must it be across multiple stages?


matt.fellows
2023-02-07 10:59
(please ignore the use of tags, it is not really important for the build, but should be using `--branch` because that?s what we tell people to do)

will
2023-02-07 10:59
A single action in itself would be fine ye. Currently the test runs as part of the unit tests, but the pact one always fails because the lib isn?t installed iirc

will
2023-02-07 11:00
That publish command is part of the CLI right>

will
2023-02-07 11:01
Ah yeah its the docker image

matt.fellows
2023-02-07 11:01
Apologies, the latest version of that for the 2.x.x branch is https://github.com/pact-foundation/pact-go/blob/2.x.x/Makefile

matt.fellows
2023-02-07 11:01
it?s very similar, but there are other parts of the Makefile that might be helpful - e.g. installing the lib

matt.fellows
2023-02-07 11:01
I have to run, but hopefully the info there is helpful?

will
2023-02-07 11:02
Yeah I?ll see where I can get with this, thanks Matt. One last q, do these all run as part of a single action, or is it across multiple?

matt.fellows
2023-02-07 11:04
I run it as a single. There is usually no need to delay publishing the pact file. You could have it as a separate step in the pipeline (we do that in our examples, see howtoexamples) but that?s up to you


matt.fellows
2023-02-07 11:04
The Pact Broker/PactFlow is designed to have large amounts of duplicate pacts published - so just send it without fear. It?s our job to make it performant

will
2023-02-07 11:06
Nice thanks Matt, really appreciate your help as always

rawisankarn
2023-02-07 12:59
has joined #pact-go

hiep.duong
2023-02-07 13:10
has joined #pact-go

michael.branders484
2023-02-07 14:08
has joined #pact-go

anda.rozenfelde
2023-02-07 14:33
has joined #pact-go

vietanhtran.dev
2023-02-08 04:44
has joined #pact-go

goyal.himanshu
2023-02-08 08:23
has joined #pact-go

jeroenlamain
2023-02-08 11:57
has joined #pact-go

pallavi.bose
2023-02-08 13:19
has joined #pact-go

adi.d
2023-02-08 16:25
has joined #pact-go

oriane.rodriguez
2023-02-08 16:59
has joined #pact-go

tdickman
2023-02-08 21:36
has joined #pact-go

george.croucamp
2023-02-09 05:14
has joined #pact-go

gcroucamp
2023-02-09 05:15
has joined #pact-go

tonis.ojandu
2023-02-09 09:46
has joined #pact-go

justyna
2023-02-09 10:03
has joined #pact-go

tomer.ghelber
2023-02-09 12:24
has joined #pact-go

tommy.chen
2023-02-10 00:39
has joined #pact-go

sayler.b
2023-02-11 03:46
has joined #pact-go

rm.bozhko
2023-02-12 16:27
has joined #pact-go

moid.abdul
2023-02-13 00:16
has joined #pact-go

sugi
2023-02-13 09:59
has joined #pact-go

sgeethu21
2023-02-13 11:01
has joined #pact-go

kp1289
2023-02-13 11:59
has joined #pact-go

nuno.frias
2023-02-13 13:42
Hi all, Is it possible to inject a value from provider state into the URL of the request? If so is there any example for Pact-go ? (I am using v2.x.x)

rahul.jalagadugu
2023-02-13 15:37
has joined #pact-go

will
2023-02-13 18:03
Hey @matt.fellows is this mainBranch property available to configure anywhere for consumers in pact-go?

will
2023-02-13 18:06
What?s the context around what you want to do exactly? There are examples https://github.com/pact-foundation/pact-go/blob/2.x.x/examples/provider_test.go of modifying the request before the test runs to add in authorization headers. It?s possible you could use that same function to modify the URL as well, but I?m not 100% clear on whether that?s necessarily a good idea or not

nuno.frias
2023-02-13 18:12
I have some ID's on the URL that need to match the ID's of objects created on the provider test.

omatuzenko.hse
2023-02-13 18:14
has joined #pact-go

nuno.frias
2023-02-13 18:14
The `RequestFilter` is a good shout. I was looking at the Pact-go equivalent of https://pactflow.io/blog/injecting-values-from-provider-states/ for URL, but `RequestFilter` should do it.

tyler.fleurant
2023-02-13 21:56
has joined #pact-go

matt.fellows
2023-02-13 23:32
The consumer side of Pact Go doesn?t need to do anything here. The main branch property is set when you publish the contract, which you do using the CLI tools

matt.fellows
2023-02-13 23:32
(howtocli)




will
2023-02-14 09:15
Nice thank youuu

swilkinson
2023-02-14 09:59
has joined #pact-go

brooks
2023-02-14 18:41
has joined #pact-go

carlos.lopez
2023-02-14 19:20
has joined #pact-go

carlos.lopez
2023-02-14 21:16
@carlos.lopez has left the channel

sam.mirzaee
2023-02-15 02:35
has joined #pact-go

kam.sobon
2023-02-15 11:26
has joined #pact-go

tomer.ghelber
2023-02-15 12:45
@tomer.ghelber has left the channel

mail391
2023-02-15 14:59
has joined #pact-go

jmoreno
2023-02-15 21:27
has joined #pact-go

marcio.duarte
2023-02-16 03:38
has joined #pact-go

nuno.frias
2023-02-16 14:03
Thanks @matt.fellows So on the consumer side I would have to put a placeholder on the URL. Something like this: ```... WithRequest(http.MethodPost, "/ns/${uuid}/search, func(req *consumer.V4RequestBuilder) { req.Header("Content-Type", matchers.S("application/json")) ...```

nuno.frias
2023-02-16 14:04
Assuming I returned provider state like in your example: ``` return models.ProviderStateResponse{"uuid": "1234"}, nil```

bryen.vieira
2023-02-16 16:34
has joined #pact-go

ryan319
2023-02-16 22:50
has joined #pact-go

zhig.ivan
2023-02-17 08:56
has joined #pact-go

matt.fellows
2023-02-17 08:56
Yes, except on the consumer side imyou need to use a matcher and not a string: `FromProviderState(expr, example)` See the consumer docs for all matchers

vika.karman
2023-02-17 10:59
Finally I got to issue creation and I've found that even pact generated by the existing tests in 2.x.x branch has the mentioned fields. I've included the link to the lines: https://github.com/pact-foundation/pact-go/issues/273

yerken.tussupbekov
2023-02-17 11:40
has joined #pact-go

matt.fellows
2023-02-17 11:47
Sorry I must have misread your original thread here. Are you having problems or not? The provider test in the repo passes, the contract file is just how Pact serialises the interaction.

matt.fellows
2023-02-17 11:47
Pactflow does not yet not how to properly render v4 pacts. This is coming soon, and is possibly why the confusion exists

vika.karman
2023-02-17 11:49
ah! I guess that is my answer! "_*Pactflow does not yet not how to properly render v4 pacts.*_"

vika.karman
2023-02-17 11:50
when do you expect to add this? approximately

matt.fellows
2023-02-17 11:50
Sorry about the confusion. I must have felt there was a bug where the actual field was expected and the test was failing, but it's just how it shows in the UI

matt.fellows
2023-02-17 11:50
Aiming this quarter


vika.karman
2023-02-17 11:51
cool! thank you very much

matt.fellows
2023-02-17 11:52
Np. I'll close off that issue

vika.karman
2023-02-17 11:52
:+1:

vika.karman
2023-02-17 11:53
and when is the plan to release 2.x.x as a stable version not beta?

nuno.frias
2023-02-17 15:12
Brilliant. Thank you very much @matt.fellows

iamchughmayank
2023-02-17 18:30
has joined #pact-go

jake.kline
2023-02-18 04:11
has joined #pact-go

culudamar
2023-02-20 08:12
has joined #pact-go

gawaine.ogilvie
2023-02-20 17:01
has joined #pact-go

james414
2023-02-22 10:00
has joined #pact-go

nbolam
2023-02-22 20:26
has joined #pact-go

lambent21
2023-02-23 13:35
has joined #pact-go

pach
2023-02-23 17:34
has joined #pact-go

richard.ruiter
2023-02-24 06:43
has joined #pact-go

spalle
2023-02-24 10:54
has joined #pact-go

alex637
2023-02-24 14:32
has joined #pact-go

egrep
2023-02-25 17:32
has joined #pact-go

ykamali
2023-02-26 05:10
has joined #pact-go

kripa.kurian
2023-02-27 04:35
has joined #pact-go

jordan.brooks
2023-02-27 09:46
has joined #pact-go

courtel.yann
2023-02-27 10:47
has joined #pact-go

nuno.frias
2023-02-27 11:33
Hi all I would like to be able to use regex as part of the `FromProviderState` matcher. This would look like something like this `FromProviderState(expr, example, regex)` . This would allow me to enforce a tighter rule on the format of that field, which could be useful because I have no guarantees that the the value returned from provider state complies with the format the consumer is expecting. I cannot implement a custom matcher because the `Matcher` interface (in `matchers/matcher.go`) has a private method `isMatcher` -- preventing implementations outside of the `matchers` package. Is anyone aware of an alternative ? Is it worth creating a issue to convert the `isMatcher` into a public method ?

nathan.hickson
2023-02-27 13:07
has joined #pact-go

mark.simpson
2023-02-27 13:08
has joined #pact-go

masykur.sn
2023-02-27 15:21
has joined #pact-go

matt.fellows
2023-02-27 23:15
It?s private because you _can?t_ just add new user-defined matchers

makifkus
2023-02-28 03:51
has joined #pact-go

nuno.frias
2023-02-28 12:32
Thanks @matt.fellows Any idea how I could validate the attribute matches the regex? Short of building that validation on the state handler -- I don't like this approach because it wouldn't be reflected on the contract.

sathish.sundararajan
2023-02-28 16:17
Any timeline on when a fix would be available for the random panics ? We started to observe quite often and blocking us from using provider tests. Thanks. @jason.taylor2 https://github.com/pact-foundation/pact-go/issues/269

jacob.waller
2023-02-28 21:08
has joined #pact-go

dipak8959
2023-02-28 21:18
has joined #pact-go

matt.fellows
2023-02-28 23:22
I don?t believe you can put a regex matcher in there, it can only check the type of the value provider

matt.fellows
2023-02-28 23:22
i.e. it?s a `Like` matcher

matt.fellows
2023-02-28 23:26
I don?t have any timelines for this Sathish. We haven?t gotten to the bottom of the problem, and until we do that it?s going to be difficult to say when it will be fixed. If you had any views on what the source of the issue might be, any information you can share would obviously be very helpful

sathish.sundararajan
2023-03-01 03:23
Sure Matt! We will try to find out on our end and let you know! Thanks

sanketh.shanbhag
2023-03-01 03:57
has joined #pact-go

adam.cox
2023-03-01 12:34
has joined #pact-go

gazal.gafoor
2023-03-01 13:30
@gazal.gafoor has left the channel

steve.short
2023-03-01 15:14
has joined #pact-go

kgrady
2023-03-01 18:58
has joined #pact-go

nuno.frias
2023-03-01 20:18
Thank you Matt

nuno.frias
2023-03-01 20:23
Hi all Is there any chance to increate the timeout to run the state handlers? I am getting this error: ```Err(Provider state failed: (interaction_id: ...) Invalid response: error sending request for url (http://localhost:50159/__setup): operation timed out)```

matt.fellows
2023-03-02 02:03
It?s definitely possible. We should perhaps expose that - could you please raise a feature request on github?

pratima.patil
2023-03-02 11:13
has joined #pact-go

nuno.frias
2023-03-02 12:09
Will do

shilpa199350
2023-03-02 12:40
has joined #pact-go

syamphaneendrak
2023-03-02 16:21
has joined #pact-go

neeraj.sharma
2023-03-02 16:33
has joined #pact-go

dominik.chmielarz
2023-03-02 16:55
has joined #pact-go

xchen
2023-03-02 18:59
has joined #pact-go

fdawson
2023-03-03 08:15
has joined #pact-go

tom.meldrum
2023-03-03 13:02
has joined #pact-go

dragos.neagu
2023-03-03 16:44
has joined #pact-go

facundo.g
2023-03-06 12:13
has joined #pact-go

nuno.frias
2023-03-06 14:09
Hi Matt Here is the new feature request: https://github.com/pact-foundation/pact-go/issues/277

michael.bryson
2023-03-06 14:59
has joined #pact-go

kingsley
2023-03-06 22:47
has joined #pact-go

nuno.frias
2023-03-07 12:13
Thank you very much Matt

nuno.frias
2023-03-07 12:14
Will take a look as soon as I can.

marckpuiu
2023-03-07 15:58
has joined #pact-go

facundo.g
2023-03-08 09:31
@facundo.g has left the channel

jason.taylor2
2023-03-08 15:00
am running pact-go 2.x.x branch and v3 matchers. the header matching seems to be always doing a strict match. is that expected? for example, given this: ```Header("x-b3-spanid", matchers.Like("flexible")).``` The pact has: ```x-b3-spanid": "flexible",``` And then running yields: ``` 1.1) includes header 'x-b3-spanid' with value 'flexible' Expected header 'x-b3-spanid' to have value 'flexible' but was 'bee11777fdc9b79c'```

duncan3142
2023-03-08 19:42
has joined #pact-go

william.stewart
2023-03-08 20:25
has joined #pact-go

matt.fellows
2023-03-09 00:35
hmm it shouldn?t

matt.fellows
2023-03-09 00:35
could you please share a `debug` log for the test?

trc229
2023-03-09 01:34
has joined #pact-go

zaira.zafar
2023-03-09 10:41
has joined #pact-go

dominik.goltermann
2023-03-09 15:31
has joined #pact-go

sharathkonda
2023-03-09 15:37
has joined #pact-go

allen.ayala
2023-03-09 16:33
has joined #pact-go

slawomir.pawluk
2023-03-09 18:22
has joined #pact-go

casavelha
2023-03-09 19:49
has joined #pact-go

nikita.gupta
2023-03-09 22:21
has joined #pact-go

pjayakumar
2023-03-10 02:21
has joined #pact-go

josh.marlow
2023-03-10 15:10
has joined #pact-go

jason.taylor2
2023-03-10 16:24
opened an issue with the diff to apply to the example test to reproduce: https://github.com/pact-foundation/pact-go/issues/281

patilb
2023-03-11 17:02
has joined #pact-go

renan.santos
2023-03-11 18:46
has joined #pact-go

keren.eckshtein
2023-03-12 08:57
has joined #pact-go

sr
2023-03-12 11:58
has joined #pact-go

gokuldot
2023-03-12 17:30
has joined #pact-go

ldgaribello
2023-03-13 06:23
has joined #pact-go

lidan.liu
2023-03-13 10:45
has joined #pact-go

vipin.kumar
2023-03-13 12:29
has joined #pact-go

bknapik
2023-03-13 17:13
has joined #pact-go

ravi0894
2023-03-13 17:38
has joined #pact-go

anji.boddupally
2023-03-13 20:37
has joined #pact-go

voon.wong
2023-03-14 01:34
has joined #pact-go

gigamac
2023-03-14 08:09
has joined #pact-go

ivstam
2023-03-14 08:43
has joined #pact-go

nuno.frias
2023-03-14 10:44
Works perfectly. Thank you Matt.

melikesezin
2023-03-14 14:17
has joined #pact-go

gopishankar.haridas
2023-03-14 16:42
has joined #pact-go

rajasekaran.parthiban
2023-03-14 20:13
has joined #pact-go

sbanerjee
2023-03-15 02:46
has joined #pact-go

nuno.frias
2023-03-15 10:17
Looks like the build failed :disappointed: . I can give it a look if no-one's already it.

matt.fellows
2023-03-15 10:47
Thanks, it?s failing due to https://github.com/pact-foundation/pact-go/issues/269. If you can solve that, i?ll track you down and give you a hug. Or failing that, buy you a coffee or something :laughing:

matt.fellows
2023-03-15 10:49
The real problem is I forgot to push with tags - build running now: https://github.com/pact-foundation/pact-go/actions/runs/4425457986

matt.fellows
2023-03-15 10:49
sorry about that!

nuno.frias
2023-03-15 10:54
No problem whatsoever. I though strange the previous issue was the culprit as the builds for go1.17 and 1.18 failed.

matt.fellows
2023-03-15 11:09
Look like it just released! :tada:

nuno.frias
2023-03-15 11:13
Just saw. Thank you very much. :raised_hands:

kurt_schriefer
2023-03-15 13:21
has joined #pact-go

andreas530
2023-03-15 22:32
has joined #pact-go

santiago.rendong
2023-03-15 23:21
has joined #pact-go

christine.awofeso
2023-03-16 09:58
has joined #pact-go

nuno.frias
2023-03-16 14:57
On my consumer tests I have used some random values in certain matcher examples (e.g. `time.Now()`). This means that the deduplication mechanism (https://docs.pact.io/pact_broker/advanced_topics/consumer_version_selectors#deduplication) will not be able effectively deduplicate the contracts, correct ?

konstantin.manna
2023-03-16 15:04
has joined #pact-go

yousafn
2023-03-16 15:29
Correct, if you try and upload the contract with the same commit sha you should be prevented if there is differing data in your pact file. You can use a date matcher (if there is one in go, or reg) and use a generator to provide a fixed value if that is possible for your test

emgarcia
2023-03-16 15:44
has joined #pact-go

john.goodwin
2023-03-16 15:51
has joined #pact-go

tomasz.kowalczyk
2023-03-16 15:51
has joined #pact-go

samir.ferreira
2023-03-16 16:27
has joined #pact-go

kripa.kurian
2023-03-16 19:31
@kripa.kurian has left the channel

raess.simon
2023-03-16 23:02
has joined #pact-go

anshu.ranjan1002
2023-03-17 21:59
has joined #pact-go

mptinternational
2023-03-18 18:12
has joined #pact-go

16728365
2023-03-19 14:30
has joined #pact-go

nuno.frias
2023-03-19 18:42
Thanks :+1: I am very aware that you can't upload a contract with the same commit sha if there are differences in the contract. My concern is that when you do the provider verification, the deduplication mechanism uses the full contract content as the basis for deduplication, which means that if the example data in the contract is different between the main branch and the feature branch (even though the rules are the same) the provider test will run twice -- assuming your consumer version selectors pick up the 2 contracts.

nuno.frias
2023-03-19 18:44
It seems that having the deduplication mechanism exclude the examples would be sensible.

brick777
2023-03-19 21:47
has joined #pact-go

matt.fellows
2023-03-19 22:46
yes, it would be ideal. Worth raising a feature at http://pact.canny.io if not already there. I think this was raised recently somewhere in slack also

mark.ingram
2023-03-20 11:31
has joined #pact-go

nuno.frias
2023-03-20 13:02
Thanks Matt will do


jo.laing
2023-03-20 17:06
has joined #pact-go

erich.buri
2023-03-20 22:07
has joined #pact-go

sandy.oberoi
2023-03-20 22:15
hi all, checking if you have an example for running a pact consumer test using a twirp client? I am referencing this https://github.com/pact-foundation/pact-go/blob/2.x.x/examples/grpc/grpc_consumer_test.go to setup the test this is the error I am getting ```net/http: HTTP/1.x transport connection broken: malformed HTTP response ```

matt.fellows
2023-03-20 22:24
not that I?m aware of. How does twirp work?

xiaorong.ruby
2023-03-21 09:34
has joined #pact-go

markcox20
2023-03-21 10:08
has joined #pact-go

oloruntobi.ayilara
2023-03-21 14:01
has joined #pact-go

pankaj_kumar39
2023-03-21 14:18
has joined #pact-go

ravi_shankar_lakkims
2023-03-21 14:18
has joined #pact-go

sathish.nilla
2023-03-21 14:19
has joined #pact-go

sikandar_kumar.singh
2023-03-21 14:19
has joined #pact-go

sandy.oberoi
2023-03-21 17:20
https://blog.twitch.tv/en/2018/01/16/twirp-a-sweet-new-rpc-framework-for-go-5f2febbf35f/ is a RPC framework that supports communication over both http/1.1 and http/2 we are using protobuf for defining our apis i could try to setup an example twirp client based on the https://github.com/pact-foundation/pact-go/tree/2.x.x/examples/grpc you have, if that would help

benjamin.earle
2023-03-21 19:23
has joined #pact-go

sanjaysingh99in
2023-03-22 00:57
has joined #pact-go

matt.fellows
2023-03-22 03:20
You might need to share how you?ve set the example up. I think the gRPC plugin is not re-usable for this purpose, so you?d need to set the transport back to HTTP. What?s the payload you?re sending over it?

rafalmaciak
2023-03-22 08:03
has joined #pact-go

jyothy18
2023-03-22 09:23
has joined #pact-go

haiyang.huang
2023-03-22 10:30
has joined #pact-go

denispegan4
2023-03-22 13:14
has joined #pact-go

denispegan4
2023-03-22 14:21
Hey guys, I'm testing message-queue-based service (lambda) and have a question: Currently I get the error when I try to validate the contract: `[ERROR] API handler start failed: accept tcp [::]:42053` But basically I just need to validate the Handler's "handle" function and can do it in my unit tests by calling that func with mocked Handler's dependencies. I want to do the same with my contract tests. Is it possible to validate the contract wihout the need to run local Handler or the running Handler is required?

denispegan4
2023-03-22 20:05
if i'm not mistaken it shouldn't launch any mocks for messages as per description

ulises.cervino
2023-03-22 21:01
@ulises.cervino has left the channel

tranghetti
2023-03-22 21:15
has joined #pact-go

matt.fellows
2023-03-23 00:26
Could you please share your code?


amruta_mandavilli
2023-03-23 06:23
has joined #pact-go

shubhamshriram.shinde
2023-03-23 06:34
has joined #pact-go

juliemarierosok
2023-03-23 08:20
has joined #pact-go

colin.aygalinc
2023-03-23 09:23
has joined #pact-go

me1685
2023-03-23 10:53
has joined #pact-go

gregpovorozniuk
2023-03-23 11:32
has joined #pact-go

denispegan4
2023-03-23 14:42
@matt.fellows thanks for your answer! My sample code is: https://github.com/denispeganovri/sampleHandler And unfortunately, I'm not able to run your example: `den@WIN-S95P35K3NPM:/.../pact-go/examples$ go test -run TestMessagePact` `...` `../consumer/http.go:82:31: undefined: native.MockServer` `../consumer/http.go:114:24: undefined: native.NewHTTPPact` `../consumer/http.go:117:48: undefined: native.SPECIFICATION_VERSION_V2` `../consumer/http.go:119:48: undefined: native.SPECIFICATION_VERSION_V3` `../consumer/http.go:121:48: undefined: native.SPECIFICATION_VERSION_V4` `../consumer/http.go:123:9: undefined: native.Init` `../consumer/http.go:316:16: undefined: native.GetTLSConfig` `../consumer/interaction.go:16:35: undefined: mockserver.Interaction` `../consumer/http_v4.go:461:65: undefined: native.INTERACTION_PART_REQUEST` `../consumer/http_v4.go:542:65: undefined: native.INTERACTION_PART_RESPONSE` `../consumer/http_v4.go:542:65: too many errors` `FAIL http://github.com/pact-foundation/pact-go/v2/examples [build failed]` And your example seems to be helpful, could you help me run this consumer_v3_test please?

mpalla553
2023-03-23 14:51
has joined #pact-go

denispegan4
2023-03-23 14:56
In my code I get such error when I try to validate the contract: `den@WIN-S95P35K3NPM:/.../sampleHandler/handler$ go test -run Test_verifyContract` `2023/03/23 15:51:47 [INFO] checking pact-provider-verifier within range >= 1.36.1, < 2.0.0` `2023/03/23 15:51:47 [INFO] checking pact-broker within range >= 1.22.3` `2023/03/23 15:51:48 [INFO] checking pact-mock-service within range >= 3.5.0, < 4.0.0` `2023/03/23 15:51:48 [WARN] state handler not found for state: given a SQS message` `2023/03/23 15:51:48 [ERROR] *message handler not found for message description: expected to receive no error*` `2023/03/23 15:51:48 [ERROR] *API handler start failed: accept tcp [::]:41565: use of closed network connection*` `--- FAIL: Test_verifyContract (0.86s)` `--- FAIL: Test_verifyContract/has_matching_content (0.00s)` `pact.go:638: Verifying a pact between Sample Consumer and Sample Handler Given given a SQS message expected to receive no error has matching content` `pact.go:644: Verifying a pact between Sample Consumer and Sample Handler Given given a SQS message expected to receive no error has matching content` `An error was raised while verifying the message. The response body is:` `FAIL` `exit status 1` `FAIL sampleHandler/handler 0.867s`

sumit.singh
2023-03-23 18:03
has joined #pact-go

quinton.miller
2023-03-23 19:18
has joined #pact-go

hurdledatrade
2023-03-24 11:24
has joined #pact-go

denispegan4
2023-03-24 13:19
Hi guys, I'm not able to run message provider test: https://github.com/pact-foundation/pact-go/blob/master/examples/messages/provider/message_pact_provider_test.go I get such error: `[WARN] state handler not found for state: an order exists` `[ERROR] API handler start failed: accept tcp [::]:40025: use of closed network connection` I've tried it on different machines (wsl, mac) but the error is the same. Could anyone help please?

srijan.c
2023-03-24 15:26
has joined #pact-go

andy.jenness
2023-03-24 20:17
cc @pryan

matt.fellows
2023-03-25 00:30
Hmm wondering if it's maybe an IPv6 thing? Can you please see if you can get a repro going by forking the repo and getting that test to fail on CI? Hard for us to see the problem otherwise

praveen.gangasani
2023-03-26 13:19
has joined #pact-go

denispegan4
2023-03-26 19:03
Hey @matt.fellows, thanks for your asnwer. I'm not the only one person who get such error, I've asked few more people to check and they get the same error. Could you check if you are able to run that example please? Was it working before?

matt.fellows
2023-03-27 02:34
```? consumer git:(master) go test -v -tags consumer . === RUN TestExampleMessageConsumer_UserExists 2023/03/27 13:33:10 [INFO] checking pact-provider-verifier within range >= 1.36.1, < 2.0.0 2023/03/27 13:33:12 [INFO] checking pact-broker within range >= 1.22.3 2023/03/27 13:33:13 [INFO] checking pact-mock-service within range >= 3.5.0, < 4.0.0 --- PASS: TestExampleMessageConsumer_UserExists (9.01s) === RUN TestExampleMessageConsumer_Order --- PASS: TestExampleMessageConsumer_Order (2.77s) === RUN TestExampleMessageConsumer_Fail message_pact_consumer_test.go:59: --- SKIP: TestExampleMessageConsumer_Fail (0.00s) PASS ok github.com/pact-foundation/pact-go/examples/messages/consumer 12.374s ? consumer git:(master) ../provider ? provider git:(master) go test -v -tags provider . === RUN TestExampleMessageProvider_Success 2023/03/27 13:33:32 [DEBUG] pact setup logging 2023/03/27 13:33:32 [DEBUG] pact setup 2023/03/27 13:33:32 [DEBUG] checking CLI compatibility 2023/03/27 13:33:32 [INFO] checking pact-broker within range >= 1.22.3 2023/03/27 13:33:32 [DEBUG] running binary pact-broker 2023/03/27 13:33:33 [DEBUG] checking version for binary pact-broker version 1.65.0 2023/03/27 13:33:33 [DEBUG] checking if version 1.65.0 within semver range >= 1.22.3 2023/03/27 13:33:33 [DEBUG] 1.65.0 satisfies constraints 1.65.0 >= 1.22.3 2023/03/27 13:33:33 [INFO] checking pact-mock-service within range >= 3.5.0, < 4.0.0 2023/03/27 13:33:33 [DEBUG] running binary pact-mock-service 2023/03/27 13:33:34 [DEBUG] checking version for binary pact-mock-service version 3.9.0 2023/03/27 13:33:34 [DEBUG] checking if version 3.9.0 within semver range >= 3.5.0, < 4.0.0 2023/03/27 13:33:34 [DEBUG] 3.9.0 satisfies constraints 3.9.0 >= 3.5.0, < 4.0.0 2023/03/27 13:33:34 [INFO] checking pact-provider-verifier within range >= 1.36.1, < 2.0.0 2023/03/27 13:33:34 [DEBUG] running binary pact-provider-verifier 2023/03/27 13:33:34 [DEBUG] checking version for binary pact-provider-verifier version 1.36.1 2023/03/27 13:33:34 [DEBUG] checking if version 1.36.1 within semver range >= 1.36.1, < 2.0.0 2023/03/27 13:33:34 [DEBUG] 1.36.1 satisfies constraints 1.36.1 >= 1.36.1, < 2.0.0 2023/03/27 13:33:34 [DEBUG] setting up a service manager 2023/03/27 13:33:34 [DEBUG] setting up a service manager 2023/03/27 13:33:34 [DEBUG] setting up a service manager 2023/03/27 13:33:34 [DEBUG] starting service creation monitor 2023/03/27 13:33:34 [DEBUG] starting service removal monitor 2023/03/27 13:33:34 [DEBUG] starting service removal monitor 2023/03/27 13:33:34 [DEBUG] starting service creation monitor 2023/03/27 13:33:34 [DEBUG] starting service removal monitor 2023/03/27 13:33:34 [DEBUG] starting service creation monitor 2023/03/27 13:33:34 [DEBUG] setting up a service manager 2023/03/27 13:33:34 [DEBUG] starting service removal monitor 2023/03/27 13:33:34 [DEBUG] starting service creation monitor 2023/03/27 13:33:34 [DEBUG] API handler starting: port 50078 ([::]:50078) 2023/03/27 13:33:34 [DEBUG] waiting for port 50078 to become available on localhost after 10s 2023/03/27 13:33:34 [DEBUG] pact provider verification 2023/03/27 13:33:34 [DEBUG] client: verifying a provider 2023/03/27 13:33:34 [DEBUG] waiting for port 50078 to become available on localhost after 10s 2023/03/27 13:33:34 [DEBUG] starting verification service with args: [/Users/matthew.fellows/development/public/pact-go/examples/messages/provider/../../pacts/pactgomessageconsumer-pactgomessageprovider.json --format json --provider-base-url http://localhost:50078 --provider PactGoMessageProvider --log-dir /Users/matthew.fellows/development/public/pact-go/examples/messages/provider/log --log-level DEBUG] 2023/03/27 13:33:39 [WARN] state handler not found for state: an order exists 2023/03/27 13:33:39 [ERROR] API handler start failed: accept tcp [::]:50078: use of closed network connection === RUN TestExampleMessageProvider_Success/Pact_between__and__ === RUN TestExampleMessageProvider_Success/has_matching_content pact.go:637: Verifying a pact between PactGoMessageConsumer and PactGoMessageProvider Given user with id 127 exists a user has matching content === RUN TestExampleMessageProvider_Success/has_matching_content#01 pact.go:637: Verifying a pact between PactGoMessageConsumer and PactGoMessageProvider Given an order exists an order has matching content --- PASS: TestExampleMessageProvider_Success (6.85s) --- PASS: TestExampleMessageProvider_Success/has_matching_content (0.00s) --- PASS: TestExampleMessageProvider_Success/has_matching_content#01 (0.00s) --- PASS: TestExampleMessageProvider_Success/Pact_between__and__ (0.00s) PASS ok http://github.com/pact-foundation/pact-go/examples/messages/provider 7.410s ? provider git:(master) pwd /Users/matthew.fellows/development/public/pact-go/examples/messages/provider```

matt.fellows
2023-03-27 02:34
Yes, it works for me

matt.fellows
2023-03-27 02:37
My guess is that `localhost` is mapped to an ipv6 address and either: 1. Pact Go doesn?t support ipv6 (which would basically mean something in go itself is misconfigured or doesn?t support it) 2. Your machine is not allowing clients to bind to ipv6 addresses. Can you check your `/etc/hosts` configuration to see what it is?

matt.fellows
2023-03-27 02:37
```? provider git:(master) host localhost localhost has address 127.0.0.1```

matt.fellows
2023-03-27 02:37
or run `host localhost`

yzxu
2023-03-27 07:27
has joined #pact-go

matt.fellows
2023-03-27 07:35
hmm strange. See also https://pact-foundation.slack.com/archives/C9UTHTFFB/p1679884470364199?thread_ts=1679663992.765239&cid=C9UTHTFFB. Let?s stick to one of the threads so we can follow the context if that?s OK?

matt.fellows
2023-03-27 07:44
OK looked at your code, there are 3 problems: 1. The scenario in your consumer doesn?t match up with the mapping in your provider 2. The provider state in your consumer doesn?t match up with the mapping in your provider 3. Your consumer is exact value matching, and your provider is returning a different value. Either return the exact value in your provider, or use a matcher in your consumer

matt.fellows
2023-03-27 07:44
Diff: ```diff --git a/handler/handler_contract_test.go b/handler/handler_contract_test.go index 11d6b8b..ed1b4b1 100644 --- a/handler/handler_contract_test.go +++ b/handler/handler_contract_test.go @@ -3,8 +3,9 @@ package handler import ( "path/filepath" - "http://github.com/pact-foundation/pact-go/dsl" "testing" + + "http://github.com/pact-foundation/pact-go/dsl" ) var data *SQSEvent @@ -14,7 +15,7 @@ func Test_verifyContract(t *testing.T) { // Map test descriptions to message producer (handlers) functionMappings := dsl.MessageHandlers{ - "received data": func(m dsl.Message) (interface{}, error) { + "expected to receive no error": func(m dsl.Message) (interface{}, error) { if data != nil { return data, nil } else { @@ -26,7 +27,7 @@ func Test_verifyContract(t *testing.T) { } stateMappings := dsl.StateHandlers{ - "data exists": func(s dsl.State) error { + "given a SQS message": func(s dsl.State) error { data = &SQSEvent{ SqsData: "12341234", }```

matt.fellows
2023-03-27 07:45
(sorry about the formatting part of the diff, my editor does that automatically)

matt.fellows
2023-03-27 07:45
The error is a red herring. It should actually just be a warning

denispegan4
2023-03-27 07:58
Hey @matt.fellows, I can see you have the same error in your logs: ```[ERROR] API handler start failed: accept tcp [::]:50078: use of closed network connection``` This is exactly what I am wondering about, could you look into that error please? Why it exists...

1248124408
2023-03-27 08:59
has joined #pact-go

daniel.redelberger
2023-03-27 09:07
has joined #pact-go

matt.fellows
2023-03-27 09:43
See other thread, it should be a `DEBUG` level item - I think it?s just the network adapter trying to bind to the various interfaces and rejecting the IPv6 one. It?s a red herring

matt.fellows
2023-03-27 09:44
The issue is unrelated


denispegan4
2023-03-27 13:59
@matt.fellows Many thanks for your detailed answer! Glad it's not a "real" error and will look into my code.

mohammed.a.ezzedine
2023-03-27 15:25
has joined #pact-go

kiran.malsetty
2023-03-27 17:20
has joined #pact-go

rchild
2023-03-27 18:46
has joined #pact-go

asoni
2023-03-27 20:23
has joined #pact-go

matt.fellows
2023-03-27 22:11
Awesome! No worries, thanks for the repro

yu.xie
2023-03-28 00:08
has joined #pact-go

gamer.fikri
2023-03-28 04:46
has joined #pact-go

shaun.carmody
2023-03-28 13:23
has joined #pact-go

christianschiepe
2023-03-28 13:50
has joined #pact-go

yu.xie
2023-03-28 17:28
Hi team, I?ve been trying to set-up `pact-go` in a monorepo/bazel environment, since it depends on `pact_ffi`? 1. I saw https://github.com/pact-foundation/pact-reference/pull/255 to bazelify pact-reference but it did not get much attention. 2. Another way I guess it might work is fetching the `.a` files as static library from releases like https://github.com/pact-foundation/pact-reference/releases/tag/libpact_ffi-v0.4.1 using https://bazel.build/rules/lib/repo/http, and then linking them through https://github.com/bazelbuild/rules_go/blob/master/docs/go/core/rules.md#go_library. Is there an officially recommended way to do this?

aberman
2023-03-28 19:24
has joined #pact-go

matt.fellows
2023-03-28 21:24
there is no official way with Bazel I?m afraid, I don?t know much about it

0xoscario
2023-03-29 03:38
has joined #pact-go

yu.xie
2023-03-30 00:22
Asking this question in a different way: In an automatic build system that you can?t pre-install stuff (such as bazel), to make pact-go work, you would need to download `pact_ffi` static library (i.e., `https://github.com/pact-foundation/pact-reference/releases/download/libpact_ffi-v0.4.1/libpact_ffi-osx-aarch64-apple-darwin.a.gz`) and then tell cgo to link it properly. What would be the arguments to ask cgo to use this `.a` file when linking?

yu.xie
2023-03-30 00:32
I saw cgo link opts are put here: https://github.com/pact-foundation/pact-go/blob/2.x.x/internal/native/lib.go The problem is how to override things like `/usr/local/lib -lpact_ffi` to make them point to the downloaded static library file.

matt.fellows
2023-03-30 02:11
That?s a good question. Does it _need_ to be a static library or could you use the shared lib? Or is it because you?re expecting to run on heterogeneous OS environments that you want to link to the archive?

matt.fellows
2023-03-30 02:12
> The problem is how to override things like `/usr/local/lib -lpact_ffi` to make them point to the downloaded static library file. I wish those arguments could be dynamic, but it seems the way cgo wants to work is that they must be pre-defined in the source code. e.g. it would be nice to allow a user to put the library wherever they want, possibly defined by an env var. I tried several variations on this but never landed on a solution. If there is a way we can update the `lib.go` file to have locations that work for Bazel environments, i?d happily accept a PR.

paddyhendy94
2023-03-30 12:48
has joined #pact-go

haroldrobson11
2023-03-30 13:16
has joined #pact-go

jfbosca
2023-03-30 15:26
has joined #pact-go

yu.xie
2023-03-31 02:43
It worked for me after removing the `/usr/local/lib` part for me. Yeah bazel support patching build files to override what you defined in `lib.go` so no need for a PR here. Thanks!

matt.fellows
2023-03-31 05:34
Awesome, thanks! Is there any lessons we can take to update our docs? Feel free to suggest via a PR or GH issue to scratch out any thoughts. Glad to hear it?s working though!

yu.xie
2023-03-31 17:15
I?m just getting started on trying pact out. It?s just 1st step (getting pact build in monorepo/bazel env). I can probably come back and share something if I end up having the test flow running e2e.

daominhdam
2023-04-01 10:04
has joined #pact-go

joseph.gately
2023-04-03 14:14
has joined #pact-go

bram.harmsen
2023-04-04 07:20
has joined #pact-go

sarah.al-hawi
2023-04-04 10:55
has joined #pact-go

andrei.enache
2023-04-04 10:55
has joined #pact-go

sohaib.zahid
2023-04-04 10:55
has joined #pact-go

behrouz.pooladrak
2023-04-04 10:55
has joined #pact-go

amarpal.amrith
2023-04-04 10:57
has joined #pact-go

laszlo.bogardi
2023-04-04 10:57
has joined #pact-go

caroline.thom
2023-04-04 13:20
has joined #pact-go

jeremy.chao
2023-04-04 14:49
has joined #pact-go

bmdk83
2023-04-04 15:51
has joined #pact-go

maithree.uppunda
2023-04-05 07:50
has joined #pact-go

nuno.frias
2023-04-05 10:17
Hi team, I am aware there are a few issues around the EachKeyLike matcher at least for pact-js, nevertheless I also encountered a similar issue in pact-go therefore I have raised this ticket https://github.com/pact-foundation/pact-go/issues/285

matt.fellows
2023-04-05 13:17
Thank you. It's probably the same bug because I implemented both :wink:

sivamkumar80
2023-04-05 13:34
has joined #pact-go

vanja.ilic
2023-04-05 14:24
has joined #pact-go

proydimonoff
2023-04-05 14:30
has joined #pact-go

proy
2023-04-05 14:33
has joined #pact-go

kevin.moylan
2023-04-05 16:13
has joined #pact-go

vijaykumar.patel
2023-04-06 06:36
has joined #pact-go

ankit.kumar
2023-04-06 10:55
has joined #pact-go

joye.arbuckle
2023-04-06 14:24
has joined #pact-go

allison.stone
2023-04-06 19:36
has joined #pact-go

mayank
2023-04-06 22:11
has joined #pact-go

ganesh.walunj
2023-04-07 06:05
has joined #pact-go

jan.krolikowski
2023-04-07 14:39
has joined #pact-go

mragni.majhwar
2023-04-07 17:51
has joined #pact-go

gonzalo.granizo
2023-04-11 10:13
has joined #pact-go

theburningmonk
2023-04-11 11:29
has joined #pact-go

helenarodcal
2023-04-11 11:31
has joined #pact-go

enver.yasar
2023-04-11 13:39
has joined #pact-go

christian.ledgard
2023-04-11 13:49
has joined #pact-go

ddongre
2023-04-11 15:09
has joined #pact-go

prajapati.pravesh
2023-04-12 02:55
has joined #pact-go

edwin.raju
2023-04-12 08:13
has joined #pact-go

john.hennigan
2023-04-12 08:16
has joined #pact-go

donald.robertson
2023-04-12 10:42
has joined #pact-go

tam.norris
2023-04-12 10:46
has joined #pact-go

gopijaganathan7
2023-04-13 07:27
has joined #pact-go

jan.krolikowski
2023-04-13 08:59
Hello, I'm trying to create a consumer test which matches an `Authorization` header with commas, using pact-go `v2.0.0-beta.18` and libpact_ffi `0.4.3` . The header is configured in `V3` pact as follows: ``` WithRequest("GET", "/endpoint", func(b *V3RequestBuilder) { b.Header("Authorization", S("OAuth oauth_consumer_key=abcd, oauth_signature_method=\"PLAINTEXT\", oauth_version=\"1.0\", oauth_signature=\"1234&\"")) }).``` and it's being sent with same payload while running the test: ``` req, _ := http.NewRequest("GET", fmt.Sprintf("http://%s:%d/endpoint", mockServerConfig.Host, mockServerConfig.Port), strings.NewReader("")) req.Header.Add("Authorization", "OAuth oauth_consumer_key=abcd, oauth_signature_method=\"PLAINTEXT\", oauth_version=\"1.0\", oauth_signature=\"1234&\"") _, err := http://httpClient.Do(req)``` However, even though the headers are exactly the same, I get following error: ```2023/04/13 08:34:08 [INFO] pact validation failed, errors: Mismatch with header 'Authorization': Expected 'OAuth oauth_consumer_key=abcd, oauth_signature_method=\"PLAINTEXT\", oauth_version=\"1.0\", oauth_signature=\"1234\u0026\"' to be equal to 'OAuth oauth_consumer_key=abcd' for value at index 0 : expected: OAuth oauth_consumer_key=abcd, oauth_signature_method=\"PLAINTEXT\", oauth_version=\"1.0\", oauth_signature=\"1234\u0026\" actual: OAuth oauth_consumer_key=abcd``` Reproductible script can be found https://github.com/yanekk/pact-go-header-commas-mismatch. I verified with external proxy whether Go is stripping the header somehow, but it was sent correctly. Personally, I'd consider it as bug, especially since similar problem was already raised (and fixed) in https://github.com/pact-foundation/pact-js/issues/1031. However, this is my first attempt to use pact-go, so maybe this is a feature I miss. In case of the latter, how I should fix the interaction definition to match the actual request?

lukaszmalek90
2023-04-13 11:40
has joined #pact-go

omri.eyal
2023-04-13 13:24
@omri.eyal has left the channel

nickwilliamsqa
2023-04-13 16:15
has joined #pact-go

buckley
2023-04-13 20:56
Hello once again. My provider verification appears to not be able to find my consumer pacts. I have a consumer pact published with a `Consumer Version` and a `branch` associated with it. I can see the unverified pact in the UI. My provider uses the following selector and is on a branch with an identical name as the consumer. ```[]types.ConsumerVersionSelector{ { MatchingBranch: true, }, { MainBranch: true, }, { Deployed: true, }, }```

buckley
2023-04-13 20:56
When I run the verification pact, I get the following log though: `pact.go:421: no pacts found to verify`

buckley
2023-04-13 22:17
hmm. this appears to be happening for my main branch too.

guozhangliew
2023-04-14 02:03
has joined #pact-go

matt.fellows
2023-04-14 02:57
Thanks Jan. I think the issue is still present actually - see https://github.com/pact-foundation/pact-js/issues/1058

praboo.p
2023-04-14 07:17
has joined #pact-go

florenciaaldana.rodri
2023-04-14 08:10
has joined #pact-go

will
2023-04-14 15:14
That looks like a bit of a weird version selector to me. Not sure what version of pact-go you?re using either, but I?m on the 2.x.x branch ```ConsumerVersionSelectors: []provider.Selector{ &provider.ConsumerVersionSelector{ Branch: "main", Latest: true, }, }```

buckley
2023-04-14 15:22
interesting. I'll try changing my selector.

will
2023-04-14 15:22
Yeah not saying for sure that that?s defo the issue, and I know plenty of things have changed between versions of pact-go

will
2023-04-14 15:22
I?m sure I took my stuff from the examples in pact-go

taher.kapasi
2023-04-14 15:53
has joined #pact-go

michael385
2023-04-14 16:40
has joined #pact-go

darrenoc3
2023-04-15 03:46
has joined #pact-go

ones.ardo
2023-04-17 07:58
has joined #pact-go

deeptiagrawal
2023-04-17 23:31
has joined #pact-go

madhukar.koratagere
2023-04-18 06:24
has joined #pact-go

mahesh.damavarapu
2023-04-18 06:26
has joined #pact-go

paul.caplan
2023-04-18 14:52
has joined #pact-go

cars2991
2023-04-19 02:42
has joined #pact-go

vaidas.sieber
2023-04-19 06:42
has joined #pact-go

jonathandelaros
2023-04-19 07:40
has joined #pact-go

priyaranjanmudliar
2023-04-19 09:05
has joined #pact-go

ajaydiwakar.ka
2023-04-19 10:11
has joined #pact-go

meghaagr
2023-04-19 10:13
has joined #pact-go

hcummins
2023-04-19 12:58
has joined #pact-go

michael.dasilva
2023-04-19 13:13
has joined #pact-go

ivana.lazic
2023-04-19 14:04
has joined #pact-go

vakong13
2023-04-19 16:15
has joined #pact-go

ravinder.kadiyan
2023-04-20 09:56
has joined #pact-go

alfredo.castro
2023-04-20 13:27
has joined #pact-go

lluis.casals
2023-04-20 17:07
has joined #pact-go

dprawatya
2023-04-21 01:11
has joined #pact-go

mbutt
2023-04-21 01:11
has joined #pact-go

marcia.meira
2023-04-21 12:43
has joined #pact-go

raubreysmith
2023-04-21 12:46
has joined #pact-go

ksenia.vasileva
2023-04-21 15:02
has joined #pact-go

jack.amico
2023-04-21 15:48
has joined #pact-go

cheng.ngai
2023-04-22 00:55
has joined #pact-go

aditya.kashyap
2023-04-24 05:13
has joined #pact-go

iustina.gavrila
2023-04-24 09:15
has joined #pact-go

vandana.aveva
2023-04-24 18:24
has joined #pact-go

lucas
2023-04-25 00:01
has joined #pact-go

szydlakus
2023-04-25 11:19
has joined #pact-go

sarah.hutchins
2023-04-25 12:48
has joined #pact-go

kristoffer
2023-04-25 13:31
has joined #pact-go

kristoffer
2023-04-25 13:37
Ran in to an issue with the Metadata for an asynchronous message. For some unknown reason the Metadata field have been disabled with a comment. See: https://github.com/pact-foundation/pact-go/blob/2.x.x/message/v4/message.go#L24

jack.drake
2023-04-25 15:40
has joined #pact-go

mathivanan.kailasam
2023-04-25 16:15
has joined #pact-go

hornc
2023-04-25 18:00
has joined #pact-go

hulia.suliman
2023-04-25 18:07
has joined #pact-go

matt.fellows
2023-04-26 10:45
How are you trying to use it? It's possible it's a bug

markus.nakhlah
2023-04-26 13:44
has joined #pact-go

jean-francois.renaud
2023-04-26 21:09
has joined #pact-go

jakazzy
2023-04-27 06:16
has joined #pact-go

kristoffer
2023-04-27 07:03
We pass Content-Type among other things as Kafka message attributes, the content type is used for internal routing. It is possible to hack in a workaround, but it would be better if metadata was in the AsynchronousMessage.

matt.fellows
2023-04-27 12:33
ah, any reason you can?t use the `v3` interface? That should support metadata I think. I need to remember why I didn?t add that to V4 yet, but there was probably a _good reason_ :tm:

srinivas.nali
2023-04-28 14:27
has joined #pact-go

srinivas.nali
2023-04-28 14:31
Hi All, I am trying to publish the pact like this to my localhost once the server up and running, p := dsl.Publisher{} err = p.Publish(types.PublishRequest{ PactURLs: []string{"./pacts/myconsumer2-myprovider2.json"}, PactBroker: "https://localhost:1234", ConsumerVersion: "1.0.0", }) but receiving 2023/04/28 15:24:00 [INFO] checking pact-mock-service within range >= 3.5.0, < 4.0.0 2023/04/28 15:24:00 [INFO] checking pact-provider-verifier within range >= 1.36.1, < 2.0.0 2023/04/28 15:24:01 [INFO] checking pact-broker within range >= 1.22.3 2023/04/28 15:24:02 [ERROR] service: /Users/srinivas.nali/pact/lib/ruby/lib/ruby/2.4.0/net/protocol.rb:44:in `connect_nonblock': SSL_connect returned=1 errno=0 state=error: wrong version number (OpenSSL::SSL::SSLError)

srinivas.nali
2023-04-28 14:31
any suggestions? please

greg.tyler
2023-04-28 15:18
Looks like you?re trying to use `https` but don?t have an SSL cert. Can you try `http://localhost:1234/` instead?

srinivas.nali
2023-04-28 15:32
thanks Greg, that solved ssl error. Cheers

srinivas.nali
2023-04-28 15:32
I am now getting another error

srinivas.nali
2023-04-28 15:32
2023/04/28 16:31:02 [ERROR] service: PactBroker::Client::hal::ErrorResponseReturned - Error making request to http://localhost:1234 status=500 {"message":"No interaction found for GET /","interaction_diffs":[]} consumer_test.go:49: Error on publish: exit status 1 --- FAIL: Test_Consumer (21.75s)

srinivas.nali
2023-04-28 15:34
before running my customer test, I did run the server, using the command *pact-mock-service start*

greg.tyler
2023-04-28 15:35
Is that what?s running on port 1234?

srinivas.nali
2023-04-28 15:35
yes

srinivas.nali
2023-04-28 15:36
use case is non-http, message oriented testing

greg.tyler
2023-04-28 15:39
I don?t know much about message testing. What is it you?re expecting to see when you go to localhost:1234?

srinivas.nali
2023-04-28 15:39
I thought it would have /pacts folder with the json created

srinivas.nali
2023-04-28 15:40
similar to the case when published to http://pactflow.io

greg.tyler
2023-04-28 15:44
So you?re expecting the Pact Broker UI? In which case you need to be starting the broker on port 1234, not the mock service, either with the https://hub.docker.com/r/pactfoundation/pact-broker or by https://docs.pact.io/pact_broker#to-have-a-play-around-on-your-local-machine.

srinivas.nali
2023-04-28 15:46
sure, will follow those and see

srinivas.nali
2023-04-28 15:47
thank you very much Greg

dmitriy.tarasevich
2023-04-28 16:00
has joined #pact-go

jigish.mehta
2023-04-28 16:00
has joined #pact-go

juan.felix
2023-04-28 16:01
has joined #pact-go

himesj
2023-04-28 17:25
has joined #pact-go

matt.fellows
2023-04-28 22:21
You would normally run a pact broker on a centralised service or use something like PactFlow, not your machine (if you're just testing of course then no worries)

matt.fellows
2023-04-28 22:22
Thanks for your help @greg.tyler :taco: for you :wink:

itsforbabu
2023-04-29 14:25
has joined #pact-go

tea.trader168
2023-04-30 02:04
has joined #pact-go

lori.maurais
2023-05-01 15:27
has joined #pact-go

damola.thompson
2023-05-02 07:26
has joined #pact-go

nuno.frias
2023-05-02 10:13
Hi all, I am convinced there is issue with how `BeforeEach` hooks are executed. Rather than being executed once per scenario they are executed before each individual state handler function, both on setup and on cleardown. I think the intended behaviour is for `BeforeEach` hooks to be executed once per provider tests before the state handlers (and never on cleardown). I have raised an issue for it https://github.com/pact-foundation/pact-go/issues/288 .

ivan.v.kurlovich
2023-05-02 13:01
has joined #pact-go

ckulkarni
2023-05-02 14:22
has joined #pact-go

aurel.pintea
2023-05-02 14:55
has joined #pact-go

yu.xie
2023-05-02 19:15
Hi folks, I saw an issue when trying to use protobuf plugin: ```builder.UsingPlugin(message.PluginConfig{ Plugin: "protobuf", })``` Curious if this looks familiar to anyone here: ```2023-05-02T01:01:36.348285Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(protobuf, 59762, STDERR) || thread 'main' panicked at 'failed to create appender: Os { code: 1, kind: PermissionDenied, message: "Operation not permitted" }', /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/tracing-appender-0.2.2/src/rolling.rs:499:53```

ariveros142
2023-05-02 20:03
has joined #pact-go


uglyog
2023-05-03 00:03
has joined #pact-go

uglyog
2023-05-03 00:04
I think this is file permissions. It is trying to create a log file in the plugin directory

yu.xie
2023-05-03 00:05
Yeah seems like the case, I?ve checked that files are there tho and permissions look okay. Should `-rw-r--r--` be good for it? ```ls -l /Users/yu.xie/.pact/plugins/protobuf-0.3.0/log total 0 -rw-r--r-- 1 yu.xie staff 0 May 1 17:48 plugin.log.2023-05-02 -rw-r--r-- 1 yu.xie staff 0 May 1 17:48 plugin.log.json.2023-05-02```

uglyog
2023-05-03 00:10
It's a log directory, so it should be safe to use `w` for all levels

yu.xie
2023-05-03 00:23
Got it let me dig more into it, thanks!

cody.jenkins
2023-05-03 04:48
has joined #pact-go

ashish.tilara
2023-05-03 06:08
has joined #pact-go

alfred.brose00
2023-05-03 08:17
has joined #pact-go

dibya.dhar
2023-05-03 09:04
has joined #pact-go

srinivas.nali
2023-05-03 09:09
hi @matt.fellows thank you for the input. I am learning about the setup and testing the tool for now. FYI, Our use case is message pacts

ronnie.kilsbo
2023-05-03 09:28
has joined #pact-go

caitriona.gallagher
2023-05-03 15:18
has joined #pact-go

majhwar.mragni
2023-05-03 17:03
has joined #pact-go

michael.fenstermaker
2023-05-03 20:56
has joined #pact-go

man.tse
2023-05-03 20:58
has joined #pact-go

tristan
2023-05-04 03:27
has joined #pact-go

michal.kopriva
2023-05-04 11:03
has joined #pact-go

nuno.frias
2023-05-04 12:37
Hi all, I just noticed that on Pact V4 every time you run a test a new interaction key is generated, which if I am not mistaken means that the contract content will be different every time you run the test, thus preventing you from publishing the contract unless the provider version changes. ```... "interactions": [ { "description": "My description", "key": "32761b74ddf11016", <==== ...```

nuno.frias
2023-05-04 12:37
Has anyone else experienced any such problem on Pact V4?

nuno.frias
2023-05-04 12:52
(I have not yet published the contract so this can be a false flag)

yousafn
2023-05-04 13:37
Hey @nuno.frias I think it is related to this issue https://github.com/pact-foundation/pact-reference/issues/264 https://github.com/pact-foundation/pact-reference/issues/264#issuecomment-1530809990 > I'm going to remove the key generation, it is causing too may issues. This was meant to be a user supplied key (See https://github.com/pact-foundation/pact-specification/issues/72) and the idea was to auto-calculate it if it was not supplied by a user.

nuno.frias
2023-05-04 13:41
Thank you @yousafn

nuno.frias
2023-05-04 13:41
That seems to be exactly the case.

yousafn
2023-05-04 13:42
ty, would you mind posting on there and just note you will be expecting it in a pact-go release, and would be willing to help test (if you are)

nuno.frias
2023-05-04 13:43
I am indeed

yousafn
2023-05-04 13:43
also may be useful just to note your pact-go version as well :slightly_smiling_face:

yousafn
2023-05-04 13:43
thanks Nuno! you are a star!


nuno.frias
2023-05-04 17:17
Hi @matt.fellows Is there any progress on this issue ? From my early investigations I suspect the issue lies on the ffi library but going through the ffi releases I have not seen any fixes that could be pertinent to this problem.

james.jenks
2023-05-04 19:09
has joined #pact-go

abdurrahman.muratt
2023-05-04 20:50
has joined #pact-go

matt.fellows
2023-05-05 02:13
Wow, 30 days went fast!

matt.fellows
2023-05-05 02:13
I?ve just commented - I haven?t got capacity to look at this properly, but I think I know the resolution.

svetoldo444ka
2023-05-05 15:35
has joined #pact-go

arjun.gowda
2023-05-08 17:07
has joined #pact-go

valencianaad
2023-05-09 15:04
has joined #pact-go

marlon.jimenez
2023-05-09 17:53
has joined #pact-go

erollins
2023-05-09 18:49
has joined #pact-go

marcos.aruj
2023-05-09 23:39
has joined #pact-go

meritxell.rodriguez
2023-05-10 06:33
has joined #pact-go

yana.kliuch
2023-05-10 08:58
has joined #pact-go

james.brown
2023-05-10 14:01
has joined #pact-go

mark.bursnall
2023-05-10 14:01
has joined #pact-go

alexandru.simion
2023-05-10 14:01
has joined #pact-go

giulio.giovannini
2023-05-10 14:01
has joined #pact-go

razvan.grigorescu
2023-05-10 14:04
has joined #pact-go

henry.rutman
2023-05-10 18:28
has joined #pact-go

simondemartini
2023-05-10 19:53
has joined #pact-go

stefan.kemp
2023-05-11 07:42
has joined #pact-go

supersmile2009
2023-05-11 12:06
has joined #pact-go

lknaresh2
2023-05-11 18:20
has joined #pact-go

siddharth12345
2023-05-12 09:47
has joined #pact-go

siddharth.shetty
2023-05-12 09:51
has joined #pact-go

lukemstorey
2023-05-12 13:52
has joined #pact-go

rana
2023-05-13 20:56
has joined #pact-go

anatoliy.ganzyuk
2023-05-14 20:15
has joined #pact-go

minhajsid
2023-05-15 10:18
has joined #pact-go

artur.ashyrov984
2023-05-15 16:01
has joined #pact-go

jerson.zuniga
2023-05-15 20:25
has joined #pact-go

sekumar
2023-05-15 21:05
has joined #pact-go

jzunigacoayla
2023-05-15 21:41
has joined #pact-go

matthieu.saleta
2023-05-16 09:31
has joined #pact-go

carls.stfleur
2023-05-16 12:20
has joined #pact-go

dale
2023-05-16 16:01
has joined #pact-go

curb1968
2023-05-17 03:41
has joined #pact-go

robert.turner
2023-05-17 12:26
has joined #pact-go

jsanthakumar
2023-05-18 09:47
has joined #pact-go

rmodrego
2023-05-18 09:47
has joined #pact-go

clm.whyte
2023-05-18 09:48
has joined #pact-go

fdonald
2023-05-18 09:52
has joined #pact-go

mgarcia
2023-05-18 09:53
has joined #pact-go

lsantarelli
2023-05-18 10:26
has joined #pact-go

bdocherty
2023-05-18 11:56
has joined #pact-go

srikanth_vemuri
2023-05-18 12:08
has joined #pact-go

perera.x.roshni
2023-05-18 12:16
has joined #pact-go

mohitkrishna.s.s12
2023-05-18 13:23
has joined #pact-go

dwayne.sykes
2023-05-18 16:23
has joined #pact-go

kancharla.g
2023-05-19 03:31
has joined #pact-go

clm.whyte
2023-05-19 16:35
@clm.whyte has left the channel

joseantonionmfilho
2023-05-19 17:46
has joined #pact-go

anenada
2023-05-20 08:06
has joined #pact-go

rabrosimov
2023-05-20 20:11
has joined #pact-go

arm.arturpetrosyan
2023-05-22 10:37
has joined #pact-go

adra_verma
2023-05-22 12:11
has joined #pact-go

p.keshav.chainani
2023-05-22 12:13
has joined #pact-go

divya.s.parappanavar
2023-05-22 12:13
has joined #pact-go

n.duran
2023-05-22 14:38
has joined #pact-go

srinivas.nali
2023-05-23 07:20
hi All, if I want to go with pactbroker localhost route, how will it work for two sides' pipelines?

matt.fellows
2023-05-23 07:29
it won?t, likely

matt.fellows
2023-05-23 07:29
are you saying you have a CI pipeline (presumably not running on your machine) but want to connect it to a Pact Broker on your localhost (which presumably is your dev machine?)(

matt.fellows
2023-05-23 07:30
The pact broker is really a central piece of infra you run across the org - that?s the way it should be run

srinivas.nali
2023-05-23 08:37
thanks Matt, yes two different CI pipeline jenkins machines.

srinivas.nali
2023-05-23 08:40
if I don't want to use pactflow as pact broker, can I build some server using org infra and those docker images? so different jenkins pipelines can access.

matt.fellows
2023-05-23 11:33
Absolutely

srinivas.nali
2023-05-23 11:58
thank you

garry.wilson
2023-05-23 12:28
has joined #pact-go

verevad
2023-05-23 13:04
has joined #pact-go

jon.arambarri
2023-05-24 07:34
has joined #pact-go

yonatany
2023-05-24 08:14
has joined #pact-go

scoplin
2023-05-24 20:02
has joined #pact-go

aemanuelson
2023-05-25 23:41
has joined #pact-go

sreenivas.chaitanya
2023-05-26 08:29
has joined #pact-go

tigrandza
2023-05-26 08:46
has joined #pact-go

tle
2023-05-26 09:56
has joined #pact-go

adam699
2023-05-26 13:35
has joined #pact-go

mariusz.kapczynski
2023-05-29 12:10
has joined #pact-go

kazimierz.zarychta
2023-05-29 12:10
has joined #pact-go

pierre.zeidan
2023-05-30 13:10
has joined #pact-go

shkothari
2023-05-30 14:55
has joined #pact-go

srinivas.nali
2023-05-30 16:12
Hi All, for message pacts, on provider side, trying to understand MessageHandler and StateHandlers, what is the difference between these two? what should happen in each of these? appreciate any help, thanks.

bwang
2023-05-30 16:55
has joined #pact-go

matt.fellows
2023-05-31 00:01
`MessageHandler`s are for mapping asynchronous/synchronous messages to the scenarios being tested. Because in message Pact we don?t have a transport, we need to register the functions that would produce the relevant message

matt.fellows
2023-05-31 00:01
`StateHandler` s are for setting up the provider state for a given interaction (e.g. seeding a database, setting up a mock etc.)

dev.talha.akbar
2023-05-31 09:45
has joined #pact-go

msiles
2023-05-31 13:50
has joined #pact-go

eli.thorkelson
2023-05-31 18:14
has joined #pact-go

adam699
2023-05-31 19:13
@adam699 has left the channel

srinivas.nali
2023-06-01 17:47
thanks Matt

jegadeesan.ponnusamy8
2023-06-02 16:19
has joined #pact-go

siyuanshen1993
2023-06-03 10:36
has joined #pact-go

pawar.s
2023-06-05 05:15
has joined #pact-go

rohitkrishnan
2023-06-05 20:37
has joined #pact-go

payal.chainani
2023-06-06 06:32
has joined #pact-go

divya.parappanavar
2023-06-06 07:23
has joined #pact-go

mrudula.patil
2023-06-06 08:19
has joined #pact-go

asjad.baig.ind
2023-06-06 11:12
has joined #pact-go

rajat.chouhan
2023-06-06 12:16
has joined #pact-go

srinivas.nali
2023-06-06 13:39
Hi All, when I tried to run pact tests in Jenkins machine after all Go dependencies, it is throwing below error? has anyone faced it? ```14:05:57 2023/06/06 13:05:57 [INFO] checking pact-broker within range >= 1.22.3 14:05:57 2023/06/06 13:05:57 [ERROR] CLI tools are out of date, please upgrade before continuing```

yousafn
2023-06-06 13:57
Have you download the pact cli tools and made them available on your path

srinivas.nali
2023-06-06 14:04
hi Yousaf, yes, below is what I have put in Makefile `install:` `@if [ ! -d pact/bin ]; then\` `echo "--- ? Installing Pact CLI dependencies"; \` `curl -fsSL https://raw.githubusercontent.com/pact-foundation/pact-ruby-standalone/master/install.sh | bash -x; \` `fi`

srinivas.nali
2023-06-06 14:05
``` 14:53:42 + make install test-unit 14:53:42 --- ???? Installing Pact CLI dependencies``` ```14:53:59 === RUN TestHandler_ModelMandatoryCheck 14:53:59 2023/06/06 13:53:59 [INFO] checking pact-mock-service within range >= 3.5.0, < 4.0.0 14:53:59 2023/06/06 13:53:59 [ERROR] CLI tools are out of date, please upgrade before continuing```

yousafn
2023-06-06 14:13
is it available on the path tho? is you echo $PATH, you should have a entry that points to `pact/bin` folder wherever it is located

yousafn
2023-06-06 14:14
ie can you run `pact-mock-service --help` or do you need to specify the full path to the executable, pact-go expects the tools to be on the `PATH` as per the docs. You could also try v2 which uses the pact-rust core via the FFI library instead, and doesn't need to download the CLI tools, but I believe adding to your path should resolve

srinivas.nali
2023-06-06 15:11
thanks Yousaf, I updated my Jenkinsfile stage "Unit Tests": { sh('make install') env._PATH_ = "$PATH:$HOME/pact/bin" echo "latest PATH value is : ${env.PATH}" sh('make test-unit') },

srinivas.nali
2023-06-06 15:11
```latest PATH value is : /usr/sbin:/usr/bin:/sbin:/bin:/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin:/usr/local/go/bin:/root/go/bin:/usr/bin:/usr/local/bin:/usr/local/go/bin:/root/pact/bin```

srinivas.nali
2023-06-06 15:12
still same issue 16:03:54 2023/06/06 15:03:54 [INFO] checking pact-mock-service within range >= 3.5.0, < 4.0.0 16:03:54 2023/06/06 15:03:54 [ERROR] CLI tools are out of date, please upgrade before continuing

yousafn
2023-06-06 15:41
I'm not sure that is the path you downloaded the tools too, your logs previously showed it was downloading to `pact/bin` relative to your project folder, not the root

srinivas.nali
2023-06-06 16:19
it says ```17:13:33 + echo 'pact-ruby-standalone v2.0.1 installed to /workspace/ntract-testing-poc-consumer_PR-6/pact' 17:13:33 pact-ruby-standalone v2.0.1 installed to /workspace/ntract-testing-poc-consumer_PR-6/pact```

srinivas.nali
2023-06-06 16:20
17:13:33 + echo 'pact-ruby-standalone v2.0.1 installed to /workspace/ntract-testing-poc-consumer_PR-6/pact' 17:13:33 pact-ruby-standalone v2.0.1 installed to /workspace/ntract-testing-poc-consumer_PR-6/pact 17:13:33 + echo ------------------- 17:13:33 ------------------- 17:13:33 + echo 'available commands:' 17:13:33 available commands: 17:13:33 + echo ------------------- 17:13:33 ------------------- 17:13:33 ++ pwd 17:13:33 + ls -1 /workspace/ntract-testing-poc-consumer_PR-6/pact/bin 17:13:33 pact 17:13:33 pact-broker 17:13:33 pact-message 17:13:33 pact-mock-service 17:13:33 pact-plugin-cli 17:13:33 pact-provider-verifier 17:13:33 pact-publish 17:13:33 pact-stub-service 17:13:33 pactflow 17:13:33 [Pipeline] echo 17:13:33 latest PATH value is : /usr/sbin:/usr/bin:/sbin:/bin:/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin:/usr/local/go/bin:/root/go/bin:/usr/bin:/usr/local/bin:/usr/local/go/bin:/pact/bin 17:13:33 [Pipeline] sh 17:13:33 + make test-unit 17:13:33 go test -v -coverprofile=coverage_unit.out $(go list ./... | grep -v /practiceExamples) 17:14:00 === RUN TestHandler_ModelMandatoryCheck 17:14:00 2023/06/06 16:14:00 [INFO] checking pact-provider-verifier within range >= 1.36.1, < 2.0.0 17:14:00 2023/06/06 16:14:00 [ERROR] CLI tools are out of date, please upgrade before continuing

yousafn
2023-06-06 19:05
the path is /workspace/ntract-testing-poc-consumer_PR-6 in the folder pact/bin it is shown in the output of the downloader

srinivas.nali
2023-06-07 06:37
thanks Yousaf, very helpful

srinivas.nali
2023-06-07 06:44
I have defined path setup like this `#Install Pact CLI` `install-pact-cli:` `@if [ ! -d pact/bin ]; then\` `echo "--- Installing Pact CLI dependencies"; \` `curl -fsSL https://raw.githubusercontent.com/pact-foundation/pact-ruby-standalone/master/install.sh | bash -x; \` `fi` `update-path:` `@echo "adding pact-cli to the PATH..."` `PATH:=$(PATH):$(PWD)/pact/bin`

srinivas.nali
2023-06-07 06:45
and updated Jenkinsfile with stage('Unit Tests'){ sh('make install-pact-cli') sh('make update-path') sh('make test-unit') }

srinivas.nali
2023-06-07 06:45
tests passing now

srinivas.nali
2023-06-07 06:45
thank you very much

david.stothers
2023-06-07 07:25
has joined #pact-go

rafaela.azevedosouza
2023-06-07 08:52
has joined #pact-go

newmolti
2023-06-07 10:14
has joined #pact-go

danut.turta
2023-06-07 11:35
has joined #pact-go

dev664
2023-06-07 11:53
has joined #pact-go

yousafn
2023-06-07 12:52
awesome

david.blanco
2023-06-07 18:08
has joined #pact-go

jonathan.fisher
2023-06-07 19:30
has joined #pact-go

dev.pactslack
2023-06-07 20:17
has joined #pact-go

dan.nichols52
2023-06-08 04:30
has joined #pact-go

s.lohmeier
2023-06-08 08:08
has joined #pact-go

radek.stolarczyk
2023-06-08 13:32
has joined #pact-go

zeeshankhan0330
2023-06-08 16:36
has joined #pact-go

marek
2023-06-09 07:57
has joined #pact-go

michael.lawrence
2023-06-09 09:57
has joined #pact-go

mssachin
2023-06-12 08:06
has joined #pact-go

andy.frith
2023-06-12 12:31
has joined #pact-go

ajay_886
2023-06-12 22:38
has joined #pact-go

steven.wang06
2023-06-13 05:06
has joined #pact-go

navanesyan
2023-06-13 07:05
has joined #pact-go

ran.tao
2023-06-13 21:46
has joined #pact-go

prakhar.roy371
2023-06-14 05:21
has joined #pact-go

john.joel.thetla
2023-06-14 10:16
has joined #pact-go

drew.bowman
2023-06-14 18:05
has joined #pact-go

devwenzel
2023-06-15 08:26
has joined #pact-go

ronen.yurik
2023-06-15 13:34
has joined #pact-go

matthew.finbury
2023-06-15 13:39
has joined #pact-go

anthony.sharp
2023-06-15 13:43
has joined #pact-go

mariane.leite
2023-06-15 15:25
has joined #pact-go

wvkehoe
2023-06-16 10:27
has joined #pact-go

rost.khanyukov
2023-06-16 22:58
has joined #pact-go

mich.krzyzanowski
2023-06-17 15:22
has joined #pact-go

f.barril
2023-06-18 16:58
has joined #pact-go

delboy1978uk
2023-06-20 07:46
has joined #pact-go

hammid.funsho
2023-06-20 22:18
has joined #pact-go

benjamine.nidhin
2023-06-21 12:15
has joined #pact-go

kuksa.vladyslav
2023-06-22 12:47
has joined #pact-go

suryasaharan
2023-06-22 15:41
has joined #pact-go

gabriel
2023-06-22 21:22
has joined #pact-go

bgrgincic
2023-06-26 11:00
has joined #pact-go

svilen.popov
2023-06-27 09:44
has joined #pact-go

matt982
2023-06-27 16:02
has joined #pact-go

eltonlinconl07
2023-06-28 17:30
has joined #pact-go

carlosmmelo
2023-06-29 07:00
has joined #pact-go

prerit.jain849
2023-06-29 09:40
has joined #pact-go

sssona09
2023-06-29 11:12
has joined #pact-go

antonio.blandon
2023-06-29 20:40
has joined #pact-go

arjun
2023-07-02 04:23
has joined #pact-go

adwait.damle
2023-07-03 06:39
has joined #pact-go

stan.amsellem
2023-07-03 14:00
has joined #pact-go

cobookman
2023-07-03 21:14
has joined #pact-go

anshu.behera.02
2023-07-04 07:01
has joined #pact-go

anshu.behera.02
2023-07-04 08:01
Hello Team, is there an equivalent of pact-jvm's https://github.com/pact-foundation/pact-jvm/issues/1260 for pact-go?

matt.fellows
2023-07-04 09:40
It shouldn't fail now, what errors are you seeing?

anshu.behera.02
2023-07-04 09:55
Hey Matt, thanks for the response. Was rewriting something from Kotlin to Go and couldn't find the equivalent feature. If it is the default behaviour then that's good enough for me.

adam.strawson
2023-07-04 13:24
has joined #pact-go

mathewsa
2023-07-04 15:20
has joined #pact-go

olopezs
2023-07-04 16:03
has joined #pact-go

tonis.ojandu
2023-07-05 06:51
@tonis.ojandu has left the channel

nithesh
2023-07-05 08:14
has joined #pact-go

andre.tartarelli
2023-07-05 11:26
has joined #pact-go

laura.huysamen
2023-07-05 12:38
has joined #pact-go

goatleyj11
2023-07-05 12:43
has joined #pact-go

lily.oconnell
2023-07-05 15:32
has joined #pact-go

mohanraj.r
2023-07-05 19:53
has joined #pact-go

ianlutz
2023-07-06 01:34
has joined #pact-go

rohit.m.patil27
2023-07-06 03:51
has joined #pact-go

timo.schwarzer
2023-07-06 06:18
has joined #pact-go

kuntol.banerjee
2023-07-06 06:54
has joined #pact-go

adebakre
2023-07-06 11:28
has joined #pact-go

rajkumarbapuvrs
2023-07-06 17:35
has joined #pact-go

jorge.carneiro
2023-07-07 09:43
has joined #pact-go

carlleferink
2023-07-07 12:01
has joined #pact-go

anju.ashk
2023-07-10 07:39
has joined #pact-go

rmahadeorathod
2023-07-10 09:48
has joined #pact-go

ekaterina.essina
2023-07-10 09:59
has joined #pact-go

arca.artem
2023-07-10 10:00
has joined #pact-go

connor.stevens
2023-07-10 11:35
has joined #pact-go

buckley
2023-07-10 18:55
If I have a DTO which uses a `*time.Time` value within a struct, how can I tell the `dsl.Matcher` to marshal it to a string or nil as go would? As of now, it's sending `{}` which is unable to be unmarshalled.

buckley
2023-07-10 21:07
I should probably mention that I'm using pact-go version 1.7.0 due to v2 only being marked as having beta stability.

matt.fellows
2023-07-10 22:25
It needs to be serialised into a string, like you would if you sent it over the wire. P.S. v2 is no longer beta

buckley
2023-07-10 22:27
the readme here: https://github.com/pact-foundation/pact-go/blob/master/README.md specifies that its stability is `beta` , is that not updated? ```Specification Compatibility Version Stable Spec Compatibility Install 2.0.x Beta 2, 3 See installation```

matt.fellows
2023-07-10 22:28
Try a refresh :laughing:

buckley
2023-07-10 22:29
Hey look at that :stuck_out_tongue:

matt.fellows
2023-07-10 22:29
_(I only dropped the unstable tag last night, and forgot about that table)_

buckley
2023-07-10 22:29
Ah that's good to know!

buckley
2023-07-10 22:29
The time itself is sent as a string over the wire but when the matcher creates an example object, the object it makes contains the time property as a JSON object. We're using oapi-codegen to fill in our provider models.

matt.fellows
2023-07-10 22:30
How are you using the matcher object?

buckley
2023-07-10 22:31
We're also doing something similar to unmarshal the time from the consumer end. Perhaps the advised workflow is to create an intermediate object for use only with pact?

buckley
2023-07-10 22:31
Let me grab an example. Just a second.


buckley
2023-07-10 22:45
minor comment update

matt.fellows
2023-07-10 23:15
Sorry, I had a meeting

matt.fellows
2023-07-10 23:16
How are you passing it to the Pact matchers though? Are you using the struct tags?

buckley
2023-07-10 23:17
`dsl.Match(ExampleJSONObject{})` is what I have been attempting to use

matt.fellows
2023-07-10 23:18
got it

matt.fellows
2023-07-10 23:18
I can see why it might not work, because I don?t think the `Match` feature is clever enough to first serialise the `time.Time` thing

matt.fellows
2023-07-10 23:19
(i?m just looking at the implementation of that now)

matt.fellows
2023-07-10 23:25
OK unfortunately it looks like it won?t work. The `Match` function is quite primitive. It could probably be made to be less so if you were up for some tinkering?

buckley
2023-07-10 23:26
is this function found within v2 as well?

matt.fellows
2023-07-10 23:27
yes it should be (but would behave the same)

buckley
2023-07-10 23:27
gotcha, if I put in a PR, then it'll go against v2

buckley
2023-07-10 23:28
for now, it seems like the best workaround is probably going to be to use the `StructMatcher` , does that sound correct?

matt.fellows
2023-07-10 23:34
yep, I think so

buckley
2023-07-10 23:51
a related question: is there an easy way to specify that a property within a StructMatcher is able to be nil?

matt.fellows
2023-07-10 23:52
It has to be two separate tests

matt.fellows
2023-07-10 23:52
see howtooptional


buckley
2023-07-10 23:52
perfect. thank you.

pgeurtsen
2023-07-11 07:30
has joined #pact-go

rjurca
2023-07-11 08:22
has joined #pact-go

frederic.vaugeois
2023-07-11 14:12
has joined #pact-go

marko.lamberg
2023-07-11 15:27
has joined #pact-go

lshilling
2023-07-12 09:31
has joined #pact-go

rudydc
2023-07-12 17:53
has joined #pact-go

hazem
2023-07-12 23:39
running into this error and unsure how to debug

hazem
2023-07-12 23:40
```[Container] 2023/07/12 23:38:21 Running command pact-go -l DEBUG install 2023/07/12 23:38:21 [ERROR] Your Pact library installation is out of date and we were unable to download a newer one for you: exit status 1 [Container] 2023/07/12 23:38:21 Command did not exit successfully pact-go -l DEBUG install exit status 1```

matt.fellows
2023-07-13 00:04
Is this the v2 or v1 library Haz?


matt.fellows
2023-07-13 00:07
I?m assuming you?ve installed the FFI in the container?

matt.fellows
2023-07-13 00:08
what?s the output of `pact-go -v install -f`?

matt.fellows
2023-07-13 00:08
brb


hazem
2023-07-13 00:10
the first attemp was with `-f` and still failed. i removed it because i noticed a branch when `!i.force`

matt.fellows
2023-07-13 00:12
That's a different command that installs the pact golang package. Did you run the other one too to install the FFI?

hazem
2023-07-13 00:14
i usually run this ```'go install http://github.com/pact-foundation/pact-go/v2@2.x.x', 'pact-go -l DEBUG install -f'```

hazem
2023-07-13 00:14
is that not correct?

matt.fellows
2023-07-13 00:16
yep. Sorry it wasn?t clear above that you ran the second command (just the `go install` one was mentioned)

matt.fellows
2023-07-13 00:16
Are you running on a different OS/architecture by any chance?

hazem
2023-07-13 00:17
yes, and i checked that by running `go env`

hazem
2023-07-13 00:18
```GOARCH="amd64" GOOS="linux"```

matt.fellows
2023-07-13 00:19
checks out

matt.fellows
2023-07-13 00:20
So anyway, maybe I?m missing something. When you run `pact-go -l DEBUG install -f` what is the output? Are you able to shell into the container and run it there?

hazem
2023-07-13 00:21
no, i cant

hazem
2023-07-13 00:21
it's running in codebuild :facepalm:

matt.fellows
2023-07-13 00:23
I reckon it could be this check that?s failing: ```// checkMusl checks if the OS uses musl library instead of glibc func (i *Installer) checkMusl() error { lddPath, err := exec.LookPath("ldd") if err != nil { return fmt.Errorf("could not find ldd in environment path") } cmd := exec.Command(lddPath, "/bin/echo") out, err := cmd.CombinedOutput() if strings.Contains(string(out), "musl") { log.Println("[WARN] Usage of musl library is known to cause problems, prefer using glibc instead.") } return err }``` Given the `exit status 1` error, this is the only thing I think might return that

hazem
2023-07-13 00:23
i have a branch with some extra logging on it.

hazem
2023-07-13 00:23
can i submit a pull

matt.fellows
2023-07-13 00:24
Just looking at that, we probably shouldn?t error the install because we couldn?t check if it was a musl setup.

matt.fellows
2023-07-13 00:24
I?m going to push a fix for that shortly


hazem
2023-07-13 00:27
for some extra logs.

hazem
2023-07-13 00:28
... i have to drop off for the day.

matt.fellows
2023-07-13 00:29
thx

matt.fellows
2023-07-13 00:29
No worries. See also #646c3eb - i?d love to know if that fixes your isnsue

matt.fellows
2023-07-13 00:29
can chat tomorrow :slightly_smiling_face:

hazem
2023-07-13 00:29
Cool, thx

bas
2023-07-13 15:44
@bas has left the channel

wesley.newcomb
2023-07-13 15:54
has joined #pact-go

wesley.newcomb
2023-07-13 16:32
Hi Pact Team, I am writing a consumer test in go using the new gRPC workflow. I am trying to call (*message.SynchronousPact).AddSynchronousMessage() twice within the same test because my gRPC server has multiple RPCs. When I run the test with just one call to (*message.SynchronousPact).AddSynchronousMessage() the test passes and a valid pact is generated but I still see this log ```2023-07-13T16:02:55.872397Z ERROR ThreadId(01) pact_mock_server::server_manager: Failed to shutdown plugin mock server with ID 97fa0c1e-3e37-4199-807f-3c16e3c0a94c - transport error``` If I add a second call to (*message.SynchronousPact).AddSynchronousMessage() the test fails due to this error ```2023-07-13T16:02:56.418779Z ERROR ThreadId(01) pact_ffi::plugins: Mock server is already started``` Is this a known issue or is there some workaround. - Thanks. Cc: @sathish.sundararajan @jason.taylor2

wesley.newcomb
2023-07-13 19:33
For context, basically if you have multiple (*message.SynchronousPact).AddSynchronousMessage() calls within the same go test, e.g. func TestConsumer(t *testing.T){?} you will get the above errors.

matt.fellows
2023-07-13 21:45
Perhaps we need to handle that situation better. Could you please raise an issue? This being said do you really need them in the same test? They will be tested separately on the provider aide

joris.vaneijden
2023-07-14 10:56
has joined #pact-go

joris.vaneijden
2023-07-14 10:58
@joris.vaneijden has left the channel

tushar.adsul223
2023-07-14 15:29
has joined #pact-go

hazem
2023-07-14 16:11
cool - that worked! ```2023/07/13 15:57:04 [DEBUG] unable to check for presence musl library due to error: exit status 1 2023/07/13 15:57:04 [INFO] downloading library from https://github.com/pact-foundation/pact-reference/releases/download/libpact_ffi-v0.4.5/libpact_ffi-linux-x86_64.so.gz to /usr/local/lib/libpact_ffi.so &{} 2023/07/13 15:57:05 [DEBUG] obtaining hash for file /usr/local/lib/libpact_ffi.so```

matt.fellows
2023-07-17 05:43
awesome, thanks. Will update the release!

matt.fellows
2023-07-17 05:44
Oh, I already did that :slightly_smiling_face:

francisco.almeida
2023-07-17 11:35
has joined #pact-go

mike.lovely
2023-07-17 12:12
has joined #pact-go

kyam.harris_pact
2023-07-17 12:51
has joined #pact-go

wesley.newcomb
2023-07-17 13:22
Yes will raise an issue for this. Also yes the separating the calls in to multiple tests works, however, for my use case it would be ideal to call AddSynchronousMessage() twice within the same test to the same *message.SynchronousPact.

drettie
2023-07-17 13:23
has joined #pact-go

mburns
2023-07-17 13:24
has joined #pact-go


amit.jadhav
2023-07-18 06:19
has joined #pact-go

aljaz.klanecek
2023-07-18 08:58
has joined #pact-go

amitw
2023-07-18 15:15
has joined #pact-go

amitw
2023-07-18 15:44
@amitw has left the channel

fkelly
2023-07-18 17:28
has joined #pact-go

phananhdung104
2023-07-18 18:28
has joined #pact-go

gurubabu.jampala
2023-07-19 01:02
has joined #pact-go

a.kravchenko357
2023-07-19 11:03
has joined #pact-go

thiagotrinta
2023-07-19 20:00
has joined #pact-go

lotem.dagan
2023-07-20 10:48
has joined #pact-go

lotem.dagan
2023-07-20 10:49
@lotem.dagan has left the channel

cmesyngi
2023-07-20 20:56
has joined #pact-go

sathish.sundararajan
2023-07-21 08:58
Hi Folks, we are writing pact consumer test for message. Trying to pass in headers using WithMetadata but its failing. Could someone please help ? ```err := p.AddAsynchronousMessage(). Given("Event is received"). ExpectsToReceive("Event"). UsingPlugin(message.PluginConfig{ Plugin: "protobuf", Version: "0.3.4", }). WithContents(protoMessage, "application/protobuf"). WithMetadata(headers). ExecuteTest(t, func(m message.AsynchronousMessage) error { return nil }) p.AddAsynchronousMessage().Given("Event is received").ExpectsToReceive("Evenr").UsingPlugin((message.PluginConfig literal)).WithContents(protoMessage, "application/protobuf").WithMetadata undefined (type *v4.AsynchronousMessageWithPluginContents has no field or method WithMetadata)```

alan.barker
2023-07-21 09:47
has joined #pact-go

vijaya.balla.external
2023-07-21 15:06
has joined #pact-go

dennis1125dennis
2023-07-22 02:30
has joined #pact-go

matt.fellows
2023-07-22 02:33
It's available, but you need to configure it earlier in the builder


muhammedalimutlu
2023-07-23 18:40
has joined #pact-go

sathish.sundararajan
2023-07-24 11:32
Oh gotcha, cool thanks @matt.fellows will try this out

doug.hanke
2023-07-24 17:53
has joined #pact-go

sameswar.khuntia
2023-07-25 10:17
has joined #pact-go

michal.mirecki
2023-07-25 10:28
has joined #pact-go

jeremyjpark
2023-07-25 15:30
has joined #pact-go

chetana.mahangare
2023-07-25 15:57
has joined #pact-go

kwan
2023-07-25 18:49
has joined #pact-go

venkatesh.civic
2023-07-26 16:49
has joined #pact-go

bartlomiej
2023-07-26 18:06
has joined #pact-go

wongkoonwai
2023-07-27 03:14
has joined #pact-go

conrad.john
2023-07-27 08:37
has joined #pact-go

dale.wells
2023-07-27 11:24
@dale.wells has left the channel

ajit.kumar
2023-07-27 11:37
has joined #pact-go

marekurbanowicz
2023-07-27 12:40
has joined #pact-go

maciej.krakowiak
2023-07-27 13:28
has joined #pact-go

mateusz.luty
2023-07-27 13:29
has joined #pact-go

pact259
2023-07-27 23:19
has joined #pact-go

hetal.patel
2023-07-28 14:04
has joined #pact-go

thatrandybrown
2023-07-28 16:49
has joined #pact-go

michael072
2023-07-29 03:08
has joined #pact-go

selniumtrainer
2023-07-29 08:10
has joined #pact-go

raylincontact
2023-07-31 01:51
has joined #pact-go

ext-damian.rudzinski
2023-07-31 10:01
has joined #pact-go

rostas.laszlo.dev
2023-07-31 11:27
has joined #pact-go

anubhuti.shrivastava
2023-08-01 07:35
has joined #pact-go

pavikrish
2023-08-01 07:45
has joined #pact-go

arnoldsi
2023-08-01 15:09
has joined #pact-go

stefan.waldhauser
2023-08-02 13:45
has joined #pact-go

shadman.equebal140
2023-08-02 19:20
has joined #pact-go

aravind.pai
2023-08-03 07:06
has joined #pact-go

ganeshacse01
2023-08-03 08:10
has joined #pact-go

br.holanda15
2023-08-03 14:35
has joined #pact-go

abarkha1
2023-08-03 22:34
has joined #pact-go

boreyuk
2023-08-04 07:22
has joined #pact-go

evan196
2023-08-04 14:33
has joined #pact-go

marek.fexa
2023-08-06 08:36
has joined #pact-go

acemilyalcin
2023-08-06 16:55
has joined #pact-go

aniket.rane
2023-08-07 02:55
has joined #pact-go

antony
2023-08-07 08:11
has joined #pact-go

andreas.marcec.extern
2023-08-07 14:35
has joined #pact-go

jeffreykey
2023-08-07 17:44
has joined #pact-go

vaishali.rastogi
2023-08-08 12:29
has joined #pact-go

michael.knoll
2023-08-08 14:02
has joined #pact-go

michelle.he
2023-08-08 19:02
has joined #pact-go

mohammed.a.ezzedin501
2023-08-09 11:17
has joined #pact-go

jacopo
2023-08-09 15:34
has joined #pact-go

enrique519
2023-08-09 23:57
has joined #pact-go

sheyanr
2023-08-10 02:55
has joined #pact-go

rcalvo
2023-08-10 08:28
has joined #pact-go

endikaposadas
2023-08-10 08:40
has joined #pact-go

chinmaya.mishra
2023-08-10 10:05
has joined #pact-go

anderson.aeb
2023-08-10 12:37
has joined #pact-go

poojarylatika1
2023-08-10 14:17
has joined #pact-go

sebastianmsandri
2023-08-10 16:01
has joined #pact-go

biancoc
2023-08-11 14:27
has joined #pact-go

svarakantham
2023-08-14 00:19
has joined #pact-go

carrm
2023-08-14 13:22
has joined #pact-go

jd.courtoy
2023-08-14 16:25
has joined #pact-go

elenadoty
2023-08-14 20:01
has joined #pact-go

a.adeyeye.gr
2023-08-15 08:49
has joined #pact-go

bas.plijnaer
2023-08-15 12:32
has joined #pact-go

liam.butler
2023-08-15 15:20
has joined #pact-go

marcocbarbieri
2023-08-15 22:47
has joined #pact-go

juandiegopalacio
2023-08-16 09:00
has joined #pact-go

t.vandenberk
2023-08-17 09:12
has joined #pact-go

jianbin.lin
2023-08-17 15:07
has joined #pact-go

artur.suhaniaka
2023-08-17 20:34
has joined #pact-go

aniruddhasingh.kushwa
2023-08-18 01:40
has joined #pact-go

parthiban.rajasekaran
2023-08-18 08:32
has joined #pact-go

gowthamgopal24
2023-08-18 09:52
has joined #pact-go

naimun.siraj
2023-08-18 16:50
has joined #pact-go

eugeniosaulo
2023-08-18 21:28
has joined #pact-go

pere.villega
2023-08-20 17:49
has joined #pact-go

navin.dhanaraj
2023-08-21 00:10
has joined #pact-go

eduardo.rodrigues
2023-08-22 08:05
has joined #pact-go

nickkeers
2023-08-22 08:35
has joined #pact-go

stan.amsellem
2023-08-22 11:39
@stan.amsellem has left the channel

christophe.laranjo
2023-08-22 17:34
has joined #pact-go

christophe.laranjo
2023-08-22 22:30
Hello, I'm having the same problem as described in this conversation, but I'm on Windows: https://pact-foundation.slack.com/archives/C9UTHTFFB/p1686058771769559 in my environment variables I have the GOPATH to \Users\myUser\go and in the PATH I have %USERPROFILE%\go\bin but when I try to run a test I get this error message: `2023/08/23 00:23:26 [INFO] checking pact-mock-service within range >= 3.5.0, < 4.0.0` `2023/08/23 00:23:26 [ERROR] CLI tools are out of date, please upgrade before continuing` this link explains how to install the standalone, but I don't find it very clear: https://github.com/pact-foundation/pact-ruby-standalone/releases once I've downloaded the right version for windows and unzipped it, I get a pact folder with two folders in it, but in the link it just says to extract the /pact/bin and change what's inside to .bat. But when I extract the folder there is a bin subfolder and a lib subfolder in the pact folder. Should I put the pact folder in my go directory (the one in my GOPATH), or should I copy the inside of the folders and put them somewhere else? Because if I put the pact folder in my go folder, I always get the error message. Thank you for your help

matt.fellows
2023-08-22 22:36
The files inside `bin` need to be on the `PATH` environment variable. The files inside `bin` also need the `.bat` extension, apparently.

matt.fellows
2023-08-22 22:36
> Should I put the pact folder in my go directory (the one in my GOPATH) No, they can go anywhere you like on your system

matt.fellows
2023-08-22 22:37
If you put them in `\Users\myUser\pact` then you would add the following to the `PATH` variable: ```\Users\myUser\pact\bin```

matt.fellows
2023-08-22 22:38
There is nothing special about Pact here. This is just the same as you would do for any program - for it to be available on the system for other apps to discover, it needs to be on the path

huthayfa
2023-08-23 08:10
has joined #pact-go

dsherwin
2023-08-23 09:20
has joined #pact-go

christophe.laranjo
2023-08-23 09:34
Ok thanks, but still not working, PATH is \Users\myUser\go\bin and all the file are inside with .bat and I have the same result

matt.fellows
2023-08-23 10:32
If you go into a shell and type `pact-broker` what happens? If it doesn't print out a help message, the PATH is incorrectly set

christophe.laranjo
2023-08-23 10:40
it tell me is not recognised, same for mock-service

christophe.laranjo
2023-08-23 10:59
I'm searching but for me it look like correct the path for the bin C:\Users\chris\go\bin with everything inside My user variable seems also correct and inside my environnement varaible the PATH seems also correct

christophe.laranjo
2023-08-23 11:55
ok thanks for the help, seems to be fix, the pact folder need to be in the bin folder and un the variable I need to had the path for it

marcel.novak
2023-08-23 13:53
has joined #pact-go

davidm
2023-08-23 15:57
has joined #pact-go

svmanikantakumar
2023-08-24 08:50
has joined #pact-go

eomeroff
2023-08-24 13:49
has joined #pact-go

riley.marzka
2023-08-24 17:47
has joined #pact-go

jared.anderson
2023-08-24 18:15
has joined #pact-go

timofeev1valeriy
2023-08-25 08:32
has joined #pact-go

kastala.nirosha
2023-08-25 09:17
has joined #pact-go

kkanova
2023-08-25 12:55
has joined #pact-go

theteea
2023-08-25 13:18
has joined #pact-go

kkanova
2023-08-25 13:25
Hi everyone! I'm playing with the Pact for some time, using pact-js for consumer and pact-go for provider. I've tried to use V3 schema and got blocked on the teardown (probably). I don't want to execute any specific teardown, I'm wiping all the data during `afterEach` method. But in the logs I can see: ```2023-08-25T13:18:39.954253Z INFO ThreadId(13) pact_verifier: Running teardown provider state change handler <mystate> for <mygiven> LOG: createAppAndComponents method was executed 2023/08/25 15:18:39 http: panic serving [::1]:52442: Your test failed.``` The `LOG` here is logged from the function that is supposed to be run just for the setup of provider. I'm a bit confused with that. Is there some documentation/example that I can check? I'll put a snippet of my code to the thread. Thank you!

kkanova
2023-08-25 13:27
in one file I have state defined ``` verifyRequest.StateHandlers = models.StateHandlers{ "App myapp exists and has component gh-component and quay-component": <-createAppAndComponents(HASAppNamespace), }``` and the function in the second file (will shorten it for better readability) ``` func createAppAndComponents(HASAppNamespace string) <-chan models.StateHandler { stateHandler := make(chan models.StateHandler) go func() { defer close(stateHandler) stateHandler <- func(setup bool, s models.ProviderState) (models.ProviderStateResponse, error) { println("LOG: createAppAndComponents method was executed") <my logic there> return nil, nil } }() return stateHandler }```

charlan.bettiol
2023-08-25 16:32
has joined #pact-go

david.tu
2023-08-25 17:51
has joined #pact-go

matt.fellows
2023-08-25 21:54
Mmm might be the use of channels causing the issue here.

matt.fellows
2023-08-25 21:55
Have you tried without out of interest?

viktor.stephanyk
2023-08-28 12:46
has joined #pact-go

arpit.gawande
2023-08-28 12:58
has joined #pact-go

kkanova
2023-08-28 13:34
I've removed the channel (in the past I introduced it there as I saw some asynchronous behaviour) so now the code seems like that: ``` verifyRequest.StateHandlers = models.StateHandlers{ "App myapp exists and has component gh-component and quay-component": createAppAndComponents(HASAppNamespace), }``` and the method itself: ```func createAppAndComponents(HASAppNamespace string) models.StateHandler { var stateHandler = func(setup bool, s models.ProviderState) (models.ProviderStateResponse, error) { <some logic> } return stateHandler }``` and this is log from the run: ```023-08-28T13:30:06.724217Z INFO ThreadId(13) pact_verifier: Running provider verification for 'Get app with its components.' 2023-08-28T15:30:06+02:00 INFO Stopping and waiting for webhooks 2023-08-28T15:30:06+02:00 INFO Wait completed, proceeding to shutdown the manager 2023-08-28T13:30:06.724298Z INFO ThreadId(13) pact_verifier::provider_client: Sending request to provider at http://localhost:44835/ 2023-08-28T13:30:06.724307Z INFO ThreadId(13) pact_verifier::provider_client: Sending request HTTP Request ( method: GET, path: /apis/appstudio.redhat.com/v1alpha1/namespaces/default/applications/myapp, query: None, headers: Some({"Content-type": ["application/json"]}), body: Missing ) 2023-08-28T13:30:06.728033Z INFO ThreadId(13) pact_verifier::provider_client: Received response: HTTP Response ( status: 200, headers: Some({"content-length": ["1990"], "content-type": ["application/json"], "audit-id": ["1661d23b-781f-4cb2-b6ce-8c0483154de9"], "date": ["Mon, 28 Aug 2023 13:30:06 GMT"], "cache-control": ["no-cache", "private"], "x-kubernetes-pf-prioritylevel-uid": ["ad80173c-8794-407b-b8e8-4832c173cd9f"], "x-kubernetes-pf-flowschema-uid": ["c0ea09c8-f75f-416a-a4e9-f5bc9e03116b"]}), body: Present(1990 bytes, application/json) ) 2023-08-28T13:30:06.728067Z INFO ThreadId(13) pact_matching: comparing to expected response: HTTP Response ( status: 200, headers: Some({"Content-Type": ["application/json"]}), body: Present(1063 bytes) ) 2023-08-28T13:30:06.728824Z INFO ThreadId(13) pact_verifier: Running teardown provider state change handler 'App myapp exists and has component gh-component and quay-component' for 'Get app with its components.' LOG: createAppAndComponents method was executed 2023/08/28 15:30:06 http: panic serving [::1]:33954: Your test failed. Ginkgo panics to prevent subsequent assertions from running. Normally Ginkgo rescues this panic so you shouldn't see it. But, if you make an assertion in a goroutine, Ginkgo can't capture the panic. To circumvent this, you should call defer GinkgoRecover() at the top of the goroutine that caused this panic. goroutine 705 [running]: net/http.(*conn).serve.func1() /usr/local/go/src/net/http/server.go:1825 +0xbf panic({0x2285b20, 0x2da9290}) /usr/local/go/src/runtime/panic.go:844 +0x258 http://github.com/onsi/ginkgo.Fail({0xc000cbda40, 0x13f}, {0xc000ca4568?, 0xc000cbda40?, 0xc000e5b680?}) /home/katka/go/pkg/mod/github.com/onsi/ginkgo@v1.16.5/ginkgo_dsl.go:291 +0xdd http://github.com/onsi/gomega/internal.(*Assertion).match(0xc00030df80, {0x2dc48e0, 0x437e1c8}, 0x1, {0x0, 0x0, 0x0}) /home/katka/go/pkg/mod/github.com/onsi/gomega@v1.24.1/internal/assertion.go:106 +0x1f0 http://github.com/onsi/gomega/internal.(*Assertion).Should(0xc00030df80, {0x2dc48e0, 0x437e1c8}, {0x0, 0x0, 0x0}) /home/katka/go/pkg/mod/github.com/onsi/gomega@v1.24.1/internal/assertion.go:50 +0xb5 http://github.com/redhat-appstudio/application-service/controllers.createAppAndComponents.func1(0x0?, {{0xc0012f1590?, 0xc000494c30?}, 0x42?}) /home/katka/hac/application-service/controllers/application_pact_test_state_handlers.go:46 +0x457 http://github.com/pact-foundation/pact-go/v2/provider.stateHandlerMiddleware.func1.1({0x2dd44b0, 0xc000a5e8c0}, 0xc0012ed400) /home/katka/go/pkg/mod/github.com/pact-foundation/pact-go/v2@v2.0.0-beta.23/provider/verifier.go:295 +0x6b4 net/http.HandlerFunc.ServeHTTP(0x2db87a0?, {0x2dd44b0?, 0xc000a5e8c0?}, 0x440f76?) /usr/local/go/src/net/http/server.go:2084 +0x2f http://github.com/pact-foundation/pact-go/v2/proxy.chainHandlers.func1.1({0x2dd44b0, 0xc000a5e8c0}, 0xc000ac1240?) /home/katka/go/pkg/mod/github.com/pact-foundation/pact-go/v2@v2.0.0-beta.23/proxy/http.go:68 +0x90 net/http.HandlerFunc.ServeHTTP(0x0?, {0x2dd44b0?, 0xc000a5e8c0?}, 0x413305?) /usr/local/go/src/net/http/server.go:2084 +0x2f net/http.serverHandler.ServeHTTP({0x2dc0e78?}, {0x2dd44b0, 0xc000a5e8c0}, 0xc0012ed400) /usr/local/go/src/net/http/server.go:2916 +0x43b net/http.(*conn).serve(0xc0009121e0, {0x2dd5b08, 0xc000b13dd0}) /usr/local/go/src/net/http/server.go:1966 +0x5d7 created by net/http.(*Server).Serve /usr/local/go/src/net/http/server.go:3071 +0x4db 2023-08-28T13:30:06.730080Z ERROR ThreadId(13) pact_verifier: Provider teardown state change for 'App myapp exists and has component gh-component and quay-component' has failed - MismatchResult::Error("Invalid response: error sending request for url (http://localhost:44835/__setup): connection closed before message completed", None)```

kkanova
2023-08-28 15:04
I was able to workaround it by adding if: ```func createAppAndComponents(HASAppNamespace string) models.StateHandler { var stateHandler = func(setup bool, s models.ProviderState) (models.ProviderStateResponse, error) { if !setup { println("skipping state handler") return nil, nil } ... } }``` but I would rather know where the hell is that setup bool being setup to false... :smile: Is there some doc about how to use the teardown? I've gone through the pact-go code briefly, but haven't found that yet. Thanks

kkanova
2023-08-28 15:06
Or is it preferred way of usage, to have if/else switch in every state handler? :thinking_face:

sathish.sundararajan
2023-08-28 16:22
I have added metadata info as you mentioned. But metadata is missing in the contract. To make sure, i tested out with the eg provided https://github.com/pact-foundation/pact-go/blob/master/examples/protobuf-message/protobuf_consumer_test.go which also fails to record metadata. Please find the bug i created for your ref: https://github.com/pact-foundation/pact-go/issues/331

alexander.doppelbauer
2023-08-28 17:52
has joined #pact-go


matt.fellows
2023-08-28 22:29
_(I?ll fix the spelling mistake I just noticed)_

jayapriya.m
2023-08-29 00:22
has joined #pact-go

grnmeadow7
2023-08-29 03:27
has joined #pact-go

kkanova
2023-08-29 07:59
Hm, ok, I didn't get that before. It confused me that https://github.com/pact-foundation/pact-go/blob/master/docs/provider.md#lifecycle-of-a-provider-verification is `StateHandler (post)` and it basically means the tear down method. I though it is something else. It was also not clear to me from the doc that it is required to have this switch as the same method will run twice. Sorry, it's probably just my misunderstanding. Thank you for your time, help and kindness :slightly_smiling_face:

sayantini.basak
2023-08-29 10:02
has joined #pact-go

shayanadc
2023-08-29 18:19
has joined #pact-go

yousafn
2023-08-30 13:19
Hello Pact-Gophers! Would anyone happen to be located in or near London, who has some Pact GoLang experience, and would to speak at a local meetup in September? If so let me know in a thread, and can discuss details!

jo.laing
2023-08-30 13:26
cc @theteea :crossed_fingers::skin-tone-2:

theteea
2023-08-30 13:28
:yay-clap:

jack.jones9512
2023-08-30 15:49
has joined #pact-go

craftyqa
2023-08-30 16:54
has joined #pact-go

jean-baptiste.bronisz
2023-08-31 15:48
has joined #pact-go

razorangel
2023-08-31 18:41
has joined #pact-go

dsharma
2023-08-31 19:11
has joined #pact-go

eytan.hanig
2023-08-31 22:10
has joined #pact-go

eytan.hanig
2023-09-01 03:07
@eytan.hanig has left the channel

munitheja91
2023-09-01 13:14
has joined #pact-go

christophe.laranjo
2023-09-01 19:10
Hello, I'm trying to run the test from the exemples but I get this error: someone know how to fix it?

christophe.laranjo
2023-09-01 21:03

matt.fellows
2023-09-02 04:11
It is the V2 package. How are you running it? Have you disabled cgo by any chance?

alvarado.kelvin
2023-09-02 12:48
has joined #pact-go

sautade
2023-09-04 01:23
has joined #pact-go

joshua.ellis
2023-09-04 04:51
has joined #pact-go

christophe.laranjo
2023-09-04 08:47
what do you mean by "how are you rrunning it?", I didn't touch the cgo at all, how I can check if it's disable?

matt.fellows
2023-09-04 09:49
I just mean how are you running the tests? I'd look at the CI builds for Pact Go and see what might be different

bbodoque.atsistemas
2023-09-04 10:21
has joined #pact-go

christophe.laranjo
2023-09-04 10:23
I run my test localy at the moment just for testing and learn

avanlent
2023-09-05 05:56
has joined #pact-go

callum.atkinson
2023-09-05 17:00
has joined #pact-go

sathish.sundararajan
2023-09-05 17:12
Does pact-go support rewriting grpc request headers/body to support provider side testing for handling different states ?

matt.fellows
2023-09-05 22:00
No, but it does support provider states

matt.fellows
2023-09-05 22:00
Is this for auth?

emilie.bline
2023-09-05 22:27
has joined #pact-go

me1414
2023-09-06 12:37
has joined #pact-go

juantamosaitis2015
2023-09-06 13:24
has joined #pact-go

sathish.sundararajan
2023-09-06 13:31
Yes thats correct but not as part of metadata but in the actual request

sathish.sundararajan
2023-09-06 13:32
Idea is to use provider states to modify the request body

ali.tariq
2023-09-06 14:51
has joined #pact-go

anas.zakarneh
2023-09-06 15:04
has joined #pact-go

jason.taylor2
2023-09-06 15:52
Seeing an issue with protobuf where the consumer test cannot find an enum definition when the message definitions are in multiple proto files. Opened an issue against pact-go with the details - but might be a plugin issue? https://github.com/pact-foundation/pact-go/issues/334

jvillars
2023-09-06 17:53
has joined #pact-go

f.barril
2023-09-06 21:53
Hi everyone, I have the following test ```package events import ( "http://github.com/pact-foundation/pact-go/dsl" "systems-management/database" "testing" ) var cenas = func(m dsl.Message) error { return processTrackerUpdateEvent(*m.Content.(*TrackerUpdateEvent)) } func TestMessageConsumer_Success(t *testing.T) { pact := dsl.Pact{ Consumer: "MyConsumer", Provider: "MyProvider", } message := pact.AddMessage() message.Given("couves"). ExpectsToReceive("assadas"). WithContent( //TrackerUpdateEvent{ // Tracker: database.Tracker{}, // TrackerUpdateRequest: database.TrackerUpdateRequest{}, //}, map[string]interface{}{ "Tracker": database.Tracker{}, "TrackerUpdateRequest": database.TrackerUpdateRequest{}, }, ). AsType(TrackerUpdateEvent{}) pact.VerifyMessageConsumer(t, message, cenas) }``` and I am getting the error ``` panic: interface conversion: interface {} is map[string]interface {}, not *events.TrackerUpdateEvent [recovered] panic: interface conversion: interface {} is map[string]interface {}, not *events.TrackerUpdateEvent``` any help ? thank you :pray:

f.barril
2023-09-06 21:56
I've tried with also (comes from your example on docs) ``` WithContent(map[string]interface{}{ "id": like(127), "name": "Baz", "access": eachLike(map[string]interface{}{ "role": term("admin", "admin|controller|user"), }, 3),```

f.barril
2023-09-06 22:08
may help ```type TrackerUpdateEvent struct { Tracker database.Tracker `json:"tracker"` TrackerUpdateRequest database.TrackerUpdateRequest `json:"update_request"` }```

matt.fellows
2023-09-06 23:27
Gotcha. I think for now, I?d follow the other guidance and remove auth from the contract (see howtoauth)

2023-09-06 23:27
Approaches to handling authentication in Pact tests: https://docs.pact.io/provider/handling_auth

sathish.sundararajan
2023-09-07 00:10
hmm, what if the grpc request is for checking if the user is authorized but nothing else ?

sathish.sundararajan
2023-09-07 00:28
Proto looks something like this ```{ "pact:proto": "/home/service.proto", "pact:proto-service": "Service/Validate", "pact:content-type": "application/protobuf", "request": { "token": "matching(type, 'bj8qnqw9cnalksnd9qwnk1j9cjm')" }, "response": { "valid": "matching(boolean, true)" } }```

matt.fellows
2023-09-07 00:43
Can you stub the service that validates the token when the verification happens?

sathish.sundararajan
2023-09-07 00:53
Actually the service under test here validates the token. Its not handled by another service

sathish.sundararajan
2023-09-07 00:54
I can stub the layer to mock the expected result

matt.fellows
2023-09-07 01:08
Is a valid token worth testing? Probably not, especially if you?re just going to replace it in the test itself anyway!

sathish.sundararajan
2023-09-07 01:13
Thats true, its a very simple interface

sathish.sundararajan
2023-09-07 01:16
In some cases, it gets a little complicated where auth is needed to further process the request! Rewriting auth header would be helpful

sathish.sundararajan
2023-09-07 01:17
Just like how we can do in REST contracts

matt.fellows
2023-09-07 03:39
Yep, understand. It gets a little tricker because Go / Client language would probably have to receive a raw `[]byte` and then hand it back to the framework. But I think it?s doable

matt.fellows
2023-09-07 03:40
@uglyog I seem to recall this being discussed somewhere but FYI. Something for us to consider in the future.

kwongs
2023-09-08 01:45
has joined #pact-go

alicankarayelli
2023-09-08 10:43
has joined #pact-go

sgregory875
2023-09-08 12:23
has joined #pact-go

sathish.sundararajan
2023-09-08 14:43
@matt.fellows is there a good gRPC example of using provider states for setting different states on provider side ?

amagana
2023-09-08 22:40
has joined #pact-go

heverson.amorim
2023-09-09 10:43
has joined #pact-go

matt.fellows
2023-09-11 02:44
I don?t think so. But provider states for gRPC are the same as anything else - unless I?m missing something?

vdlre1994
2023-09-11 05:55
has joined #pact-go

rware4
2023-09-11 10:16
has joined #pact-go

sathish.sundararajan
2023-09-11 13:22
gotcha thanks :slightly_smiling_face:

hdjikine
2023-09-11 13:55
has joined #pact-go

andrea.paschal
2023-09-11 16:48
has joined #pact-go

tigrandza
2023-09-12 03:14
@tigrandza has left the channel

olof.stalnacke
2023-09-12 05:31
has joined #pact-go

nvangari
2023-09-12 05:39
has joined #pact-go

srinivas.nali
2023-09-12 10:37
Hi all, quick query, if consumer is storing data in to DB without any handler service, how to generate the contract without calling handler's validation code? can we skip that to generate the json without using any code logic to check but go according to some json schema

matt.fellows
2023-09-12 11:00
mind clarifying the scenario? I?m not sure I follow sorry

rksekar5
2023-09-12 12:30
has joined #pact-go

srinivas.nali
2023-09-12 15:53
Provider Step AWS Lambda produces a JSON file into AWS S3 Consumer Step S3 content is copied into DB by parsing the file and using SQL queries I want to publish a contract by Consumer, so the provider conforms to a model schema. Since there isn?t a code handler wrapper I can use to verify here, how to generate the contract on consumer side?

srinivas.nali
2023-09-12 16:00
sorry for not making it clear, thanks Matt.

matt.fellows
2023-09-12 23:47
No worries

matt.fellows
2023-09-12 23:48
You can?t use JSON schema in place of Pact tests, but you could of course use it in a test if you wanted

matt.fellows
2023-09-12 23:48
Surely there is a part of your code base that knows how to parse such a data structure. That would be the target of your consumer test (it would also be a message Pact test, not a regular HTTP test in case you had thought that)

matt.fellows
2023-09-12 23:49
See https://docs.pact.io/getting_started/how_pact_works#how-to-write-message-pact-tests. If you can test the part of the code that generates the JSON (provide/producer side), but not the bit that writes to S3, then you should be good.

ying.li
2023-09-13 02:54
has joined #pact-go

srinivas.nali
2023-09-13 13:26
thanks Matt, will follow that. Cheers

david.hodnett
2023-09-14 18:06
has joined #pact-go

allen.ayala
2023-09-14 18:13
Our CI server doesn?t have the PACT CLI installed and the teams using the pact-go are seeing an error when running the contract tests in the CI server. Is there a way for teams to have the cli in their repo and mention it in the Go package manager, so that the Go Pact SDK can use that cli for the contract tests ? I see a similar capability exists on the node and pact node version (9) allows us to test using it

elenadoty
2023-09-14 19:17
I'm also running into this - did you find a workaround or solution?

jason.taylor2
2023-09-14 19:25
you can manually combine them into a single proto as a workaround

matt.fellows
2023-09-14 21:50
Not at the moment, it currently requires it to be in the path - can you CI not install that during build?

matt.fellows
2023-09-14 21:50
I'd accept a PR that allows for the path to be configured

jonatan.bjork
2023-09-15 13:30
has joined #pact-go

jonatan.bjork_test1
2023-09-15 13:41
has joined #pact-go

you1
2023-09-15 13:41
has joined #pact-go

jonatan.bjork_test2
2023-09-15 13:42
has joined #pact-go

you1634
2023-09-15 13:43
has joined #pact-go

m_testnewinvite
2023-09-17 22:43
has joined #pact-go

georg.duemlein
2023-09-18 04:09
has joined #pact-go

georg.duemlein
2023-09-18 04:10
@georg.duemlein has left the channel

sam647
2023-09-18 14:37
has joined #pact-go

edward
2023-09-19 07:24
has joined #pact-go

dbc216
2023-09-19 14:17
has joined #pact-go

tan.k.h.usa
2023-09-20 00:31
has joined #pact-go

daniel.hyun.chae
2023-09-20 13:19
has joined #pact-go

jake.corn
2023-09-21 14:01
has joined #pact-go

karl980
2023-09-21 16:44
has joined #pact-go

doctormiguel
2023-09-22 14:31
has joined #pact-go

felipe.simoes702
2023-09-22 17:37
has joined #pact-go

suat.kose
2023-09-22 22:13
has joined #pact-go

marius.grigoriu
2023-09-23 15:33
has joined #pact-go

noahmcivor
2023-09-24 06:54
has joined #pact-go

marek19922209
2023-09-25 08:09
has joined #pact-go

corey_maynard
2023-09-25 20:07
has joined #pact-go

rammohan_mididoddi
2023-09-25 20:12
has joined #pact-go

kevin
2023-09-26 02:31
has joined #pact-go

michael.lemos1
2023-09-26 12:36
has joined #pact-go

sliu
2023-09-27 00:00
has joined #pact-go

ankush.hasani
2023-09-27 10:01
has joined #pact-go

kai
2023-09-27 15:31
has joined #pact-go

a.monteiro
2023-09-28 09:59
has joined #pact-go


yousafn
2023-09-28 22:58
i saw a similar issue raised in the repo hmmmmm i assume this is with ventura 13.6? if not, what version are you running, and on which hardware, intel or apple silicon. i have test beds at home for both, so will have a look tomorrow. it?s plausible that macos have changed the dyld paths so that our expected load paths are no longer included ( that is my sneaky suspicion ) i also wonder if apple are changing up delivery mechanisms as i am still waiting release of the kernel development kit for 14.0rcX and 13.6b!

hazem
2023-09-28 23:02
it's MacOS 13.5.2 apple silicon and GO 1.21.1.

ml210993
2023-09-29 05:12
has joined #pact-go

yousafn
2023-09-29 09:50
Cheers for confirming Hazem

prempooon.hc
2023-09-29 11:35
has joined #pact-go

yousafn
2023-09-29 11:45
Those path lookups are normal places MacOS looks for dylibs, although it should include `/usr/local/lib` in there to find our added libraries but it doesn?t appear to be the case. https://github.com/pact-foundation/pact-go/issues/345#issuecomment-1740742887 You can try setting `DYLD_LIBRARY_PATH=/usr/local/lib` prior to running your go test to see if that helps?

jaishankar.nedunchezh
2023-09-29 17:07
has joined #pact-go

devin.woods
2023-09-29 19:28
has joined #pact-go

vittorio.gue
2023-09-30 10:51
has joined #pact-go

honglu11
2023-10-01 16:47
has joined #pact-go

matt.fellows
2023-10-01 23:30
Hi Haz, I?ll take a look at this this week. I suspect it relates to OS updates. I?m on the latest 13.5.x line so can add another perspective on it. Thanks for your awesome debugging too Yousaf.

hazem
2023-10-01 23:39
Thanks Matt, and I agree Yousaf is awesome as usual.

idd90i
2023-10-02 10:37
has joined #pact-go

kkanova
2023-10-02 12:47
Hi guys, we're extending our tests so I tried to use `pending pact` feature for synchronization. The good thing is it doesn't fail the suite, but it seems the tests are run twice - is that expected? It also seems that the `verifyRequest.AfterEach` is ignored somehow as the second run reports that resources already exist. Maybe I have something bad in my configuration, could you help me find a culprit please? Adding screens and log to the thread.

kkanova
2023-10-02 12:48
```... The pact at https://pact-broker-hac-pact-broker.apps.hac-devsandbox.5unc.p1.openshiftapps.com/pacts/provider/HAS/consumer/HACdev/pact-version/8f7d677e2bd85f9e523914e612b3082c558c6b17 is being verified because the pact content belongs to the consumer version matching the following criterion: * all consumer versions tagged 'PR808' (37dc07b) This pact is in pending state for this version of HAS because a successful verification result for a version of HAS from branch 'main' has not yet been published. If this verification fails, it will not cause the overall build to fail. Read more at https://docs.pact.io/go/pending Verifying a pact between HACdev and HAS Get app with its components. (1s 53ms loading, 2s 846ms verification) Given Application exists And Application has components returns a response which has status code 200 (OK) includes headers "Content-Type" with value "application/json" (OK) has a matching body (OK) CDQ was created (1s 53ms loading, 6ms verification) Given CDQ exists returns a response which has status code 201 (OK) includes headers "Content-Type" with value "application/json" (OK) has a matching body (FAILED) Create an application. (1s 53ms loading, 6ms verification) Given No app with the name app-to-create in the default namespace exists. returns a response which has status code 201 (OK) includes headers "Content-Type" with value "application/json" (OK) has a matching body (OK) This pact is still in pending state for any version of HAS from branch 'main' as the successful verification results have not yet been published. The pact at https://pact-broker-hac-pact-broker.apps.hac-devsandbox.5unc.p1.openshiftapps.com/pacts/provider/HAS/consumer/HACdev/pact-version/015fa7731662a83578a37f235f4f4b43b8c2fe5b is being verified because the pact content belongs to the consumer version matching the following criterion: * all consumer versions tagged 'PR808' (e28530f) This pact is in pending state for this version of HAS because a successful verification result for a version of HAS from branch 'main' has not yet been published. If this verification fails, it will not cause the overall build to fail. Read more at https://docs.pact.io/go/pending Verifying a pact between HACdev and HAS Get app with its components. (1s 53ms loading, 7ms verification) Given Application exists And Application has components Request Failed - One or more of the setup state change handlers has failed CDQ was created (1s 53ms loading, 5ms verification) Given CDQ exists returns a response which has status code 201 (FAILED) includes headers "Content-Type" with value "application/json" (OK) has a matching body (FAILED) Create an application. (1s 53ms loading, 6ms verification) Given No app with the name app-to-create in the default namespace exists. returns a response which has status code 201 (FAILED) includes headers "Content-Type" with value "application/json" (OK) has a matching body (FAILED) This pact is still in pending state for any version of HAS from branch 'main' as the successful verification results have not yet been published. Pending Failures: 1) Verifying a pact between HACdev and HAS Given CDQ exists - CDQ was created 1.1) has a matching body $ -> Actual map is missing the following keys: status 2) Verifying a pact between HACdev and HAS Given Application exists And Application has components - Get app with its components. - One or more of the setup state change handlers has failed 3) Verifying a pact between HACdev and HAS Given CDQ exists - CDQ was created 3.1) has a matching body $.status -> Type mismatch: Expected Map {"conditions":[{"lastTransitionTime":"2022-06-01T19:46:56Z","message":"ComponentDetectionQuery is processing","reason":"Success","type":"Processing"}]} but received String "Failure" $ -> Actual map is missing the following keys: spec $.apiVersion -> Expected 'http://appstudio.redhat.com/v1alpha1' (String) but received 'v1' (String) $.kind -> Expected 'ComponentDetectionQuery' (String) but received 'Status' (String) $.metadata -> Actual map is missing the following keys: creationTimestamp, generation, name, namespace 3.2) has status code 201 expected 201 but was 409 4) Verifying a pact between HACdev and HAS Given No app with the name app-to-create in the default namespace exists. - Create an application. 4.1) has a matching body $ -> Actual map is missing the following keys: spec $.apiVersion -> Expected 'http://appstudio.redhat.com/v1alpha1' (String) but received 'v1' (String) $.kind -> Expected 'Application' (String) but received 'Status' (String) $.metadata -> Actual map is missing the following keys: creationTimestamp, generation, managedFields, name, namespace, resourceVersion, uid 4.2) has status code 201 expected 201 but was 409 There were 4 non-fatal pact failures on pending pacts or interactions (see http://docs.pact.io/pending for more information) ...```

matt.fellows
2023-10-02 12:48
That?s not running twice, it?s verifying multiple contracts


matt.fellows
2023-10-02 12:48
Note the pact URLs for each section are different

kkanova
2023-10-02 12:49
aaah, yeah now I see that, I expected it to run just latest from the branch, I'll fix that, thx! But it still seems that after method is ignored, right?

matt.fellows
2023-10-02 12:50
First one: ```The pact at https://pact-broker-hac-pact-broker.apps.hac-devsandbox.5unc.p1.openshiftapps.com/pacts/provider/HAS/consumer/HACdev/pact-version/8f7d677e2bd85f9e523914e612b3082c558c6b17 is being verified because the pact content belongs to the consumer version matching the following criterion: * all consumer versions tagged 'PR808' (37dc07b)``` Second one: ```This pact is still in pending state for any version of HAS from branch 'main' as the successful verification results have not yet been published. The pact at https://pact-broker-hac-pact-broker.apps.hac-devsandbox.5unc.p1.openshiftapps.com/pacts/provider/HAS/consumer/HACdev/pact-version/015fa7731662a83578a37f235f4f4b43b8c2fe5b is being verified because the pact content belongs to the consumer version matching the following criterion: * all consumer versions tagged 'PR808' (e28530f)```

matt.fellows
2023-10-02 12:50
> But it still seems that after method is ignored, right? It shouldn?t, so it could be a bug


matt.fellows
2023-10-02 12:54
> is ignored somehow as the second run reports that resources already exist. are you able to elaborate on this point further?

kkanova
2023-10-02 13:07
I'll try to explain - it runs against two version, in both the `Get app with its components.` and `Create an application.` are not touched and should succeed. The second run fails though, saying that resources (those applications) already exists: ```2023-10-02T10:35:57.119775Z DEBUG ThreadId(01) verify_interaction{interaction="Create an application."}: pact_verifier::provider_client: body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"http://applications.appstudio.redhat.com \"app-to-create\" already exists","reason":"AlreadyExists","details":{"name":"app-to-create","group":"http://appstudio.redhat.com","kind":"applications"},"code":409}``` That indicates that the app was not removed, but should be during the `verifyRequest.AfterEach`. To verify the method was called, I've put debug text to the After Each method and it appreared 2 times in the middle of logs, seems like some asynchronous behaviour to me. Not sure if it is bug or my issue. I can try to move that logic to teardown suite.

kkanova
2023-10-02 13:08
Ah, I get it now, AfterSuite was executed just twice after those 2 passing tests in the first run. Makes sense, sorry

kkanova
2023-10-02 13:10
Is it intended though that AfterEach is not executed when the test fails?

matt.fellows
2023-10-02 23:19
> Is it intended though that AfterEach is not executed when the test fails? It?s a good question. Ideally it should still run I think

nathan
2023-10-03 00:43
has joined #pact-go

jonathan.ryding
2023-10-03 12:02
has joined #pact-go

hazem
2023-10-03 15:48
@matt.fellows and @yousafn - we confirmed this has been resolved now with the latest pact-go installer. Thank you for taking up this issue so quickly. +stan

corey_maynard
2023-10-03 20:24
@corey_maynard has left the channel

matt.fellows
2023-10-03 22:55
Awesome, great to hear that. Thanks for confirming too :slightly_smiling_face:

gabe.hollombe
2023-10-04 03:17
has joined #pact-go

pratyusha.boyapati
2023-10-04 08:35
has joined #pact-go

mateusz.socha
2023-10-04 10:41
has joined #pact-go

maja.vitaz
2023-10-05 10:37
has joined #pact-go

martindjk92
2023-10-05 13:05
has joined #pact-go

james814
2023-10-05 20:24
has joined #pact-go

craig.kilpatrick
2023-10-06 00:33
has joined #pact-go

prabakaranplaced
2023-10-06 08:00
has joined #pact-go

likekeys
2023-10-06 14:22
has joined #pact-go

chris.odryna
2023-10-06 16:51
has joined #pact-go

rezaur.rahman
2023-10-06 17:39
has joined #pact-go

julie.laursen
2023-10-06 17:43
has joined #pact-go

pratibha.kachi
2023-10-06 20:02
has joined #pact-go

robert579
2023-10-06 20:22
has joined #pact-go

sbalaranganathan
2023-10-09 12:10
has joined #pact-go

henrik
2023-10-09 18:15
has joined #pact-go

johnkavadias
2023-10-10 09:37
has joined #pact-go

jose-antonio.cano
2023-10-10 16:21
has joined #pact-go

panagiotis.liaros
2023-10-11 10:15
has joined #pact-go

ananya
2023-10-11 10:38
has joined #pact-go

ananya
2023-10-11 10:58
Hey folks, I am trying to run pact-go with `go test -mod=readonly -v .` Getting this error when I include the `"http://github.com/pact-foundation/pact-go/v2/consumer"` package Is anyone familiar with this? ```# http://github.com/pact-foundation/pact-go/v2/internal/native Undefined symbols for architecture x86_64: "_pactffi_create_mock_server_for_transport", referenced from: __cgo_df62a8d4863b_Cfunc_pactffi_create_mock_server_for_transport in _x003.o (maybe you meant: __cgo_df62a8d4863b_Cfunc_pactffi_create_mock_server_for_transport) "_pactffi_verifier_add_custom_header", referenced from: __cgo_df62a8d4863b_Cfunc_pactffi_verifier_add_custom_header in _x005.o (maybe you meant: __cgo_df62a8d4863b_Cfunc_pactffi_verifier_add_custom_header) "_pactffi_verifier_add_provider_transport", referenced from: __cgo_df62a8d4863b_Cfunc_pactffi_verifier_add_provider_transport in _x005.o (maybe you meant: __cgo_df62a8d4863b_Cfunc_pactffi_verifier_add_provider_transport) "_pactffi_verifier_new_for_application", referenced from: __cgo_df62a8d4863b_Cfunc_pactffi_verifier_new_for_application in _x005.o (maybe you meant: __cgo_df62a8d4863b_Cfunc_pactffi_verifier_new_for_application) "_pactffi_verifier_set_filter_info", referenced from: __cgo_df62a8d4863b_Cfunc_pactffi_verifier_set_filter_info in _x005.o (maybe you meant: __cgo_df62a8d4863b_Cfunc_pactffi_verifier_set_filter_info) "_pactffi_verifier_set_no_pacts_is_error", referenced from: __cgo_df62a8d4863b_Cfunc_pactffi_verifier_set_no_pacts_is_error in _x005.o (maybe you meant: __cgo_df62a8d4863b_Cfunc_pactffi_verifier_set_no_pacts_is_error) "_pactffi_verifier_set_publish_options", referenced from: __cgo_df62a8d4863b_Cfunc_pactffi_verifier_set_publish_options in _x005.o (maybe you meant: __cgo_df62a8d4863b_Cfunc_pactffi_verifier_set_publish_options) "_pactffi_with_header_v2", referenced from: __cgo_df62a8d4863b_Cfunc_pactffi_with_header_v2 in _x004.o (maybe you meant: __cgo_df62a8d4863b_Cfunc_pactffi_with_header_v2) "_pactffi_with_query_parameter_v2", referenced from: __cgo_df62a8d4863b_Cfunc_pactffi_with_query_parameter_v2 in _x004.o (maybe you meant: __cgo_df62a8d4863b_Cfunc_pactffi_with_query_parameter_v2) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) FAIL //[build failed] FAIL```


ananya
2023-10-11 12:30
Yes..(pact-go command is working) ``` % pact-go -l DEBUG install 2023/10/11 17:59:44 [INFO] package libpact_ffi found 2023/10/11 17:59:44 [INFO] checking version 0.4.5 of libpact_ffi against semver constraint >= 0.4.0, < 1.0.0 2023/10/11 17:59:44 [DEBUG] 0.4.5 satisfies constraints 0.4.5 >= 0.4.0, < 1.0.0 2023/10/11 17:59:44 [INFO] package libpact_ffi is correctly installed 2023/10/11 17:59:44 [DEBUG] skip checking ffi version() call because FFI not loaded. This is expected when running the 'pact-go' command.```

omar.sakka
2023-10-11 14:38
has joined #pact-go

brandon.king
2023-10-11 18:35
has joined #pact-go

sridhar.nayakwadi
2023-10-11 20:56
has joined #pact-go

saroja.bhogadhi
2023-10-11 20:58
has joined #pact-go

matt.fellows
2023-10-12 02:28
Can you please try that with the `-f` command to force a re-install? I want to ensure the architecture etc. matches the error

matt.fellows
2023-10-12 02:29
> ```ld: symbol(s) not found for architecture x86_64 > clang: error: linker command failed with exit code 1 (use -v to see invocation)``` You can also try adding that to the `lib.go` linker arguments to see if there is additional info it can share

ananya
2023-10-12 12:15
> Can you please try that with the `-f` command to force a re-install? This helped, thanks!

chris.paul
2023-10-12 15:54
has joined #pact-go

ryan.standley
2023-10-12 17:34
has joined #pact-go

joseph
2023-10-12 20:58
has joined #pact-go

laurie.green
2023-10-12 22:46
has joined #pact-go

nikesh1123
2023-10-13 10:32
has joined #pact-go

imthu55
2023-10-13 11:05
has joined #pact-go

dzianis_frydliand
2023-10-13 12:36
has joined #pact-go

john.maynard
2023-10-13 14:35
has joined #pact-go

cmuddam.testing
2023-10-15 06:46
has joined #pact-go

david.vadkerti.toth
2023-10-17 08:28
has joined #pact-go

shirley.houter
2023-10-17 08:52
has joined #pact-go

ruth.kurniawati
2023-10-17 20:02
has joined #pact-go

balaaji196
2023-10-18 10:46
has joined #pact-go

mpokala
2023-10-18 20:37
has joined #pact-go

hiroki.gota
2023-10-18 22:26
has joined #pact-go

mattisrobin
2023-10-18 22:37
has joined #pact-go

silvimasss
2023-10-18 23:43
has joined #pact-go

wanghedi88
2023-10-19 11:16
has joined #pact-go

sarah.diendorfer
2023-10-19 12:34
has joined #pact-go

ahmed.elakour
2023-10-19 12:35
has joined #pact-go

kkanova
2023-10-19 13:34
Hello, I'm a little confused with the Pact behaviour regarding non-defined states on provider side. Currently, the request is called even when state is not defined. Is it possible to fail the test if the state is not defined on provider? I would love to have tests like these `pending` more then passing. Thx! Log from my test: ```023/10/19 13:00:03 [INFO] executing state handler middleware 2023/10/19 13:00:03 [WARN] no state handler found for state: ComponentDetectionQuery progressing 2023-10-19T11:00:03.919419Z INFO ThreadId(13) pact_verifier: Running provider verification for 'request to return CDQ' 2023-10-19T11:00:03.919461Z INFO ThreadId(13) pact_verifier::provider_client: Sending request to provider at http://localhost:43615/ 2023-10-19T11:00:03.919465Z INFO ThreadId(13) pact_verifier::provider_client: Sending request HTTP Request ( ... ) 2023-10-19T11:00:03.921893Z INFO ThreadId(13) pact_matching: comparing to expected response: HTTP Response ( status: 200, headers: Some({"Content-Type": ["application/json"]}), body: Present(430 bytes) ) 2023-10-19T11:00:03.922307Z INFO ThreadId(13) pact_verifier: Running teardown provider state change handler 'ComponentDetectionQuery progressing' for 'request to return CDQ' 2023/10/19 13:00:03 [INFO] executing state handler middleware 2023/10/19 13:00:03 [WARN] no state handler found for state: ComponentDetectionQuery progressing ... request to return CDQ (0s loading, 5ms verification) Given ComponentDetectionQuery progressing returns a response which has status code 200 (OK) includes headers "Content-Type" with value "application/json" (OK) has a matching body (OK)```

parmin.rock
2023-10-19 14:57
has joined #pact-go

victor.yusuf
2023-10-19 14:58
has joined #pact-go

luke.dove
2023-10-19 15:46
has joined #pact-go

lee.andrews
2023-10-19 15:52
has joined #pact-go

mitchellp
2023-10-19 16:06
has joined #pact-go

mickelback00
2023-10-19 22:25
has joined #pact-go

matt.fellows
2023-10-20 01:18
Why would you want it to fail if the tests pass? That tells me you don?t really need to spend time creating a state handler for it

matt.fellows
2023-10-20 01:19
If it stops working, that will only happen if the code changes in the provider anyway, and would get caught other locally before you commit, or in the CI pipeline for that change.

kkanova
2023-10-20 09:23
Ok, I've not thought about using a tests without state. Is it a good practice? I thought it is better to define a state so it would make tests more stable (maybe I'm wrong, haven't proven that). We wanted to have a rule that every state defined in consumer is implemented in provider. So, when a new consumer comes, they can easily see what states are in place and they can reuse them. It will lower the provider work needed a lot. Btw, I'm still somehow struggling on how to share the "library" of states and their required parameters. I can't do a simple library as consumer is javascript and provider is golang. Do you have any experience with that?

philip.buttinger
2023-10-20 10:36
has joined #pact-go

adrian.kosyra
2023-10-20 11:58
has joined #pact-go

dave.hooson
2023-10-20 15:13
has joined #pact-go

pavankumar.cse88
2023-10-20 17:58
has joined #pact-go

the.m.bjorklund
2023-10-21 21:05
has joined #pact-go

thepiesaresquared
2023-10-22 09:58
has joined #pact-go

vasile.vetisan
2023-10-22 17:50
has joined #pact-go

sartom1994
2023-10-22 18:52
has joined #pact-go

rebecca.fulton
2023-10-23 09:27
has joined #pact-go

joao.jesus
2023-10-23 10:20
has joined #pact-go

kai.moseley
2023-10-23 10:47
has joined #pact-go

gunarajs
2023-10-23 19:23
has joined #pact-go

cody
2023-10-23 21:05
has joined #pact-go

cody
2023-10-23 21:07
An important part of contract testing is being able to run your service with mocked out dependencies. We have realized that there?s a great opportunity in contract testing to make ?fresh mocks?. Essentially mocks that closely align with their production counterparts, using contract testing to enforce this alignment. We?d like to have mocks that take in requests and look up the appropriate responses by consulting pact interaction files. Logically, we?d need a way of parsing pact interaction files to help us here. We also realize that this desired behavior is very similar to the pact mock server, but we saw that the pact mock server cannot handle multiple interactions. So our questions are: 1. Do you have any suggestions on how to integrate pact with mocks such that we can reliably call our mocks and get similar behavior to production counterparts? 2. Is it possible to expose the Pact interaction file parser (or get a code pointer to it) a. If not, do you know how often the pact parsing logic changes? (We may consider writing our own fork in Golang to avoid CGO issues) 3. Is it a large change to allow the pact mock server to handle multiple interactions at a time? We looked at the code a bit and am concerned about breaking the plugin api. The team would love to jump on a call to brainstorm with you if someone is willing. Let us know! :pray: cc @matt.fellows

ctrando
2023-10-23 21:14
has joined #pact-go

thibault.alix
2023-10-23 22:29
has joined #pact-go

kwapisz.bartosz
2023-10-24 08:38
has joined #pact-go

kkanova
2023-10-24 10:04
Hello, I've tried to use BeforeEach method and I see problems with multiple state setup. The problem is that BeforeEach runs before every state within one interaction, which basically doesn't make sense as it reset the setup from the previous state. My code: ``` interaction('Getting application', ({ provider, execute }) => { beforeEach(() => { provider .given("Application exists", appParams) .given("Application has components", compParams) .uponReceiving('Get app with its components.') .withRequest(contract.request) .willRespondWith(contract.response); }); ... }``` The log is like this: ```2023-10-24T08:30:08.922544Z INFO ThreadId(13) pact_verifier: Running setup provider state change handler 'Application exists' for 'Get app with its components.' beforeeach - clean up 2023/10/24 10:30:08 [INFO] executing state handler middleware application created 2023-10-24T08:30:09.190301Z INFO ThreadId(13) pact_verifier: Running setup provider state change handler 'Application has components' for 'Get app with its components.' beforeeach - clean up application removed 2023/10/24 10:30:09 [INFO] executing state handler middleware "create component error": "unable to get the Application"``` In the doc I found that multiple state setup is upported in V3 scheme, which is what we're using. Am I doing anything wrong?

btacca
2023-10-24 12:02
has joined #pact-go

anton.l.petersson
2023-10-24 13:54
has joined #pact-go

srinivas.nali
2023-10-24 16:12
hi all, on Concourse pipeline, I am getting this error ```=== RUN Test_HandlerContract 2023/10/24 16:10:39 [INFO] checking pact-provider-verifier within range >= 1.36.1, < 2.0.0 2023/10/24 16:10:39 [ERROR] CLI tools are out of date, please upgrade before continuing``` while running `go test` even though I installed the pact-cli, updated the path and got pact-go deps

srinivas.nali
2023-10-24 16:13
any one faced similar issue?

jowhalen13
2023-10-24 16:27
has joined #pact-go

tanyagorn.benjaprompa
2023-10-25 08:09
has joined #pact-go

matt.fellows
2023-10-25 09:43
I've only ever seen this when the path and/or tools are incorrectly installed

benguizat
2023-10-25 14:04
has joined #pact-go

stan196
2023-10-25 23:42
has joined #pact-go

manalikhanna92
2023-10-26 07:09
has joined #pact-go

aaron_carey
2023-10-26 09:26
has joined #pact-go

ms.maheshhwari
2023-10-26 09:54
has joined #pact-go

srinivas.nali
2023-10-26 14:52
looks like the alpine based golang docker image (which is what we used in concourse pipeline) doesn't support this underlying ruby https://docs.pact.io/docker#for-pact-implementations-that-use-the-rust-shared-core-or

srinivas.nali
2023-10-26 14:54
will have to switch to ubuntu based go docker image

ohisproperties2
2023-10-26 16:34
has joined #pact-go

anupama_enakula
2023-10-26 21:45
has joined #pact-go

matt.fellows
2023-10-26 21:59
Yep, you?ll need to switch to something with a glibc implementation

roger.liu
2023-10-27 07:15
has joined #pact-go

senbaga.kumarsigamani
2023-10-27 16:12
has joined #pact-go

alejandro.ignacio
2023-10-27 17:42
has joined #pact-go

br.holanda15
2023-10-27 18:47
Hey guys, I want to clarify some points that I found reading the https://github.com/pact-foundation/pact-go/blob/master/docs/messages.md#consumer: ? I didn't find the NewMessagePactV3 function inside the repository... Has it upgraded or changed this method? ? I also didn't find the type AsynchronousMessage... We are using inside de userHandlerWrapper that we assume as our adapter, abstracting the implementation and focusing on validating the content of the message. ? How can I publish the contract from this test to a Pact Broker?

devendra.patil
2023-10-27 21:40
has joined #pact-go

matt.fellows
2023-10-29 07:09
You're right, the V3 suffix was replaced with a package instead: here's a working example https://github.com/pact-foundation/pact-go/blob/781c59aa2b450d23bcbb566f71ec2986061ac3ac/examples/consumer_v3_test.go#L14

matt.fellows
2023-10-29 07:09
Publishing is the same as regular Pact. A contract will be generated and you would use the CLI tools to publish the contract

shenkesi.shiva
2023-10-30 06:57
has joined #pact-go

guido.lenacota
2023-10-30 09:48
has joined #pact-go

yihong.wang
2023-10-30 10:01
has joined #pact-go

br.holanda15
2023-10-30 12:23
I've got the part from the suffix, and about the contract, Shouldn't we specify the directory to generate the file? I saw that the struct Config has Consumer, Provider, and PactDir as attributes.. ```type Config struct { Consumer string Provider string PactDir string }``` So in the end of the TestMessagePact we didn't declare this part ``` provider, err := message.NewMessagePact(message.Config{ Consumer: "PactGoV3MessageConsumer", Provider: "V3MessageProvider", // must be different to the HTTP one, can't mix both interaction styles })```

br.holanda15
2023-10-30 12:47
I think I found the logic to store the files from the pact. If It's empty, It creates a new folder named pacts and put it inside.. ```func (p *AsynchronousPact) validateConfig() error { log.Println("[DEBUG] pact message validate config") dir, _ := os.Getwd() if p.config.PactDir == "" { p.config.PactDir = filepath.Join(dir, "pacts") } p.messageserver = mockserver.NewMessageServer(p.config.Consumer, p.config.Provider) return nil }```

ruth.bassindale
2023-10-30 20:54
has joined #pact-go

ruth.bassindale
2023-10-30 20:56
@ruth.bassindale has left the channel

srinivas.nali
2023-10-31 11:18
hey all, please correct my understanding I have added contract tests for message pacts using pact-go and got the setup done as below 1. Team A?s Message Pact Consumer side test runs using their JSON model for the data and publishes in Jenkins to the host with git version set to consumer version 2. Team B?s Message Pact Provider side test runs in Jenkins using their JSON Model and verifies against the contract from the host. 3. If there is a model change and both teams not in-sync, contract verification will fail and pipeline will fail, so both teams will have to liaise and fix. The pipeline failures have MSTeams alerts. I was thinking the above is enough to identify the dependency issues and solving the purpose. I haven?t incorporated below things, please advise whether these are required. 1. Publishing only when there is a change? 2. Can-i-deploy check? 3. Webhooks to trigger provider pipeline. Thanks.

yousafn
2023-10-31 12:39
yes to all, its advisable, but with regards to 1, the pact broker will determine if the contents have changed since the last verification and publish an event to trigger a webhook of the pact of that. so you can always publish the pacts from CI, regardless of whether there are changes or not (as that is determined by your broker) you?ll see specific rationale for each concept in the http://docs.pact.io site

srinivas.nali
2023-10-31 16:50
thanks @yousafn, will go through that site again to understand rationale, otherwise I take those 3 are advisable and my setup should be fine to carry on.

srinivas.nali
2023-10-31 17:05
Hey all, quick confirmation please for messages-pacts, Consumer test, I have set WithContent like this `"items": dsl.EachLike(map[string]interface{}{` `"id": "1270284",` `"qty": dsl.Integer(),` `}, 1),` and on Provider test, used the data for verification like `"data": {` `"date": "2023-11-06",` `"reference": "123",` `"items": [` `{` `},` `{` `}` `]` `}` still test is passing. Shouldn't it fail the match? for items

yousafn
2023-10-31 21:09
yea you can iteratively add each step into your existing setup.

sgavathe
2023-10-31 22:00
has joined #pact-go

matt.fellows
2023-10-31 23:58
Yes, this idea makes sense. Probably, the _stub_ server is a better use case here: https://github.com/pact-foundation/pact-stub-server. It takes a pact file and provides a stub service.

matt.fellows
2023-10-31 23:58
_(i.e. mocks != stubs)_

matt.fellows
2023-10-31 23:59
The key issue, I think, is that the stub server doesn?t support plugin interactions to my knowledge

matt.fellows
2023-11-01 00:00
That would need to happen to support your use case (which is gRPC/plugins right?)

matt.fellows
2023-11-01 00:00
> 1. Is it possible to expose the Pact interaction file parser (or get a code pointer to it) > a. If not, do you know how often the pact parsing logic changes? The specification governs the pact file format: https://github.com/pact-foundation/pact-specification/ The JSON schema there might be the best starting point.

matt.fellows
2023-11-01 00:01
However, with the introduction of plugins, the interactions are somewhat opaque to the pact file - each plugin can serialise their interactions in a way that makes sense for the plugin.

matt.fellows
2023-11-01 00:01
@uglyog @yousafn FYI.

matt.fellows
2023-11-01 01:07
can you please share the pact file?

matt.fellows
2023-11-01 01:08
note, for multi-line bodies of text, you can use the ?code block? syntax to format it better (triple backtick ``` , or this button in the text box):

cody.jenkins
2023-11-01 02:39
@cody.jenkins has left the channel

ntthaibk
2023-11-01 04:36
has joined #pact-go

rskilling
2023-11-01 10:23
has joined #pact-go

srinivas.nali
2023-11-01 13:27
thanks @matt.fellows this is the contract json

victor_do_val
2023-11-01 19:08
has joined #pact-go

james.corry
2023-11-01 19:23
has joined #pact-go

matt.fellows
2023-11-01 21:03
How do you know the provider data is incorrect? Could you please set log level to DEBUG and share that?

srinivas.nali
2023-11-02 08:42
on provider side, when below data was used, test is passing ```"data": { "date": "2023-11-06", "Reference": "123", "items": [ { }, { } ] }```

nicolas.cote-nolin
2023-11-02 12:30
has joined #pact-go

sivaganesh.sivakumar
2023-11-02 13:18
has joined #pact-go

cody
2023-11-02 20:18
I think I need to learn about plugins and plugin interactions a bit. cc @ctrando @stan196 from my team. (I didn?t realize they were in this slack :joy: ! :wave:) Maybe ya?ll already know about this?

stan196
2023-11-02 20:22
we do use grpc plugin. Afaik plugins just drop custom data under `metadata.plugins` field - like grpc plugin puts proto filedescriptor set plus the proto itself there. How much work would it be to have stub server support plugins?

srinivas.nali
2023-11-03 10:22
as the array is empty (incorrect) hoping the test to fail in this case?

id.akanksha26
2023-11-03 11:38
has joined #pact-go

prasant.iragavarapu
2023-11-03 15:06
has joined #pact-go

yagocre
2023-11-03 22:46
has joined #pact-go

ctrando
2023-11-06 07:22
Thanks for the response @matt.fellows! So if every plugin has its own interaction format, would you recommend that we try to augment the stub server to handle plugins (not sure how big of an undertaking that is) - or try to write a custom parser ourselves that can handle the limited plugins we need (which is just protobuf/grpc to my knowledge) ? Our company is having some big issues where everyone has their own mocks and only a few of them are correct so people only trust running in prod. Moreover, even if we migrate people to contract testing, if provider verification is performed on a service with unrealistic mocks, then the pacts can?t be trusted either (correct me if I?m wrong here). So we?re really looking for solutions on how to use Pact to provide accurate mock behaviors, any suggestions would be greatly appreciated :pray:

yousafn
2023-11-06 10:24
which types of provides are you mocking? currently the stub server is built for http interactions. there was a request for a stub server to be built for, or the existing extended to cover grpc. there is already tooling to generate grpc mocks and you could use pact to verify these if required. plugins can have their own interaction format and most likely will do to deal with specific of their particular use case. > Moreover, even if we migrate people to contract testing, if provider verification is performed on a service with unrealistic mocks, then the pacts can?t be trusted either (correct me if I?m wrong here). why would this be the case? the pacts are generated from real services in a unit test and verified against a real service which is running locally. if you are verifying against a service that is mocked what are you checking? that sounds like a recipe for drift, unless i?m missing something here

steve.blomeley
2023-11-06 14:50
has joined #pact-go

ctrando
2023-11-06 16:56
> which types of provides are you mocking? currently the stub server is built for http interactions. there was a request for a stub server to be built for, or the existing extended to cover grpc. We?re mocking interactions between grpc clients. > there is already tooling to generate grpc > mocks and you could use pact to verify these if required. Can you elaborate more on this? Do you mean using something like https://github.com/uber-go/mock? > why would this be the case? the pacts are generated from real services in a unit test and verified against a real service which is running locally. In order to run the pacts against our real service, we have to get our real service running locally, which requires mocking out its dependencies. So if the mocks necessary to have our service run locally aren?t high fidelity, then it?s difficult to trust that the pact was verified on the provider side > if you are verifying against a service that is mocked what are you checking? that sounds like a recipe for drift, unless i?m missing something here It?s not that the service is mocked, it?s that the service dependencies are mocked in order to get it to run locally

yousafn
2023-11-06 17:11
> there is already tooling to generate grpc mocks Here are a few that I?ve bookmarked in the past, or listed via https://github.com/grpc-ecosystem/awesome-grpc#tools ? https://github.com/testinggospels/camouflage ? https://github.com/tokopedia/gripmock ? https://github.com/Fadelis/grpcmock ? old - https://github.com/carvalhorr/protoc-gen-mock ? https://github.com/bradleyjkemp/grpc-tools ? https://learning.postman.com/docs/sending-requests/grpc/using-grpc-mock/ So your provider code, depends on other grpc services, which are being mocked out? and you are lacking confidence in these mocks?

yousafn
2023-11-06 17:12
> In order to run the pacts against our real service, we have to get our real service running locally, which requires mocking out its dependencies. So if the mocks necessary to have our service run locally aren?t high fidelity, then it?s difficult to trust that the pact was verified on the provider side Pact isn?t a replacement for functional tests, there should be sufficient functional testing of your provider to ensure it can fulfil its purpose. Pact has a side effect of functionally testing your provider. You can generate Provider verification tasks that provide little confidence as they touch too little of the application, that is plausible, but not something a tool can help with I don?t think

yousafn
2023-11-06 17:15
the request for grpc mock support in pact-stub-server https://github.com/pact-foundation/pact-stub-server/issues/59

ctrando
2023-11-06 17:16
Yes exactly! And I?m looking over the mocks you sent - it seems a lot of them are configured by files in a request-response type matching way. We were looking at file based mocks as well, but we wanted to see if Pact could directly verify these request/responses - i.e. we wouldn?t have to convert a file https://github.com/tokopedia/gripmock#static-stubbing from gripmock into a pact interaction file to verify that the mock is accurate. Rather we would be able to start a grpc mock using pact interaction files alone and then verify them directly. Do you know if that?s possible at the moment?

yousafn
2023-11-06 17:18
negative I believe, you may need to convert the pact interaction into the format required by one of the mocking tools.

yousafn
2023-11-06 17:18
I think it would be cool to have this feature, but I imagine it is some effort. Ideally if we can hook off an existing library that would be ace

yousafn
2023-11-06 17:18
the core lib is written in rust, so maybe there is something we can leverage there

ctrando
2023-11-06 17:20
Ah I see - yeah that?s why we were looking at Pact parsing mechanisms. We would have to handle the various pattern matching keywords in the pact interaction files and convert them to some other file format that a grpc mocking library could handle (or vice versa). > I believe, you may need to convert the pact interaction into the format required by one of the mocking tools. do you know if anyone has tried this before?

yousafn
2023-11-06 17:22
I?ve seen Pact -> Postman (https://github.com/ITV/pmpact) albeit for http. and PactFlow provide guidance for any mock format for HTTP -> Pact Interaction which is the other way round https://docs.pactflow.io/docs/bi-directional-contract-testing/contracts/pact#converting-mocks-into-a-pact-compatible-format this pattern used in a feature of wiremock-net and a few other adapters (cypress, msw)

yousafn
2023-11-06 17:23
we?ve got typed schemas for the pact-spec https://github.com/pactflow/pact-schemas I don?t think there is one for the pact-protobuf-plugin interaction, and its specific keys

ctrando
2023-11-06 17:24
Ah it looks like matchers are ignored in the second link - maybe we can do something like that where we just ignore matching (although it might limit the ability of pact) But I?ll take a look at the first link to see if we can try and implement our own parser to convert between file formats!

yousafn
2023-11-06 17:29
we ignore matching rules when converting mocks -> pact files for Bi-directional, as the comparison is performed against an OpenAPI file, which doesn?t utilise matchers (it checks the examples are a subset of the openapi schema) there have been lots of requests to include matchers so people can use the adapters for regular Pact CDCT, with a Pact provider verification, with a few attempting it but giving up/moving on to other things - probably easier just to use Pact on the consumer side natively, rather than indirectly.

yousafn
2023-11-06 17:29
Happy to help provide guidance or jam, so feel feel to soak in some on the reads and come back to us all :slightly_smiling_face:

yousafn
2023-11-06 17:30
ps. the matching is nice in the stub server, because it makes them more flexible for use in higher level tests, but not a deal breaker for a first pass

stan196
2023-11-06 23:48
Thanks for the links and the guidance so far! Reading through the thread and the links. To kinda take a step back here, pact consumer tests already run a mock server under the hood, it's just configured for a single interaction. Is the stub server based off the same codebase? I'm just wondering on how much work to be to either grab the built-in mock server from consumer tests and expand it to multiple interactions; or add plugin support to stub server. > Pact isn?t a replacement for functional tests, there should be sufficient functional testing of your provider to ensure it can fulfil its purpose. Yeah, 100%. I believe you folks discussed this above, might've missed some of the posts. Basically we were thinking along the lines of - if in my functional tests I mock out a service with which I already have pact contract tests, can I reuse these pacts to either (a) generate mocks from the pacts, which means they satisfy the contract and we have confidence; or (b) use existing pacts to verify the mocks generated by a 3rd party tool. Just to have confidence that the mocks behave in the same way the real services do, to a reasonable extent.

ndomingues10
2023-11-07 10:14
has joined #pact-go

nswetha.reddy
2023-11-07 19:21
has joined #pact-go

matt.fellows
2023-11-07 22:10
> To kinda take a step back here, pact consumer tests already run a mock server under the hood, it?s just configured for a single interaction. Is the stub server based off the same codebase? I?m just wondering on how much work to be to either grab the built-in mock server from consumer tests and expand it to multiple interactions; or add plugin support to stub server. Yes, you can https://github.com/pact-foundation/pact-stub-server/blob/master/Cargo.toml#L25-L27 uses some of the key libraries of the https://github.com/pact-foundation/pact-reference/tree/master/rust.

matt.fellows
2023-11-07 22:10
I think getting plugin support into the stub server would be ideal anyway,

matt.fellows
2023-11-08 10:14
Thanks. As per above, I?d like to see the DEBUG or even TRACE level logs to prove that

aparnakrishna1115
2023-11-08 14:55
has joined #pact-go

harry.talbot
2023-11-08 15:05
has joined #pact-go

daniel.phillips
2023-11-08 17:18
has joined #pact-go

yuliya.rahalski
2023-11-08 20:15
has joined #pact-go

olivier.picaud
2023-11-08 21:51
has joined #pact-go

joseenrique.garcia
2023-11-09 12:56
has joined #pact-go

ashish.patel5
2023-11-09 15:20
has joined #pact-go

cnguyen
2023-11-10 08:31
has joined #pact-go

nam.nguyen414
2023-11-10 12:35
has joined #pact-go

lewis
2023-11-10 16:33
has joined #pact-go

anna.lorenzi
2023-11-10 17:42
has joined #pact-go

nathan334
2023-11-10 18:34
has joined #pact-go

banghung859
2023-11-15 08:38
has joined #pact-go

ali
2023-11-16 04:50
has joined #pact-go

emmanuel
2023-11-16 09:40
has joined #pact-go

dan.corder
2023-11-16 11:37
has joined #pact-go

vikash.kumar.singh
2023-11-16 22:58
has joined #pact-go

barbara.szczygiel
2023-11-17 14:08
has joined #pact-go

maria.olivero
2023-11-17 16:57
has joined #pact-go

madhawa
2023-11-21 04:59
has joined #pact-go

pascal
2023-11-21 05:25
has joined #pact-go

srinu.innovatus
2023-11-21 08:09
has joined #pact-go

somya.khandelwal
2023-11-21 08:39
has joined #pact-go

ndruzhinina
2023-11-22 14:25
has joined #pact-go

jaspal.puri
2023-11-23 10:05
has joined #pact-go

ogbofjnr
2023-11-23 12:25
has joined #pact-go

patricio.dossantos_sl
2023-11-23 20:08
has joined #pact-go

martin.gallauner
2023-11-24 10:40
has joined #pact-go

aschaff
2023-11-24 15:27
has joined #pact-go

bruno.petkovic99
2023-11-25 13:55
has joined #pact-go

carlrconn
2023-11-27 02:22
has joined #pact-go

yi.wu
2023-11-27 08:10
has joined #pact-go

brian_worsham
2023-11-27 14:30
has joined #pact-go

jessie.eteng
2023-11-27 15:25
has joined #pact-go

crisciano.botelho
2023-11-27 18:57
has joined #pact-go

ajg.public
2023-11-27 21:44
has joined #pact-go

lukasz.lawicki
2023-11-28 10:06
has joined #pact-go

jawad.sefiani
2023-11-28 14:08
has joined #pact-go

elaine.silva
2023-11-28 17:50
has joined #pact-go

lukasz.lawicki
2023-11-29 06:54
@lukasz.lawicki has left the channel

tomasz.myszka
2023-11-29 14:21
has joined #pact-go

tom.willmott944
2023-11-29 14:44
has joined #pact-go

anna.nava
2023-11-29 20:56
has joined #pact-go

pasc.ther
2023-11-29 22:19
has joined #pact-go

awade
2023-11-30 13:49
has joined #pact-go

christophe.laranjo
2023-12-01 22:57
Hello, I'm trying to verify my provider but I have the error: 1) Failed to load pact - Could not load pacts from the pact broker 'https://mybroker.pactflow.io' err := verifier.VerifyProvider(t, provider.VerifyRequest{ ProviderBaseURL: "http://0.0.0.0:8080", Provider: "V3Provider", ProviderVersion: "1.0.0", BrokerURL: "https://mybroker.pactflow.io", BrokerUsername: "", BrokerPassword: "mypassword", BrokerToken: "myToken", Tags: []string{"master", "prod"}, PublishVerificationResults: true, // PactFiles: []string{ // filepath.ToSlash("/workspaces/go/consumer/pacts/PactGoProductAPIConsumer-PactGoProductAPI.json"), // }, If I try locally with PactFiles it's working I can verify my provider but if I change to try with the Broker everytime I have this error Failed to load pact and I don't understand why, if someone can help me it will be nice.

matt.fellows
2023-12-01 23:07
So you only use `token` if you use PactFlow, username/password is for a different authentication scheme

matt.fellows
2023-12-01 23:07
I?d set the log level to `debug` and see what the logs say about why it can?t find any pacts

matt.fellows
2023-12-01 23:08
also, you should avoid the use of `Tags` as they are the old way to publish and select pact files - you should look at branches/environment/releases: https://docs.pact.io/blog/2021/07/04/why-we-are-getting-rid-of-tags

christophe.laranjo
2023-12-01 23:18
ok thanks it was due to the username/password. now it's working

christophe.laranjo
2023-12-01 23:24
but why I my broker the verified status is still "never?

christophe.laranjo
2023-12-02 00:02
ok found the issue it was also because of the tags somewhere else in my code

vspallas
2023-12-03 10:18
has joined #pact-go

nicholaspatrickshaw
2023-12-04 10:32
has joined #pact-go

malvine.logina
2023-12-04 11:52
has joined #pact-go

vinicius.gabriel
2023-12-05 13:59
has joined #pact-go

stasiekps
2023-12-05 15:13
has joined #pact-go

antal.tettinger
2023-12-05 15:50
has joined #pact-go

archaanaaa8
2023-12-06 07:19
has joined #pact-go

visaliparimi
2023-12-06 10:03
has joined #pact-go

indrani.r
2023-12-06 10:06
has joined #pact-go

frank.weitmann
2023-12-06 10:23
has joined #pact-go

venketeshvenky
2023-12-06 10:40
has joined #pact-go

kyle.r.shrader
2023-12-07 01:33
has joined #pact-go

ajay991610
2023-12-07 05:27
has joined #pact-go

marko.stevanovic
2023-12-07 10:01
has joined #pact-go

christophe.laranjo
2023-12-07 10:38
Hello, an other question about the integration into the CI/CD pipeline: I'm currently trying to create a workflow to generate and publish my contract into my broker ```name: Build on: push: workflow_dispatch: jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: actions/setup-go@v4 with: go-version: 1.21.4 - name: change folder run: cd /opt - name: pact broker cli run: | mkdir -p $HOME/pact/bin curl -fsSL https://raw.githubusercontent.com/pact-foundation/pact-ruby-standalone/master/install.sh | bash -s -- -b $HOME/pact/bin - name: path run: export export PATH=$PATH:$HOME/pact/bin - name: instal pact run: go install github.com/pact-foundation/pact-go/v2@2.x.x - name: path for go1 run: export GOPATH=$HOME/go - name: path for go2 run: export PATH=$PATH:$GOPATH/bin - name: pact version run: pact-go -v - name: Debug pact run: pact-go -l DEBUG install - name: Test run: go test ./consumer - name: Publish pacts run: | pact-broker publish consumer/pacts --consumer-app-version 1.0.0 --broker-base-url=https://mybroker.pactflow.io --broker-token mytoken``` but I have an error of permission

christophe.laranjo
2023-12-07 10:40
someone know a solution or I'm doing wrong?

matt.fellows
2023-12-07 10:47
It?s trying to write the lib to `/usr/local/lib` but that directory is not writeable

matt.fellows
2023-12-07 10:48
You can set the download path to one of the other locations Pact Go checks. Here is how our PactFlow terraform client does it: https://github.com/pactflow/terraform-provider-pact/blob/master/.github/workflows/test.yml#L14-L15

matt.fellows
2023-12-07 10:49
_(I don?t the `LD_LIBRARY_PATH` env var is actually important, but I could be wrong about that)_

mahesh.manglani
2023-12-07 16:49
has joined #pact-go

gerard.molina
2023-12-07 17:00
has joined #pact-go

boyd.social
2023-12-07 17:52
has joined #pact-go

muhd_syamil.dzulkafta
2023-12-08 05:47
has joined #pact-go

christophe.laranjo
2023-12-08 09:01
thanks, it worked :slightly_smiling_face:

omer.sucu
2023-12-08 10:04
has joined #pact-go

hermoine807
2023-12-08 12:04
has joined #pact-go

blake.norrish
2023-12-08 17:05
has joined #pact-go

robert.jelic
2023-12-10 23:02
has joined #pact-go

theteea
2023-12-11 11:26
Hi, is there a course anyone would recommend that is a good first choice for adding contract testing with Pact to Go services? I quickly checked a few on Udemy but didn't see anything that would appear as the go-to -course.

pragna.reddy
2023-12-11 11:32
has joined #pact-go

oguzhannvarol
2023-12-11 14:13
has joined #pact-go

ryan.quinn
2023-12-11 17:57
has joined #pact-go

matt.fellows
2023-12-12 00:36
Probably this one: https://github.com/pact-foundation/pact-workshop-go It is using the previous major version though

arnon
2023-12-12 09:01
has joined #pact-go

theteea
2023-12-12 09:39
:affirmative:

lewis.blackwood
2023-12-12 14:04
has joined #pact-go

ilie.cotiuga
2023-12-12 14:26
has joined #pact-go

remyjaume
2023-12-12 15:46
has joined #pact-go

amelie.frappier
2023-12-12 18:55
has joined #pact-go

vinicius.gabriel
2023-12-12 19:07
Hi, there are something wrong or missing with my configurations to verify provider with Pactflow? My first tests was checking local files and then using local broker (with BrokerUsername and password) and everything worked well, but now trying with Pactflow I receive `1) Failed to load pact - Failed to load pact from 'https://broker.pactflow.io'` From consumer side, I got it normally ```// Verify the Provider with local Pact Files err := verifier.VerifyProvider(s.T(), provider.VerifyRequest{ ProviderBaseURL: fmt.Sprintf("http://127.0.0.1:%d", port), Provider: "web-front", ProviderVersion: "1.0.0", // TODO: get commit SHA BrokerURL: "https://broker.pactflow.io", // TODO: get from env BrokerToken: "token", // TODO: get from env```

vinicius.gabriel
2023-12-12 19:09
I couldn't identify anything relevant in the debug logs either The last logs near the error was: ```12-12T19:03:44.337255Z INFO ThreadId(01) pact_verifier::pact_broker: Fetching path '/pacts/provider/web-front/consumer/web-front-consumer/pact-version/222221279197eda18248e7c888cb2440ce0a9482/metadata/c1tdW2xdPXRydWUmc1tdW2N2XT0xMw' from pact broker 2023-12-12T19:03:44.337302Z DEBUG ThreadId(01) hyper::client::pool: reuse idle connection for ("https", http://broker.pactflow.io) 2023-12-12T19:03:44.337358Z DEBUG tokio-runtime-worker Connection{peer=Client}: h2::codec::framed_write: send frame=Headers { stream_id: StreamId(7), flags: (0x5: END_HEADERS | END_STREAM) } 2023-12-12T19:03:44.774798Z DEBUG tokio-runtime-worker Connection{peer=Client}: h2::codec::framed_read: received frame=Headers { stream_id: StreamId(7), flags: (0x4: END_HEADERS) } 2023-12-12T19:03:44.774926Z DEBUG tokio-runtime-worker Connection{peer=Client}: h2::codec::framed_read: received frame=Data { stream_id: StreamId(7) } 2023-12-12T19:03:44.774952Z DEBUG tokio-runtime-worker Connection{peer=Client}: h2::codec::framed_read: received frame=Data { stream_id: StreamId(7) } 2023-12-12T19:03:44.774961Z DEBUG tokio-runtime-worker Connection{peer=Client}: h2::codec::framed_read: received frame=Data { stream_id: StreamId(7), flags: (0x1: END_STREAM) } 2023-12-12T19:03:44.778494Z DEBUG tokio-runtime-worker Connection{peer=Client}: h2::codec::framed_write: send frame=GoAway { error_code: NO_ERROR, last_stream_id: StreamId(0) } 2023-12-12T19:03:44.778536Z DEBUG tokio-runtime-worker Connection{peer=Client}: h2::proto::connection: Connection::poll; connection error error=GoAway(b"", NO_ERROR, Library) 2023-12-12T19:03:44.778609Z ERROR ThreadId(01) pact_verifier: Failed to load pact - Failed to load pact from 'https://broker.pactflow.io' 2023-12-12T19:03:44.778703Z WARN ThreadId(01) pact_matching::metrics: ```

flament.thom
2023-12-12 20:43
has joined #pact-go

vinicius.gabriel
2023-12-12 21:59
idk exactly what happens but now it's working the problem was related only to fetch pact from Pactflow, I run one time by getting the Pact file from a local base and publish the results on Pactflow and then the next executions start to work

ckbisk
2023-12-12 22:18
has joined #pact-go

matt.fellows
2023-12-12 23:12
Let?s see how you go moving forward. Just note, ideally you should be using consumer version selectors to discover the pacts


sterankin
2023-12-13 10:57
has joined #pact-go

shane.bogdan
2023-12-13 12:06
has joined #pact-go

vinicius.gabriel
2023-12-13 12:42
Hmm got it, thank you!

luis.nuno
2023-12-13 18:08
has joined #pact-go

raleigh.schickel
2023-12-13 23:15
has joined #pact-go

hataipat.sup
2023-12-15 05:26
has joined #pact-go

hakan.dilaver
2023-12-15 13:54
has joined #pact-go

eliranbardavid
2023-12-17 09:06
has joined #pact-go

anthony.trad
2023-12-17 12:30
has joined #pact-go

m.mohammadi.se
2023-12-18 19:31
has joined #pact-go

lewis.foreman
2023-12-18 21:45
has joined #pact-go

eran.bergman560
2023-12-19 18:43
has joined #pact-go

tom.dracz
2023-12-20 09:53
has joined #pact-go

ivan.gutowski-smith
2023-12-20 10:40
has joined #pact-go

nicolas.vaquero
2023-12-20 11:31
has joined #pact-go

emailmvj
2023-12-20 16:18
has joined #pact-go

noelmccrory
2023-12-21 12:31
has joined #pact-go

fajfer.pawel
2023-12-21 13:39
has joined #pact-go

praful.poudel
2023-12-21 13:44
has joined #pact-go

pratyush.jaiswal88
2023-12-23 16:45
has joined #pact-go

grzegorz.v.bobrowski
2023-12-24 02:37
has joined #pact-go

elias.coelho
2023-12-27 17:52
has joined #pact-go

srinivas.nali
2023-12-28 17:47
Hi All, for message pacts, can we have a failure when new key-pairs added by the provider to the JSON? since consumer expectation json got matcher $.type, existing test is passing when new key-pairs added to the struct model by provider.

vittorio.gue
2023-12-28 18:55
Hi @srinivas.nali ! I dont remember all the specs and if what you are asking is possible but I am curious about what is the reason you would like the verification to fail when new fields are added to the body. One of the advantages of Pact is that you only specify contracts for the things you care in your consumer, not for all the permutations of the message(s).

matt.fellows
2023-12-28 20:53
No, pact won't fail if the provider returns additional keys

tomer
2023-12-28 21:52
has joined #pact-go

srinivas.nali
2023-12-29 13:32
right, thanks guys. It is like models are not in sync by both parties, since provider got new key-pairs. Since Contract test failure would highlight any mismatches thought this new model update could be covered as well.

vittorio.gue
2023-12-29 14:20
@srinivas.nali what is the impact of the mismatch in your system? What would give a failure? Do you think that something would break if the provider starts sending extra parameters or you have other reasons to need a failure?

srinivas.nali
2023-12-29 14:55
hi @vittorio.gue at the moment consumers not impacted due to existing expectations being met. All ok.

christopher316
2024-01-02 20:10
has joined #pact-go

matt.pichette
2024-01-02 20:26
has joined #pact-go

ocean.razafiarison
2024-01-03 08:57
has joined #pact-go

salmaan60
2024-01-03 20:14
has joined #pact-go

sam.huang1
2024-01-04 03:20
has joined #pact-go

ratnajenisha
2024-01-04 04:04
has joined #pact-go

markkellett
2024-01-04 18:27
has joined #pact-go

varghesevarampi
2024-01-05 02:10
has joined #pact-go

lbrndmrcr
2024-01-05 11:52
has joined #pact-go

mcarballido17
2024-01-05 20:12
has joined #pact-go

yonahlipman
2024-01-07 04:00
has joined #pact-go

varnit.garg2424
2024-01-07 15:16
While running pact go tests, I?m getting this error, any idea how to fix it? ```/opt/homebrew/Cellar/go/1.20.5/libexec/pkg/tool/darwin_arm64/link: running cc failed: exit status 1 ld: library not found for -lpact_ffi clang: error: linker command failed with exit code 1 (use -v to see invocation)```

varnit.garg2424
2024-01-07 18:33
It sorted! It was due to some local config issues

x1destory
2024-01-07 19:21
has joined #pact-go

x1destory
2024-01-07 19:23
Hello, i see in pact-java it looks like have multiple providers on a single test case, is that possible on pact-go?

matt.fellows
2024-01-07 22:37
mm I don?t think so.

matt.fellows
2024-01-07 22:37
why do you need to do this?

x1destory
2024-01-07 22:44
we are trying to build a weaker version of integrated test

x1destory
2024-01-07 22:46
i know to your community, it is kind of against the behaviour, but i do see that in the java code here:https://github.com/pact-foundation/pact-jvm/commit/67a66702496daa52ba060e3c68abe68deaff524a

matt.fellows
2024-01-07 23:58
The DSL is not currently setup to do it. It might be possible to do so in the core

matt.fellows
2024-01-08 00:00
It would need to make it?s way into this test suite, which has the official features the core supports (which can then be used in client languages): https://github.com/pact-foundation/pact-compatibility-suite/tree/main/features Java is a bit of a different beast, and occasionally has additional features not in other languages

x1destory
2024-01-08 10:04
One approach i am considering is in Provider state explicit call this is belong to service provider x, and then use a script to filter interactions based on that then upload the contracts, is that possible?

christopher.tonog
2024-01-08 18:53
has joined #pact-go

harshad.rayunipet
2024-01-09 08:06
has joined #pact-go

kumar.vas85
2024-01-09 09:50
has joined #pact-go

shuo.diao
2024-01-09 23:54
has joined #pact-go

chris.speck
2024-01-10 02:52
has joined #pact-go

trevor.cook
2024-01-10 18:33
has joined #pact-go

meetbogireddyhere
2024-01-11 16:20
has joined #pact-go

david.garratt
2024-01-12 10:36
has joined #pact-go

noelmccrory
2024-01-12 13:33
@noelmccrory has left the channel

roger.vanburgh
2024-01-12 16:54
has joined #pact-go

varnit.garg2424
2024-01-14 15:13
I?m getting this error while installing pact-go libs in the CI pipeline ```Your Pact library installation is out of date and we were unable to download a newer one for you: open /usr/local/lib/libpact_ffi.so: permission denied``` Using this command in makefile: `pact-go -l DEBUG install` Even tried `PACT_FFI_INSTALL_DIR=/tmp/pact-lib pact-go -l DEBUG` install but didn?t help. Any pointers on how to fix it?

varnit.garg2424
2024-01-14 17:22
Sorted after a lot of debugging. Added sudo and chmod!

matt.fellows
2024-01-14 20:31
Could we improve the install error somehow?

matt.fellows
2024-01-14 20:32
There is a log level flag on the install command

matt.fellows
2024-01-14 21:18
The debug should print out any problems and it should exit with nonzero status of it couldn't install it

sarah.omalley
2024-01-15 10:03
has joined #pact-go

lauren.flanagan
2024-01-15 13:51
has joined #pact-go

yousafn
2024-01-15 19:56
Yeah, I think if we get a perm denied error, we can advise the user use sudo or to write in a user writable location

tunga
2024-01-15 23:16
has joined #pact-go

sayan.adak
2024-01-16 12:21
has joined #pact-go

shobhit.agarwal
2024-01-16 12:22
has joined #pact-go

carmen.rietdijk
2024-01-16 12:53
has joined #pact-go

br.holanda15
2024-01-16 22:43
I got the same error executing the pact-go -l DEBUG install, I'll try with sudo... ```2024/01/16 19:39:38 [INFO] package libpact_ffi not found 2024/01/16 19:39:38 [INFO] downloading library from https://github.com/pact-foundation/pact-reference/releases/download/libpact_ffi-v0.4.5/libpact_ffi-linux-x86_64.so.gz to /usr/local/lib/libpact_ffi.so 2024/01/16 19:39:41 [ERROR] Your Pact library installation is out of date and we were unable to download a newer one for you: open /usr/local/lib/libpact_ffi.so: permission denied```

matt.fellows
2024-01-17 00:19
you can also override the install location. The pact go build itself does this: https://github.com/pact-foundation/pact-go/blob/master/.github/workflows/test.yml#L11

nick116
2024-01-17 09:57
has joined #pact-go

br.holanda15
2024-01-17 23:14
Hey guys, I don't understand some behavior from my pact provider, I set up my host as localhost:8081, but when I ran my tests I got a log from a request to a random port like localhost:36471, Is that ok? Am I missing some config? By the way I am writing the Provider part for the basic example at https://github.com/pact-foundation/pact-go/blob/master/examples/basic_test.go. _*My code:*_ ```func TestProductAPIProvider(t *testing.T) { go startServer() verifier := provider.NewVerifier() f := func(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { log.Println("Alterando Response") requestFilterCalled = true next.ServeHTTP(w, r) }) } err := verifier.VerifyProvider(t, provider.VerifyRequest{ ProviderBaseURL: "http://127.0.0.1:8001", Provider: "PactGoProductAPI", ProviderVersion: "v1", PactFiles: []string{ filepath.ToSlash(fmt.Sprintf("%s/PactGoProductAPIConsumer-PactGoProductAPI.json", pactDir)), }, RequestFilter: f, PublishVerificationResults: false, }) assert.NoError(t, err) assert.True(t, requestFilterCalled) } func startServer() { mux := http.NewServeMux() mux.HandleFunc("/products/{id}", func(w http.ResponseWriter, req *http.Request) { w.Header().Add("Content-Type", "application/json") fmt.Fprintf(w, ` { "id":10, "type":"CREDIT_CARD", "name":"PS5", "version":"v2" }`) }) log.Fatal(http.ListenAndServe("127.0.0.1:8001", mux)) }```

matt.fellows
2024-01-17 23:30
yep, the verifier spins up a proxy locally which all requests are sent to. This allows some features like provider states to be mapped to go functions, logging etc.

miguel.heitor
2024-01-18 09:03
has joined #pact-go

br.holanda15
2024-01-18 11:03
But what about the error that I got, Is this return expected? How can I redirect the proxy to my starterServer() which I am mocking my response? I simply followed the example like TestV3HTTPProvider test, and when I tried to run this test I got no tests to run in `TestConsumerV3` and `TestV3HTTPProvider` .

matt.fellows
2024-01-18 11:04
Can you please share the file you?re trying to run?

matt.fellows
2024-01-18 11:05
Note these build tags at the top: https://github.com/pact-foundation/pact-go/blob/master/examples/consumer_v3_test.go#L1 If you don?t specify them in the test command, they?ll be ignored

matt.fellows
2024-01-18 11:05
so `go test -tags consumer TestConsumerV3` for the consumer and `-tags provider` for the provider

matt.fellows
2024-01-18 11:05
(or remove tags if you don?t need them)

br.holanda15
2024-01-18 11:07
It is the _consumer_v3_test.go_ and _provider_test.go_ in the examples folder. I'm going to try this way :v:

anshita.tripathi
2024-01-18 11:07
has joined #pact-go

br.holanda15
2024-01-18 11:10
But in my example writing the `TestProductAPIProvider` to validate the `TestProductAPIClient` from basic_test.go in the examples folder, Do I need to setup the build like the other examples? Or is it something that I am missing? https://pact-foundation.slack.com/archives/C9UTHTFFB/p1705533277803099

hiroshi.fujii
2024-01-18 14:50
has joined #pact-go

ebernardino
2024-01-19 04:08
has joined #pact-go

ebernardino
2024-01-19 04:32
Hi Pact team! I wanted to ask what is the ideal setup in installing `pact-go` package in docker when running in a CI pipeline (in this case, buildkite)? I've encountered issues saying that `pact-go: command not found` but installed in in my Dockerfile and part of the `Makefile` command which runs the container and installs the package within it. I'm still learning the ways of docker so there are some terms new to me ```2024/01/19 00:57:52 [WARN] Usage of musl library is known to cause problems, prefer using glibc instead. 2024/01/19 00:57:52 [INFO] downloading library from https://github.com/pact-foundation/pact-reference/releases/download/libpact_ffi-v0.4.5/libpact_ffi-linux-x86_64.so.gz to /usr/local/lib/libpact_ffi.so &{} 2024/01/19 00:57:54 [INFO] package libpact_ffi found 2024/01/19 00:57:54 [INFO] checking version 0.4.5 of libpact_ffi against semver constraint >= 0.4.0, < 1.0.0 2024/01/19 00:57:54 [INFO] package libpact_ffi is correctly installed /bin/sh: line 2: pact-go: command not found``` Here's the `Dockerfile` ```FROM public.ecr.aws/docker/library/alpine:latest RUN apk add --no-cache git make musl-dev go RUN go version # Configure Go ENV GOROOT /usr/lib/go ENV GOPATH /go ENV PATH /go/bin:$PATH RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin # Install pact-go RUN go install http://github.com/pact-foundation/pact-go/v2@v2.0.2 ENV GOPATH /go ENV PATH /go/bin:$PATH``` and the command to run the test ```docker compose run go-builder-pact \ pact-go install -f && pact-go -l DEBUG install && go test -v -timeout 120s -count=1 ./tests/contract/... --tags=pact``` Thank you!

matt.fellows
2024-01-19 06:03
First up, I?d highly recommend _not_ using Alpine. We don?t officially support it (see the `WARN`). It might work, it might fail spectacularly (i.e. segfault). A debian based distribution is usually a safer bet

matt.fellows
2024-01-19 06:05
Secondly, the `ENV` command only sets the environment for the build stage. It won?t set it in the OS itself. For that, you?d need to add it to the user?s profile or another system location

matt.fellows
2024-01-19 06:05
Is there a reason you don?t just add `RUN pact-go install -f && pact-go -l DEBUG install` to the end of your docker file? Then the `go test?` should just work, assuming the go environment is correct

hegge.m
2024-01-19 09:40
has joined #pact-go

visser.r
2024-01-19 09:40
has joined #pact-go

yousafn
2024-01-19 17:11
:blobwave: Took a look at the pact-go workshop today and updated it to utilise pact-go v2. https://github.com/pact-foundation/pact-workshop-go/pull/9 Will propagate to each of the step branches and update the README shortly

matt.fellows
2024-01-19 23:01
Amazing! How was the experience? I'll take a look next week

varnit.garg2424
2024-01-21 13:20
Hey guys, I?m currently installing pact-go like this: ```install-pact: go install http://github.com/pact-foundation/pact-go/v2@v2.0.2 pact-go -l DEBUG install -d /tmp ls -la /tmp/``` Is it advisable to installing to /tmp on the developer machines? Or should I use docker instead? I understand that it will be slower if we use docker to run install/run pact tests.. Do you have any strong opinion on this?

matt.fellows
2024-01-21 21:24
I wouldn't use tmp as the os periodically clears files there

dcrivella
2024-01-21 23:51
has joined #pact-go

ebernardino
2024-01-21 23:53
Thanks Matt! It was mostly a noob decision but got it all working now :smile:

dmondejar
2024-01-22 03:39
has joined #pact-go

grzegorzstanek
2024-01-22 10:46
has joined #pact-go

yousafn
2024-01-22 11:19
not too bad, i just went via the example tests in master of pact-go and applied the changes that way. not a huge amount needed changing in the tests, I imagine it would have been easier if I was following a migration guide and sound it in steps. overall structure is nice of v2 interface two things that I think could probably be improved. the checkVersion function only checks the default path and wont consider it pact ffi being installed in the non default location. default write location for pact ffi isnt user writeable on macos or gh. we should probably put guidance on there to say check your location or use sudo. Can we not link to users home location so ~./pact or do we need a full file path for cgo? using pact cli is easy as go users have come from setting it on their path anyway. oh and not worked out how to get stdout logs from the ffi core over regular go logging

yousafn
2024-01-22 11:24
oh i was also hard to update/add pact go v2 to the go mod file, it kept complaining or pulling down 1.8.0. i think it might have been because i was a half way house with consumer test updated to v2 but provider still on v1

yousafn
2024-01-22 11:25
also 1.8.0 not listed on releases so was just confused. go mod confuse

matt.fellows
2024-01-22 11:28
> not too bad, i just went via the example tests in master of pact-go and applied the changes that way. not a huge amount needed changing in the tests, I imagine it would have been easier if I was following a migration guide and sound it in steps. I assume you saw https://github.com/pact-foundation/pact-go/blob/master/MIGRATION.md but chose to wing it, because you?re Saf? > the checkVersion function only checks the default path and wont consider it pact ffi being installed in the non default location. good pick up, probably easily fixed > default write location for pact ffi isnt user writeable on macos or gh. we should probably put guidance on there to say check your location or use sudo. Can we not link to users home location so ~./pact or do we need a full file path for cgo? unfortunately the only locations we can provide need to be fixed in this file: https://github.com/pact-foundation/pact-go/blob/master/internal/native/lib.go, and you can?t use any dynamic things like `~` or `$HOME` etc. I think you _can_ override the `LD_LIBRARY_PATH`, but that?s a bit scheizen too. It?s one of the downsides of Go packaging, you can?t make it install anything that?s not in the Go github tarball. I could possibly check the files in, but that would result in a huge github distribution - it?s worth considering given that it improves the experienc. > oh and not worked out how to get stdout logs from the ffi core over regular go logging (edited) ah yes, I was ahead of some of the recent logging functions added. We could look to overhaul that, and possibly make it a lot nicer/configurable

yousafn
2024-01-22 11:39
we?ve seen quite a few get stuck on the install recently so might be worth a consideration, having them checked in. i get the feeling that for go users that is generally okay as they seem to be comfortable vendoring deps and checking them in. thinking aloud q - does the pact go yml hold the location of where the user asked to install the ffi lib. if so we can use that in checkVersion func. no :relaxed: didnt read miggy guide. i knew you would have one, as for pact-js due to the reorganised docs across pact-js, go and net. I think i would prefer to see x code in v1 to y code in v2, so i tend to use upgrade pr?s to help me work out what to change and how.

yousafn
2024-01-22 11:39
ps miggy guide is very good, just read it now :sweat_smile:

matt.fellows
2024-01-22 11:41
> thinking aloud q - does the pact go yml hold the location of where the user asked to install the ffi lib. if so we can use that in checkVersion func. I can?t remember, but we could consider it. The loading logic isn?t ideal, because it?s somewhat configured in those ?headers? which aren?t introspectable via runtime code (at least not easily). Basically, when Go loads Pact Go, the loading has already happened in a compilation phase outside of Pact Go. That actually makes it impossible for the main Go program to check itself - the code that tries to check itself literally can?t load (put another way - any package that requires the FFI can?t run, if the FFI isn?t found. Hence why there is a CLI for checking things that doesn?t use that pathway)

francois.larouche1
2024-01-23 14:31
has joined #pact-go

sarah.souza
2024-01-23 15:24
has joined #pact-go

zachary.romano
2024-01-24 19:16
has joined #pact-go

ken.overgard
2024-01-24 19:32
has joined #pact-go

rama.ganapa
2024-01-24 21:13
has joined #pact-go

justin.gilroy
2024-01-24 21:46
has joined #pact-go

naveenkarkra
2024-01-24 23:36
has joined #pact-go

yangtao.ge
2024-01-25 11:07
has joined #pact-go

salman.bilalshah
2024-01-25 11:34
has joined #pact-go

sridhar.munendramani
2024-01-25 14:32
has joined #pact-go

scott.anderson
2024-01-25 15:05
has joined #pact-go

bala.kurakula
2024-01-25 17:21
has joined #pact-go

sarah.hand
2024-01-25 17:28
has joined #pact-go

corey.jewett
2024-01-25 18:48
has joined #pact-go

eddjlsh94
2024-01-26 09:41
has joined #pact-go

falkowski.b
2024-01-26 10:59
has joined #pact-go

yash.khade
2024-01-26 18:50
has joined #pact-go

joe.allen
2024-01-26 18:50
has joined #pact-go

andrew.voronin
2024-01-26 18:50
has joined #pact-go

richie.schramm
2024-01-26 18:55
has joined #pact-go

dsteinbach77
2024-01-26 23:23
has joined #pact-go

rachida_laghmami
2024-01-28 15:53
has joined #pact-go

hrushikesh.agrawal
2024-01-29 07:13
has joined #pact-go

santos.danallanbray
2024-01-29 10:50
has joined #pact-go

katie.andriacchi
2024-01-29 15:05
has joined #pact-go

darren.grove
2024-01-29 15:11
has joined #pact-go

michael.brandeis
2024-01-29 16:37
has joined #pact-go

niki.mahurin
2024-01-29 17:51
has joined #pact-go

arina
2024-01-29 21:48
has joined #pact-go

tomasz.perek
2024-01-30 12:19
has joined #pact-go

sofia
2024-01-30 17:12
has joined #pact-go

wesley.williams
2024-01-30 18:02
has joined #pact-go

j.sauret
2024-01-31 14:03
has joined #pact-go

michelle.ryals
2024-01-31 22:17
has joined #pact-go

jyothi.kaspa
2024-01-31 23:34
has joined #pact-go

patrika.patil
2024-02-01 16:41
has joined #pact-go

tim.willis
2024-02-01 16:44
has joined #pact-go

yogi.patel
2024-02-01 18:38
has joined #pact-go

sebbmoreno
2024-02-01 21:23
has joined #pact-go

cverma28
2024-02-02 10:30
has joined #pact-go

a.g.s.maxwell
2024-02-02 12:54
has joined #pact-go

t.mazelin
2024-02-02 23:33
has joined #pact-go

maeleeuxs
2024-02-03 10:20
has joined #pact-go

swaroopsonline
2024-02-04 02:44
has joined #pact-go

jose.silva
2024-02-04 14:45
has joined #pact-go

sonal3062000
2024-02-05 09:52
has joined #pact-go

lorenz.ammon082
2024-02-05 14:44
has joined #pact-go

patrick.barnes
2024-02-05 19:44
has joined #pact-go

andrew.kostka
2024-02-05 20:24
has joined #pact-go

allie
2024-02-05 20:25
has joined #pact-go

bryan.anderson
2024-02-05 21:18
has joined #pact-go

alec.abdul-rahim
2024-02-05 23:34
has joined #pact-go

filip.olszewski
2024-02-06 12:00
has joined #pact-go

amol.jose
2024-02-06 18:03
has joined #pact-go

ryoshida
2024-02-07 01:47
has joined #pact-go

ryoshida
2024-02-07 01:56
Hi all! I'm working along with @stan196 and we're running into an error with `pact-go` when response body is empty. I suspect it's a bug and was wondering if you could help. I see in the past that people have raised issue about allowing empty body: https://github.com/pact-foundation/pact-js/issues/177. ? https://github.com/pact-foundation/pact-js/pull/178/files to allow empty for *both response and request* ? https://github.com/pact-foundation/pact-jvm/commit/aece98db3a414c01771bea1abab10ef7e5f5306f as well for *both* However, for `pact-go`, it seemed like the fix was *only for allowing empty request but not for empty response:* https://github.com/pact-foundation/pact-go/commit/69125108ff7559355f088e8e16783bd3b09794f0 Curious if this is intentional or it's a potential bug?

matt.fellows
2024-02-07 02:02
It was probably just an omission. Would you be open to submitting a PR?

stan196
2024-02-07 03:29
Is this happening in the consumer or the provider test? Is that function handling just the response body or both body and metadata? I don't mind sending a PR, unless Rinka you want to handle this.

pallam.sudhasrinivas1
2024-02-07 13:21
has joined #pact-go

michal
2024-02-07 16:36
has joined #pact-go

ryoshida
2024-02-07 18:20
It's happening on the provider test. And I believe it handles just the response body because when I tested with some non-empty response metadata, it still gave me the same error. Awesome, could I trouble you to open the PR to fix the 2 returns @stan196 :dizzy:

stan196
2024-02-07 21:04
Sure, I'll look into this before the end of the week.

stan196
2024-02-08 01:36
This is a draft with some open questions I'm looking into: https://github.com/pact-foundation/pact-go/pull/383

niels.schuette
2024-02-08 14:18
has joined #pact-go

hazem
2024-02-08 16:25
:wave::skin-tone-4: - we're experiencing issues within the last day for our provider verifications. tbh, i'm not sure what the issue is but noticed a change in the libpact_ffi. additional notes in thread...

hazem
2024-02-08 16:31
last :white_check_mark: build ```[Container] 2024/02/08 03:02:28.886147 Running command go install github.com/pact-foundation/pact-go/v2@latest go: downloading github.com/pact-foundation/pact-go/v2 v2.0.2 ..truncated [Container] 2024/02/08 03:02:53.496129 Running command pact-go -l DEBUG install 2024/02/08 03:02:53 [INFO] package libpact_ffi not found 2024/02/08 03:02:53 [INFO] downloading library from https://github.com/pact-foundation/pact-reference/releases/download/libpact_ffi-v0.4.5/libpact_ffi-linux-x86_64.so.gz to /usr/local/lib/libpact_ffi.so &{} 2024/02/08 03:02:54 [DEBUG] obtaining hash for file /usr/local/lib/libpact_ffi.so 2024/02/08 03:02:54 [DEBUG] error reading file /root/.pact/pact-go.yml error: open /root/.pact/pact-go.yml: no such file or directory 2024/02/08 03:02:54 [DEBUG] writing config {map[libpact_ffi:{libpact_ffi 0.4.5 30ad4b93844bb4512ae7f0dd0266a33a}]} 2024/02/08 03:02:54 [DEBUG] writing yaml config to file libraries: libpact_ffi: libname: libpact_ffi version: 0.4.5 hash: 30ad4b93844bb4512ae7f0dd0266a33a 2024/02/08 03:02:54 [INFO] package libpact_ffi found 2024/02/08 03:02:54 [INFO] checking version 0.4.5 of libpact_ffi against semver constraint >= 0.4.0, < 1.0.0 2024/02/08 03:02:54 [DEBUG] 0.4.5 satisfies constraints 0.4.5 >= 0.4.0, < 1.0.0 2024/02/08 03:02:54 [INFO] package libpact_ffi is correctly installed 2024/02/08 03:02:54 [DEBUG] skip checking ffi version() call because FFI not loaded. This is expected when running the 'pact-go' command.```

hazem
2024-02-08 16:33
first failed :x: build ```[Container] 2024/02/08 14:00:23.228131 Running command go install http://github.com/pact-foundation/pact-go/v2@latest go: downloading http://github.com/pact-foundation/pact-go/v2 v2.0.3 ...truncate [Container] 2024/02/08 14:00:47.625763 Running command pact-go -l DEBUG install 2024/02/08 14:00:47 [INFO] package libpact_ffi not found 2024/02/08 14:00:47 [INFO] downloading library from https://github.com/pact-foundation/pact-reference/releases/download/libpact_ffi-v0.4.15/libpact_ffi-linux-x86_64.so.gz to /usr/local/lib/libpact_ffi.so&{} 2024/02/08 14:00:48 [DEBUG] obtaining hash for file /usr/local/lib/libpact_ffi.so 2024/02/08 14:00:48 [DEBUG] error reading file /root/.pact/pact-go.yml error: open /root/.pact/pact-go.yml: no such file or directory 2024/02/08 14:00:48 [DEBUG] writing config {map[libpact_ffi:{libpact_ffi 0.4.15 f6f4064cad0423a21423122287344c0c}]} 2024/02/08 14:00:48 [DEBUG] writing yaml config to file libraries: libpact_ffi: libname: libpact_ffi version: 0.4.15 hash: f6f4064cad0423a21423122287344c0c 2024/02/08 14:00:48 [INFO] package libpact_ffi found 2024/02/08 14:00:48 [INFO] checking version 0.4.15 of libpact_ffi against semver constraint >= 0.4.0, < 1.0.0 2024/02/08 14:00:48 [DEBUG] 0.4.15 satisfies constraints 0.4.15 >= 0.4.0, < 1.0.0 2024/02/08 14:00:48 [INFO] package libpact_ffi is correctly installed 2024/02/08 14:00:48 [DEBUG] skip checking ffi version() call because FFI not loaded. This is expected when running the 'pact-go' command.```

hazem
2024-02-08 16:42
the error from the logs for consumer pacts: ``` 2024-02-08T16:08:33.563649Z ERROR ThreadId(04) pact_ffi::mock_server::handles: Failed to parse the value: expected value at line 1 column 1 2024-02-08T16:08:33.563710Z ERROR ThreadId(04) pact_ffi::mock_server::handles: Failed to parse the value: expected value at line 1 column 1```

hazem
2024-02-08 17:23
additional logs after increasing log level: ```{"providerApplicationVersion":"REDACTED","success":false,"testResults":[{"exceptions":[{"message":"Invalid header name: 'Failed to parse header value: REDACTED'"}],"interactionId":"REDACTED","success":false}],"verifiedBy":{"implementation":"Pact-Rust","version":"1.1.19"}}```

joshua.ellis
2024-02-08 21:49
It looks like you also upgraded from Pact Go 2.0.2 to 2.0.3, though I agree with your assessment that it seems like the issue has originated from the FFI library. Any chance you're able to create a MWE of the error? The FFI error message isn't super helpful (which should itself be fixed). Alternatively, can you enable debug logging and share the logs to help narrow down the source of the issue? Feel free to create an issue over on GitHub if you want :)

hazem
2024-02-08 21:50
yes - 2.0.3 is what seems to have updated the ffi.

hazem
2024-02-08 21:51
what does this mean: _"Any chance you're able to create a MWE of the error?"_

joshua.ellis
2024-02-08 21:52
MWE stands for "minimal working example". That is, a minimal example that would reproduce the same error so that we can replicate it on our end :slightly_smiling_face:

hazem
2024-02-08 21:52
i added `PACT_LOG_LEVEL=TRACE` which gave me a bit more logs as i post above... what other logging to you suggest?

joshua.ellis
2024-02-08 21:53
For the examples, you could start with one of https://github.com/pact-foundation/pact-go/tree/master/examples and see what needs to be modified to reproduce the error.

hazem
2024-02-08 21:54
oof, and no i did not find a MWE

joshua.ellis
2024-02-08 21:55
I'm checking whether there's any other logging flags you can use...

joshua.ellis
2024-02-08 22:04
In addition to `PACT_LOG_LEVEL=TRACE`, can you also set `LOG_LEVEL=TRACE`?

hazem
2024-02-08 22:13
It doesnt look like any extra info was displayed in the logs... still same message ```{"providerApplicationVersion":"REDACTED","success":false,"testResults":[{"exceptions":[{"message":"Invalid header name: 'Failed to parse header value: REDACTED'"}],"interactionId":"REDACTED","success":false}],"verifiedBy":{"implementation":"Pact-Rust","version":"1.1.19"}}```

matt.fellows
2024-02-08 22:18
hmm sounds like there is a regression somewhere in the compatibility of the new FFI lib and Pact Go. We jumped several minor versions (of the FFI) in the 2.0.3 release . Given that it seems to be upset with your headers, would you mind creating a basic consumer test that fails with that error when verified? i.e. strip back to a basic Go HTTP client and test with similarly structured headers (it?s hard to see if it?s a request or response header that it?s having trouble with). If you can share the code (I?m assuming not, otherwise you wouldn?t have REDACTED things) that would also help.

hazem
2024-02-08 22:19
on my side it looks like an authorization header we added to the request

hazem
2024-02-08 22:20
i'm not able to dedicate time to this at the moment, but i should be able to follow-up tomorrow afternoon.

hazem
2024-02-08 22:34
I?m not salty enough for rust, but our header is just a jwt token

matt.fellows
2024-02-08 22:51
JWT is probably all we need to know for now

matt.fellows
2024-02-08 22:52
thanks Haz. For now, I?d suggest pinning to 2.0.2 and I?ll see if I can work out what?s happening today. I know there are some newer header functions in the FFI that might be easy enough to switch to

hazem
2024-02-08 22:52
yep - i just pinned one of our providers with the issue.

jeremy.buchmann
2024-02-09 00:11
has joined #pact-go

rachel.green
2024-02-09 00:15
has joined #pact-go

jj.guo
2024-02-09 00:33
has joined #pact-go

dipali.gulhane
2024-02-09 07:01
has joined #pact-go

manoj.chaudhari
2024-02-09 09:13
has joined #pact-go

martha.chambers
2024-02-09 16:15
has joined #pact-go

adonay.berhe
2024-02-09 16:52
has joined #pact-go

camilo.morales
2024-02-09 16:52
has joined #pact-go

stan196
2024-02-10 00:26
I've noticed that when we use synchronous message, it's contents will only contain the body, not metadata. What I mean is this: ``` ExecuteTest(t, func(transport message.TransportConfig, m message.SynchronousMessage) error { conn, err := grpc.Dial(fmt.Sprintf("127.0.0.1:%d", transport.Port), grpc.WithTransportCredentials(insecure.NewCredentials())) require.NoError(t, err) defer conn.Close() c := routeguide.NewRouteGuideClient(conn)``` here if we use protobuf plugin, we ignore the contents of the `m` param, so it's not an issue. however if we did want to use the `m` instead (idk maybe with different plugins?), it would only contain the body of the message, not metadata. I wonder if this is intentional? `pact-go` calls `pactffi_sync_message_get_response_contents_bin` to grab the bytes and populate `message.SynchronousMessage`. And in `ffi` part only grabs the `contents` field: https://github.com/pact-foundation/pact-reference/blob/master/rust/pact_ffi/src/models/sync_message.rs#L358 https://github.com/pact-foundation/pact-reference/blob/master/rust/pact_models/src/v4/message_parts.rs#L27 is metadata not supposed to be passed to the consumer, is it intended to only configure the provider?

stan196
2024-02-10 01:02
other than that, the PR is ready for review, I've added unit tests and cleaned up a bit

matt.fellows
2024-02-11 10:51
Thanks so much for this Stan, I?ll take a look on Monday.

matt.fellows
2024-02-11 10:52
I also just want to shout out how helpful you?ve been in the community at large recently @stan196, it hasn?t gone unnoticed - thank you! :taco: :taco: :taco:

jonathan.barker
2024-02-12 08:56
has joined #pact-go

tobiasroland
2024-02-12 10:48
has joined #pact-go

samantha.lam
2024-02-12 12:32
has joined #pact-go

logi.ragnarsson
2024-02-12 15:22
has joined #pact-go

matt.fellows
2024-02-13 07:18
/github subscribe pact-foundation/pact-go

2024-02-13 07:18
:white_check_mark: Subscribed to https://github.com/pact-foundation/pact-go. This channel will receive notifications for `issues`, `pulls`, `commits`, `releases`, `deployments`

matt.fellows
2024-02-13 07:19
/github unsubscribe pact-foundation/pact-go issues

2024-02-13 07:19
This channel will receive notifications from https://github.com/pact-foundation/pact-go for: `pulls`, `commits`, `releases`, `deployments`

matt.fellows
2024-02-13 07:19
/github unsubscribe pact-foundation/pact-go commits

2024-02-13 07:19
This channel will receive notifications from https://github.com/pact-foundation/pact-go for: `pulls`, `releases`, `deployments`

matt.fellows
2024-02-13 07:19
/github unsubscribe pact-foundation/pact-go pulls

2024-02-13 07:19
This channel will receive notifications from https://github.com/pact-foundation/pact-go for: `releases`, `deployments`

matt.fellows
2024-02-13 07:19
/github unsubscribe pact-foundation/pact-go deployments

2024-02-13 07:19
This channel will receive notifications from https://github.com/pact-foundation/pact-go for: `releases`

michal.patron
2024-02-13 10:41
has joined #pact-go

tomasz.fiechowski
2024-02-13 11:14
has joined #pact-go

coletaylor017
2024-02-13 19:50
has joined #pact-go

lachlan.austin
2024-02-13 22:44
has joined #pact-go

rejeesh.gangadharan
2024-02-14 00:55
has joined #pact-go

utku.kilincci01
2024-02-14 08:00
has joined #pact-go

ahmadlotfygamersfield
2024-02-14 14:38
has joined #pact-go

evan.hafers
2024-02-14 15:11
has joined #pact-go

christopher.tonog
2024-02-14 21:29
Hi :wave: I'm running into an issue with installing the extra libraries for pact-go (on a m2 mac): ```% pact-go install -f -d /usr/local/lib 2024/02/14 16:16:29 [INFO] set lib dir target to /usr/local/lib 2024/02/14 16:16:29 [INFO] downloading library from https://github.com/pact-foundation/pact-reference/releases/download/libpact_ffi-v0.4.16/libpact_ffi-osx-aarch64-apple-darwin.dylib.gz to /usr/local/lib/libpact_ffi.dylib 2024/02/14 16:16:30 [ERROR] Your Pact library installation is out of date and we were unable to download a newer one for you: open /usr/local/lib/libpact_ffi.dylib: permission denied``` A google search led me to this github issue: https://github.com/pact-foundation/pact-go/issues/239 Is it necessary to use sudo for this if I want to use the default dir? I ended up using `/tmp` to get myself unblocked but read earlier that that is not advisable. Thanks for all the help thus far!

yousafn
2024-02-14 21:36
Hey Chris, it is, as we use set lookup paths for linking the dynamic libraries https://github.com/pact-foundation/pact-go/blob/901aea82975ef17de71866bef6d017f6c4d55d09/internal/native/lib.go#L6 i dont think you can set to alternate paths not listed here unless you have sip disabled and therefore able to affect dynamic library load paths with `DYLD_LIBRARY_PATH` /tmp is okay is you are aware that it may be periodically cleared, but probably not during the execution of a test shortly after installing it i believe it will also look the library in the root of your project as well as the dynamic lib search paths, which might be an option.

christopher.tonog
2024-02-14 21:57
Thanks for the reply. Curious, which other library would you link with `libpact_ffi.dylib`? I downloaded the library to the root of my current project and added it to my path (`PATH=./:$PATH`) but I don't think that worked: ```running cc failed: exit status 1 ld: library 'pact_ffi' not found```

christopher.tonog
2024-02-14 21:58
I'll work with `/tmp` for now, it may be a moot point because we may bundle all this tooling inside a docker container or abstract it with another cli

yousafn
2024-02-14 22:00
it isn?t a binary executable, it is a shared library. therefore it needs a link path for cgo or be available on the LD_LIBRARY_PATH or DYLD_*** on macos. It?ll be different on a docker container as you say. You?ll still need the library even if you _abstract it away with another cli_ - it contains pacts core functions and each of the client libraries (such as pact-go / pact-js utilise it at runtime)

yousafn
2024-02-14 22:01
anyway /tmp is fine, if your tests complain about it being missing, you can reinstall it to /tmp :+1:

christopher.tonog
2024-02-14 22:01
yep yep, sounds good and good point on the other cli comment, that might just rule that implementation out

yousafn
2024-02-14 22:04
> Curious, which other library would you link with `libpact_ffi.dylib` not quite sure on the question. this is the library containing code from the pact-reference project (written in rust, compiled into a c shared library). it is linked to pact-go via the cgo which means pact-go isn?t a pure go implementation. our other CLI tools that used to be required for v1 of pact-go, still provide functionality for interacting with a pact broker and are available standalone, via ruby, or pre installed in docker container. those are binaries, and if you download the standalone versions, they can be added to your PATH

yousafn
2024-02-14 22:05
https://docs.pact.io/diagrams/ecosystem#rust-ffi-consumers-goldberg-machine diagram of the rust ecosystem, and a link to the core library that we link to, from pact-go https://github.com/pact-foundation/pact-reference/tree/master/rust/pact_ffi hope that helps a little bit :slightly_smiling_face:

christopher.tonog
2024-02-14 22:11
ah ok, yes that makes more sense to me now. That functionality, written in rust, is compiled to a c shared lib, then linked via cgo so that code can be reused essentially? Sorry if I am regurgitating what you just said, helps me understand things better :sweat_smile:

yousafn
2024-02-14 22:30
that it totally okay! It was all new to me, when I started digging in. Correct, it can be reused by any language that provides the ability to call C code, which effectively allows those languages to leverage from what was abundant, well written C code. Nowadays we can write our code in Rust and compile it down to C. Utilising it via a shared library makes process management alot easier compared to our previous state which was utilising a shared core written in Ruby, via subprocesses. There is syntactic sugar in each client language to provide idiomatic dsl?s for developers, and some languages as some extra features (such as request filters for modifying requests prior to execution)

matt.fellows
2024-02-14 23:58
I think I originally had `/opt` in it too, but that causes CGO warnings. I?d be open to other paths/suggestions.

matt.fellows
2024-02-14 23:58
I wish Go didn?t require this additional step to install the FFI, unlike other language dependency managers that can bundle it in

wiktor2.karpinski
2024-02-15 09:31
has joined #pact-go

dale.wells
2024-02-15 09:57
has joined #pact-go

cae.vieira
2024-02-15 11:37
has joined #pact-go

m.barbosa
2024-02-15 13:54
has joined #pact-go

r_connolly
2024-02-15 20:22
has joined #pact-go

wally.yuen
2024-02-16 00:42
has joined #pact-go

david.montero
2024-02-16 10:29
has joined #pact-go

hristian.iliev
2024-02-16 10:37
has joined #pact-go

hristian.iliev
2024-02-16 10:45
Hello Team :wave:, I'm currently navigating through setting up pact contract testing for a scenario involving two services communicating through DynamoDB. The first service persists data in a DynamoDB table, and the second service reads data asynchronously from that table, performing some business logic. Now from what I can understand this is a form of a contract, because the first service (Produces) needs to write the data in a specific way in order for it to be valid for the second service (Consumer) and this is what I aim to test. My understanding is that this scenario aligns with Asynchronous Contract Testing, but I'm not entirely certain if the same paradigms apply. Can anyone provide guidance on the approach I should take for writing contract tests in this context? Your insights would be greatly appreciated!

v-rybam-gri
2024-02-16 13:49
has joined #pact-go

msarayu1111
2024-02-16 13:49
has joined #pact-go

shivanirajebhosale16
2024-02-17 10:50
has joined #pact-go

matt.fellows
2024-02-18 04:31
Yes you?re on the right track


hristian.iliev
2024-02-18 09:37
Thank you, will try them out!

logi.ragnarsson
2024-02-18 09:44
@logi.ragnarsson has left the channel

maciej.harapinski
2024-02-19 09:42
has joined #pact-go

d.madureira
2024-02-19 14:17
has joined #pact-go

dpunna
2024-02-19 18:35
has joined #pact-go

michael.schmidt
2024-02-20 11:01
has joined #pact-go