pact-foundation / pact-go

Golang version of Pact. Pact is a contract testing framework for HTTP APIs and non-HTTP asynchronous messaging systems.
http://pact.io
MIT License
857 stars 109 forks source link

pact-go binary release 0.0.8 and 0.0.9 just broken? (pact-mock-service: no such file or directory) #43

Closed haavardw closed 7 years ago

haavardw commented 7 years ago

Software versions

Working consumer and mux provider examples

Actual behaviour

Output from downloading and running go-pact daemon:

$ mkdir new-bin && cd new-bin \
    && curl -OL https://github.com/pact-foundation/pact-go/releases/download/v0.0.9/pact-go_linux_amd64 \
    && chmod 755 pact-go_linux_amd64 && mv pact-go_linux_amd64 pact-go \
    && ./pact-go daemon -v -l DEBUG
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   609    0   609    0     0    979      0 --:--:-- --:--:-- --:--:--   980
100 8904k  100 8904k    0     0  1895k      0  0:00:04  0:00:04 --:--:-- 2297k
2017/08/09 22:38:36 [DEBUG] setting up a service manager
2017/08/09 22:38:36 [DEBUG] setting up a service manager
2017/08/09 22:38:36 [DEBUG] setting up a service manager
2017/08/09 22:38:36 [DEBUG] setting up a service manager
2017/08/09 22:38:36 [INFO] daemon - starting daemon on network: tcp address:  port: 6666
2017/08/09 22:38:36 method Shutdown has wrong number of ins: 1
2017/08/09 22:38:36 method StartDaemon has wrong number of ins: 4
2017/08/09 22:38:36 [DEBUG] starting service creation monitor
2017/08/09 22:38:36 [DEBUG] starting service creation monitor
2017/08/09 22:38:36 [DEBUG] starting service removal monitor
2017/08/09 22:38:36 [DEBUG] starting service creation monitor
2017/08/09 22:38:36 [DEBUG] starting service removal monitor
2017/08/09 22:38:36 [DEBUG] starting service creation monitor
2017/08/09 22:38:36 [DEBUG] starting service removal monitor
2017/08/09 22:38:36 [DEBUG] starting service removal monitor
2017/08/09 22:38:47 [DEBUG] daemon - starting mock server with args: [--pact-specification-version 2 --pact-dir /home/haavardw/go/src/github.com/pact-foundation/pact-go/examples/pacts --log /home/haavardw/go/src/github.com/pact-foundation/pact-go/examples/logs/pact.log --consumer MyConsumer --provider MyProvider]
2017/08/09 22:38:47 [DEBUG] starting mock service on port: 37349
2017/08/09 22:38:47 [DEBUG] starting service
2017/08/09 22:38:47 [ERROR] service fork/exec /home/haavardw/new-bin/pact-mock-service/bin/pact-mock-service: no such file or directory

Output from the consumer example:

$ cd ${GOPATH}/src/github.com/pact-foundation/pact-go/examples && go run -v consumer.go 
github.com/pact-foundation/pact-go/dsl
command-line-arguments
2017/08/09 22:09:54 [DEBUG] pact setup logging
2017/08/09 22:09:54 [DEBUG] pact setup
2017/08/09 22:09:54 [DEBUG] client: starting a server
2017/08/09 22:09:54 [DEBUG] creating an HTTP client
2017/08/09 22:09:54 [DEBUG] waiting for port 6666 to become available
2017/08/09 22:09:54 [ERROR] rpc: unexpected EOF
2017/08/09 22:09:54 [DEBUG] pact add interaction
2017/08/09 22:09:54 [DEBUG] pact setup logging
2017/08/09 22:09:54 [DEBUG] pact setup
2017/08/09 22:09:54 [DEBUG] pact add interaction
2017/08/09 22:09:54 [DEBUG] pact setup logging
2017/08/09 22:09:54 [DEBUG] pact setup
2017/08/09 22:09:54 [DEBUG] pact verify
2017/08/09 22:09:54 [DEBUG] mock service add interaction
2017/08/09 22:09:54 Error on Verify: Post http://localhost:0/interactions: dial tcp 127.0.0.1:0: getsockopt: connection refused
exit status 1

Same issue downloading v0.0.8 and v0.0.9 and the plan pact-go binary (non-_linux_amd64)

Mux example:

$ go test -v
=== RUN   TestPact_Provider
2017/08/09 22:44:38 API starting: port 44041 ([::]:44041)
2017/08/09 22:44:38 [TRACE] response from Ruby process pre-sanitisation: 
2017/08/09 22:44:38 
--- FAIL: TestPact_Provider (0.10s)
        user_service_test.go:33: Error: provider verification failed: 
FAIL
exit status 1
FAIL    github.com/pact-foundation/pact-go/examples/mux/provider        0.116s
 ./pact-go daemon -v -l DEBUG
2017/08/09 22:44:22 [DEBUG] setting up a service manager
2017/08/09 22:44:22 [DEBUG] setting up a service manager
2017/08/09 22:44:22 [DEBUG] setting up a service manager
2017/08/09 22:44:22 [DEBUG] setting up a service manager
2017/08/09 22:44:22 [INFO] daemon - starting daemon on network: tcp address:  port: 6666
2017/08/09 22:44:22 method Shutdown has wrong number of ins: 1
2017/08/09 22:44:22 method StartDaemon has wrong number of ins: 4
2017/08/09 22:44:22 [DEBUG] starting service removal monitor
2017/08/09 22:44:22 [DEBUG] starting service creation monitor
2017/08/09 22:44:22 [DEBUG] starting service removal monitor
2017/08/09 22:44:22 [DEBUG] starting service creation monitor
2017/08/09 22:44:22 [DEBUG] starting service creation monitor
2017/08/09 22:44:22 [DEBUG] starting service creation monitor
2017/08/09 22:44:22 [DEBUG] starting service removal monitor
2017/08/09 22:44:22 [DEBUG] starting service removal monitor
2017/08/09 22:44:38 [DEBUG] daemon - verifying provider
2017/08/09 22:44:38 [DEBUG] starting verification service with args: [--provider-base-url http://localhost:44041 --pact-urls /home/haavardw/go/src/github.com/pact-foundation/pact-go/examples/mux/provider/../../pacts/billy-bobby.json --provider-states-setup-url http://localhost:44041/setup]
2017/08/09 22:44:38 [DEBUG] starting service
mefellows commented 7 years ago

Thanks, will take a look this morning!

mefellows commented 7 years ago

OK I see the problem - you're downloading the binary not the distribution (tar.gz). This is probably not your fault given that we are publishing both. I'm going mark a fix here to remove.

This should do it for you:

mkdir new-bin && cd new-bin && curl -OL https://github.com/pact-foundation/pact-go/releases/download/v0.0.9/linux-amd64.tar.gz && tar -xvvf linux-amd64.tar.gz && mv pact-go_linux_amd64  pact-go &&  ./pact-go daemon -v -l DEBUG

Also, I will update the installation notes to add the -d flag so that any go binaries don't take precedence over the downloaded distribution.

mefellows commented 7 years ago

I've removed the binaries from the releases page, they aren't useful on their own.

I have also updated the Wercker release step, it should now only upload the zipped artifacts to GitHub. See https://app.wercker.com/Pact-Foundation/pact-go/runs/build/598b8aac3b92d900016ba9fe?step=598b8ad29199080001c5da65

haavardw commented 7 years ago

:+1: Works for me! Thanks.