Hi All, I am trying to publish the pact like this ...
# pact-go
s
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 152400 [INFO] checking pact-mock-service within range >= 3.5.0, < 4.0.0 2023/04/28 152400 [INFO] checking pact-provider-verifier within range >= 1.36.1, < 2.0.0 2023/04/28 152401 [INFO] checking pact-broker within range >= 1.22.3 2023/04/28 152402 [ERROR] service: /Users/srinivas.nali/pact/lib/ruby/lib/ruby/2.4.0/net/protocol.rb44in `connect_nonblock': SSL_connect returned=1 errno=0 state=error: wrong version number (OpenSSL:SSL:SSLError)
g
Looks like you’re trying to use
https
but don’t have an SSL cert. Can you try
<http://localhost:1234/>
instead?
s
thanks Greg, that solved ssl error. Cheers
🎉 1
I am now getting another error
2023/04/28 163102 [ERROR] service: PactBroker:Clienthal:ErrorResponseReturned - Error making request to http://localhost:1234 status=500 {"message":"No interaction found for GET /","interaction_diffs":[]} consumer_test.go49 Error on publish: exit status 1 --- FAIL: Test_Consumer (21.75s)
before running my customer test, I did run the server, using the command pact-mock-service start
g
Is that what’s running on port 1234?
s
yes
use case is non-http, message oriented testing
g
I don’t know much about message testing. What is it you’re expecting to see when you go to localhost:1234?
s
I thought it would have /pacts folder with the json created
similar to the case when published to pactflow.io
g
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 docker image or by starting it manually.
s
sure, will follow those and see
thank you very much Greg
m
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)
Thanks for your help @Greg Tyler 🌮 for you 😉
🥂 1
s
hi @Matt (pactflow.io / pact-js / pact-go) thank you for the input. I am learning about the setup and testing the tool for now. FYI, Our use case is message pacts
👍 1