Open jasonltaylor opened 1 year ago
Thanks Jason. Do you have a particular setup you could share that produces this issue? We run gRPC examples as part of the build and I haven't seen this, so I'm guessing it's perhaps the use of request filters causing the proxy issues?
Was able to narrow it down today. I wasn't explicitly passing the Transports to VerifyProvider which up until now had been working ok. If I add that in my provider verification is passing. Can get the pact-go example gRPC provider to fail with the same error by commenting that out:
$ git diff grpc_provider_test.go
diff --git a/examples/grpc/grpc_provider_test.go b/examples/grpc/grpc_provider_test.go
index 8b8c873..34d47ef 100644
--- a/examples/grpc/grpc_provider_test.go
+++ b/examples/grpc/grpc_provider_test.go
@@ -1,6 +1,3 @@
-//go:build provider
-// +build provider
-
package grpc
import (
@@ -30,12 +27,12 @@ func TestGrpcProvider(t *testing.T) {
err := verifier.VerifyProvider(t, provider.VerifyRequest{
ProviderBaseURL: "http://localhost:8222",
- Transports: []provider.Transport{
- provider.Transport{
- Protocol: "grpc",
- Port: 8222,
- },
- },
+ // Transports: []provider.Transport{
+ // provider.Transport{
+ // Protocol: "grpc",
+ // Port: 8222,
+ // },
+ // },
Provider: "grpcprovider",
PactFiles: []string{
filepath.ToSlash(fmt.Sprintf("%s/../pacts/grpcconsumer-grpcprovider.json", dir))
hmmm, I think I noticed this or something similar, where the transports are actually being picked up from the pact file, (in which the interaction specifies the protocol and plugin/plugin version)
not directly in testing pact-go, but generally testing the plugin framework
Thanks Jason. I think some documentation will help this, and possibly there is something we can do to guard in Pact Go.
Basically, the core will attempt to use the same transport for all plugins if others aren't given to it. That might be sensible, but the errors aren't exactly clear.
ok - wasn't sure if just a regresssion since the client contract has the transport defined in it.
Software versions
Expected behaviour
Pact provider verification for gRPC contract runs successfully.
Actual behaviour
Provider verification fails with transport error.
Steps to reproduce
Run gRPC contract tests with latest 2.x.x codebase. The tests pass when pinned to v2.0.0-beta.17 tag but fail if using the tip of the 2.x.x branch.
Relevent log files