Guillaume Camus
06/29/2022, 1:29 PM2.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?Ringo
06/30/2022, 10:35 AMerr = 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 (pactflow.io / pact-js / pact-go)
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
06/30/2022, 1:20 PMMap
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
06/30/2022, 1:27 PMcannot 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
Ravindra Dhaka
07/06/2022, 7:14 AMmake 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|github.com/pact-foundation/pact-go> v1.7.1-0.20220627045253-94d333263e43
go: finding <http://cloud.google.com/go|cloud.google.com/go> v0.46.3
go: finding <http://github.com/hashicorp/logutils|github.com/hashicorp/logutils> v1.0.0
go: finding <http://github.com/hashicorp/go-version|github.com/hashicorp/go-version> v1.5.0
go: finding <http://google.golang.org/api|google.golang.org/api> v0.13.0
go: finding <http://github.com/stretchr/testify|github.com/stretchr/testify> v1.7.4
go: finding <http://github.com/gorilla/websocket|github.com/gorilla/websocket> v1.4.2
go: finding <http://golang.org/x/net|golang.org/x/net> v0.0.0-20210226172049-e18ecbb05110
go: finding <http://github.com/stretchr/objx|github.com/stretchr/objx> v0.4.0
go: finding <http://golang.org/x/crypto|golang.org/x/crypto> v0.0.0-20210921155107-089bfa567519
go: finding <http://golang.org/x/text|golang.org/x/text> v0.3.3
go: finding <http://github.com/gin-gonic/gin|github.com/gin-gonic/gin> v1.7.7
go: finding <http://gopkg.in/yaml.v3|gopkg.in/yaml.v3> v3.0.1
go: finding <http://github.com/google/uuid|github.com/google/uuid> v1.3.0
go: finding <http://github.com/klauspost/compress|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|frontiercargroup.org/dealer/consumer/client> 10.026s
FAIL
make: *** [Makefile:221: consumer] Error 1
Ravindra Dhaka
07/06/2022, 7:14 AMPACT := $(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
07/06/2022, 7:15 AMRUN make $GOPATH/bin/pact
Ravindra Dhaka
07/10/2022, 5:13 PM/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
07/10/2022, 5:14 PMErik Kvale
07/11/2022, 3:31 PMSlackbot
07/12/2022, 8:24 AMNuno Frias
07/12/2022, 4:24 PMPact-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.John Ed Alvinez
07/20/2022, 11:51 AMpact-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` field to an interaction 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.Tarun Gulati
07/21/2022, 6:49 PMWithContent(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
Mark Wilson
07/26/2022, 2:20 PMwin
07/26/2022, 3:23 PMHazem Borham
07/28/2022, 5:40 PMPactLogDir
for a provider verification. In the latest 1.7, the field is on VerifyRequest
Is this still configurable?Robert Henzel
07/28/2022, 7:53 PM=== 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 (pactflow.io / pact-js / pact-go)
Failed to invoke protoc binary: exit code exit status: 1I’m not sure if this is the cause, but it seems to not be able to run the
protoc
binary.Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Robert Henzel
07/29/2022, 6:37 AMservicemodulesecure.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. 😕
Edit: I think the permissions are all right because I was able to run the tests from pact-go/examples/grpc
directory without problems.Robert Henzel
07/29/2022, 12:13 PMRobert Henzel
07/29/2022, 12:14 PM1) 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
Guillaume Camus
07/29/2022, 1:43 PMpact-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
07/29/2022, 2:32 PMRobert Henzel
07/29/2022, 2:33 PMRobert Henzel
08/03/2022, 5:47 PM