-
Notifications
You must be signed in to change notification settings - Fork 15
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
pactfoundation/pact-cli 0.56.0.2 seems to be broken #121
Comments
Which command are you running, just tried a couple now. This was merged yesterday and released pact-foundation/pact-provider-verifier#107 so it would be related to that docker run --rm -it --init pactfoundation/pact-cli:0.56.0.2 pact
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
Commands:
help [COMMAND] # Describe available commands or one specific command
mock-service # Run a Pact mock service
pact-broker # Interact with a Pact Broker (also aliased as the subcommand `broker`)
pactflow # Interact with PactFlow
publish PACT_DIRS_OR_FILES ... # Publish pacts to a Pact Broker.
stub-service # Run a Pact stub service
verify PACT_URL ... # Verify pact(s) against a provider. Supports local and networked (http-based) files.
version # Print the version of the CLI mock-service docker run --rm -it --init pactfoundation/pact-cli:0.56.0.2 mock-service
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
mock WARN: Please note: we are tracking events anonymously to gather important usage statistics like Pact-Ruby version and operating system. To disable tracking, set the 'PACT_DO_NOT_TRACK' environment variable to 'true'.
INFO WEBrick 1.8.1
INFO ruby 3.2.2 (2023-03-30) [x86_64-linux-musl]
INFO WEBrick::HTTPServer#start: pid=25 port=35127
^CINFO going to shutdown ...
INFO WEBrick::HTTPServer#start done. |
The command is something like
|
are you requiring |
I don't think so
|
Thanks for sharing and raising an issue, its useful for others if they also see the same, not sure of the remedy atm but its related to the above commit ☝🏾 have tagged the author and will also take a look. Could you try again but without this arg |
Heres an example of the custom middleware in the repo it's used in this test do you need to add
in your middleware? that looks to the be the only difference between those? |
This was the thread where the change was introduced to the framework pact-foundation/pact-ruby#49 (comment) Beth's example shows the same with the initialize method. it might be a red-herring but just stands out to me |
Hey, So I've tried to reproduce this but can't seem to. Pull down the pact-provider-verifier repo, and update it to use the latest version of pact-provider-verifier. git clone git@github.com:pact-foundation/pact-provider-verifier.git
cd examples
bundle update # pull in latest pact-provider-verifier Add a file called
In terminal 1, run the test api ❯ ruby api.rb
[2023-09-14 12:50:06] INFO WEBrick 1.8.1
[2023-09-14 12:50:06] INFO ruby 3.2.2 (2023-03-30) [arm64-darwin23]
== Sinatra (v3.1.0) has taken the stage on 4567 for development with backup from WEBrick
[2023-09-14 12:50:06] INFO WEBrick::HTTPServer#start: pid=17974 port=4567 In terminal 2, run the verifier via pact-cli docker image passing in
docker run --rm -it -v $(pwd):/pact_pwd pactfoundation/pact-cli:0.56.0.2 verify --provider-base-url http://host.docker.internal:4567 /pact_pwd/me-they.json --custom-middleware /pact_pwd/custom_middleware.rb --provider-states-setup-url "http://host.docker.internal:4567/provider-state" Output from verifier WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
INFO: Adding custom middleware CustomVerifierMiddleware
pact WARN: Please note: we are tracking events anonymously to gather important usage statistics like Pact-Ruby version
and operating system. To disable tracking, set the 'PACT_DO_NOT_TRACK' environment
variable to 'true'.
INFO: Reading pact at /pact_pwd/me-they.json
Verifying a pact between me and they
Greeting
with GET /
returns a response which
has status code 200
has a matching body
Given There is a greeting
Provider state success
with GET /somestate
returns a response which
has status code 200
has a matching body Output from test api I, [2023-09-14T12:51:24.083098 #17974] INFO -- : Provider state request: {}
127.0.0.1 - - [14/Sep/2023:12:51:24 +0100] "POST /provider-state HTTP/1.1" 201 - 0.0039
127.0.0.1 - - [14/Sep/2023:12:51:24 BST] "POST /provider-state HTTP/1.1" 201 0
- -> /provider-state
127.0.0.1 - - [14/Sep/2023:12:51:24 +0100] "GET / HTTP/1.1" 200 20 0.0014
127.0.0.1 - - [14/Sep/2023:12:51:24 BST] "GET / HTTP/1.1" 200 20
- -> /
I, [2023-09-14T12:51:24.142308 #17974] INFO -- : Provider state request: {}
127.0.0.1 - - [14/Sep/2023:12:51:24 +0100] "POST /provider-state HTTP/1.1" 201 - 0.0003
127.0.0.1 - - [14/Sep/2023:12:51:24 BST] "POST /provider-state HTTP/1.1" 201 0
- -> /provider-state
127.0.0.1 - - [14/Sep/2023:12:51:24 +0100] "GET /somestate HTTP/1.1" 200 26 0.0003
127.0.0.1 - - [14/Sep/2023:12:51:24 BST] "GET /somestate HTTP/1.1" 200 26
- -> /somestate |
@YOU54F I am new to pact and trying publish contract using cli, i am seeing this response . aim i missing anything in the command ? PS C:> docker run --rm -v ${PWD}/pacts/Consumer-Provider.json:/pacts/Consumer-Provider.json -e PACT_BROKER_BASE_URL="https://coll***xxx.pactflow.io" -e PACT_BROKER_USERNAME="naga.appari@colli5454545.com" -e ACT_BROKER_TOKEN="MNQcvY4I5U***********" pactfoundation/pact-cli:latest publish /pacts --consumer-app-version collinson-demo-1 |
you don't need to pass in Also I would consider those credentials comprised and you should rotate your token, and avoid posting them in the public domain. Also lastly, if you see the same issue with the versions below 0.56.0.2, then this issue isn't relevant to your particular problem, and it would be better to raise a new topic. You can alternatively try publishing via the pact-cli via the executable directly, just to work out if you have an issue with Docker on Windows, rather than a connectivity issue with your broker |
We haven't any further reports, so will close unless we can get a reproducible example. Thanks! |
The error:
The
0.56.0.1
works just fine.The text was updated successfully, but these errors were encountered: