pact-foundation / pact_broker-client

A Ruby and CLI client for the Pact Broker. Publish and retrieve pacts and verification results.
MIT License
69 stars 47 forks source link

fix: verification-required command invalid arg number #152

Closed YOU54F closed 11 months ago

YOU54F commented 1 year ago

Trying out this command returned the following error

PACT_BROKER_FEATURES=verification_required pact-broker verification-required --pacticipant=FrontEndService --version foo

Error:-

/opt/homebrew/Cellar/pact-ruby-standalone/2.0.9/lib/vendor/ruby/3.2.0/gems/pact_broker-client-1.74.0/lib/pact_broker/client/can_i_deploy.rb:22:in `call': wrong number of arguments (given 5, expected 3..4) (ArgumentError)
    from /opt/homebrew/Cellar/pact-ruby-standalone/2.0.9/lib/vendor/ruby/3.2.0/gems/pact_broker-client-1.74.0/lib/pact_broker/client/cli/matrix_commands.rb:91:in `verification_required'
    from /opt/homebrew/Cellar/pact-ruby-standalone/2.0.9/lib/vendor/ruby/3.2.0/gems/thor-1.2.2/lib/thor/command.rb:27:in `run'
    from /opt/homebrew/Cellar/pact-ruby-standalone/2.0.9/lib/vendor/ruby/3.2.0/gems/thor-1.2.2/lib/thor/invocation.rb:127:in `invoke_command'
    from /opt/homebrew/Cellar/pact-ruby-standalone/2.0.9/lib/vendor/ruby/3.2.0/gems/thor-1.2.2/lib/thor.rb:392:in `dispatch'
    from /opt/homebrew/Cellar/pact-ruby-standalone/2.0.9/lib/vendor/ruby/3.2.0/gems/thor-1.2.2/lib/thor/base.rb:485:in `start'
    from /opt/homebrew/Cellar/pact-ruby-standalone/2.0.9/lib/vendor/ruby/3.2.0/gems/pact_broker-client-1.74.0/lib/pact_broker/client/cli/custom_thor.rb:34:in `start'
    from /opt/homebrew/Cellar/pact-ruby-standalone/2.0.9/lib/app/pact-broker.rb:34:in `<main>'

Removing the additional argument in the command, got it working

Returns exit code 1 - where no verification is required

Screenshot 2023-11-23 at 18 13 52

Returns exit code 0 - when verification is required

Screenshot 2023-11-23 at 18 14 41