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

Default PactFileWriteMode silently fails in VerifyMessageConsumer #96

Closed
alexeits opened this issue Sep 27, 2018 · 3 comments
Closed

Default PactFileWriteMode silently fails in VerifyMessageConsumer #96

alexeits opened this issue Sep 27, 2018 · 3 comments

Comments

@alexeits
Copy link

Software versions

  • OS: macOS 10.13.6 (17G65)

  • Consumer Pact library: pact-go v1.0.0-beta.2

  • Golang Version: go version go1.10.3 darwin/amd64

  • Golang environment:

    GOARCH="amd64"
    GOBIN=""
    GOCACHE="/Users/alex/Library/Caches/go-build"
    GOEXE=""
    GOHOSTARCH="amd64"
    GOHOSTOS="darwin"
    GOOS="darwin"
    GOPATH="/Users/alex/Documents/source/go"
    GORACE=""
    GOROOT="/usr/local/Cellar/go/1.10.3/libexec"
    GOTMPDIR=""
    GOTOOLDIR="/usr/local/Cellar/go/1.10.3/libexec/pkg/tool/darwin_amd64"
    GCCGO="gccgo"
    CC="clang"
    CXX="clang++"
    CGO_ENABLED="1"
    CGO_CFLAGS="-g -O2"
    CGO_CPPFLAGS=""
    CGO_CXXFLAGS="-g -O2"
    CGO_FFLAGS="-g -O2"
    CGO_LDFLAGS="-g -O2"
    PKG_CONFIG="pkg-config"
    GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/5v/fvbqg92n7wg1vkr3gg4glvyh0000gn/T/go-build756609652=/tmp/go-build -gno-record-gcc-switches -fno-common"
    

Expected behaviour

The unspecified / default PactFileWriteMode should produce a pact file

Actual behaviour

The default PactFileWriteMode silently fails to produce a pact file

Steps to reproduce

  1. Configure pact as follows:

    pact = &dsl.Pact{
    	Consumer:  "PactGoMessageConsumer",
    	Provider:   "PactGoMessageProvider",
    	PactDir:    "/path/to/pacts",
    }
  2. Run any pact using VerifyPactMessage (the consumer example would do)

  3. Observe that no pact file is produced

  4. Add PactFileWriteMode: "update" to the pact struct initializer

  5. Verify that pact is being produced

@mefellows
Copy link
Member

Good spot. I've pushed up a small change now that should sort it out. If you could please confirm, I'll bump the version.

@alexeits
Copy link
Author

alexeits commented Oct 2, 2018

Yes, the fix works great, thank you.

@mefellows
Copy link
Member

Thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants