Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

requestMetadata expects exact value instead of matching type #335

Open
sathishathpe opened this issue Sep 7, 2023 · 0 comments
Open

requestMetadata expects exact value instead of matching type #335

sathishathpe opened this issue Sep 7, 2023 · 0 comments

Comments

@sathishathpe
Copy link

Software versions

  • OS: e.g. Mac OSX 10.11.5
  • Consumer Pact library: Pact go v2.0.1
  • Golang Version: go1.20.5
  • Golang environment: GO111MODULE="" GOARCH="amd64" GOBIN="" GOCACHE="/home/dev/.cache/go-build" GOENV="/home/dev/.config/go/env" GOEXE="" GOEXPERIMENT="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOINSECURE="" GOMODCACHE="/home/dev/go/pkg/mod" GONOPROXY="github.hpe.com" GONOSUMDB="github.hpe.com" GOOS="linux" GOPATH="/home/dev/go" GOPRIVATE="github.hpe.com" GOPROXY="https://proxy.golang.org,direct" GOROOT="/usr/local/go" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64" GOVCS="" GOVERSION="go1.20.5" GCCGO="gccgo" GOAMD64="v1" AR="ar" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="/home/dev/ws/pact-go/go.mod" GOWORK="" CGO_CFLAGS="-O2 -g" CGO_CPPFLAGS="" CGO_CXXFLAGS="-O2 -g" CGO_FFLAGS="-O2 -g" CGO_LDFLAGS="-O2 -g" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build1831304596=/tmp/go-build -gno-record-gcc-switches"

Expected behaviour

requestMetadata matching type instead of exact values

Actual behaviour

requestMetadata matching exact value

Steps to reproduce

{
		"pact:proto": "/home/service.proto",
		"pact:proto-service": "Service/Validate",
		"pact:content-type": "application/protobuf",
		"request": {
			"token": "matching(type, 'bj8qnqw9cnalksnd9qwnk1j9cjm')"
		},
		"requestMetadata": {
			"x-b3-traceid": "matching(type, 'foo')"
        },
		"response": {
			"valid": "matching(boolean, true)"
		}
	}

Relevent log files

pact validation failed: [{Request:{Method: Path:Service/Validate Query: Headers:map[] Body:<nil>} Mismatches:[{Actual:0123456789abcdef0123456789abcdef Expected:foo Key: Mismatch:Comparison of metadata key 'x-b3-traceid' failed: Expected 'foo' to be equal to '0123456789abcdef0123456789abcdef' Type:}] Type:}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: New Issue
Development

No branches or pull requests

1 participant