Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Conjur CLI flow is failing in Jenkins #310

Closed
izgeri opened this issue May 10, 2021 · 0 comments · Fixed by #311
Closed

Conjur CLI flow is failing in Jenkins #310

izgeri opened this issue May 10, 2021 · 0 comments · Fixed by #311

Comments

@izgeri
Copy link
Contributor

izgeri commented May 10, 2021

See Jenkins for full failure info.

It looks like the tests were reusing some objects between classes, and the language is now being stricter about allowing that.

From Jenkins:

[2021-05-06T18:38:11.852Z] Failures:
[2021-05-06T18:38:11.852Z] 
[2021-05-06T18:38:11.852Z]   1) Conjur::Command::Hosts rotating api key host rotate_api_key --host redis001 puts with basic auth
[2021-05-06T18:38:11.852Z]      Failure/Error: unless api.resource(host_resourceid).exists?
[2021-05-06T18:38:11.852Z] 
[2021-05-06T18:38:11.852Z]        #<RestClient::Request (class)> received :execute with unexpected arguments
[2021-05-06T18:38:11.852Z]          expected: ({:headers=>{:authorization=>"fakeauth"}, :method=>:head, :url=>"https://core.example.com/api/resources/the-account/host/redis001", :username=>"dknuth"})
[2021-05-06T18:38:11.852Z]               got: ({:headers=>{:authorization=>"fakeauth"}, :method=>:head, :ssl_cert_store=>#<Double :cert_store>, :url=>"https://core.example.com/api/resources/the-account/host/redis001", :username=>"dknuth"})
[2021-05-06T18:38:11.852Z]        Diff:
[2021-05-06T18:38:11.852Z]        @@ -1,5 +1,6 @@
[2021-05-06T18:38:11.852Z]         [{:headers=>{:authorization=>"fakeauth"},
[2021-05-06T18:38:11.852Z]           :method=>:head,
[2021-05-06T18:38:11.852Z]        +  :ssl_cert_store=>#<Double :cert_store>,
[2021-05-06T18:38:11.852Z]           :url=>"https://core.example.com/api/resources/the-account/host/redis001",
[2021-05-06T18:38:11.852Z]           :username=>"dknuth"}]
[2021-05-06T18:38:11.852Z]      # /usr/local/bundle/gems/rest-client-2.0.2/lib/restclient/resource.rb:59:in `head'
[2021-05-06T18:38:11.852Z]      # /usr/local/bundle/gems/conjur-api-5.3.5/lib/conjur/acts_as_resource.rb:64:in `exists?'
[2021-05-06T18:38:11.852Z]      # ./lib/conjur/command/hosts.rb:38:in `block (3 levels) in <class:Hosts>'
[2021-05-06T18:38:11.852Z]      # /usr/local/bundle/gems/gli-2.20.0/lib/gli/command_support.rb:131:in `execute'
[2021-05-06T18:38:11.852Z]      # /usr/local/bundle/gems/gli-2.20.0/lib/gli/app_support.rb:296:in `block in call_command'
[2021-05-06T18:38:11.852Z]      # ./lib/conjur/cli.rb:146:in `block in <class:CLI>'
[2021-05-06T18:38:11.852Z]      # /usr/local/bundle/gems/gli-2.20.0/lib/gli/app_support.rb:307:in `call_command'
[2021-05-06T18:38:11.852Z]      # /usr/local/bundle/gems/gli-2.20.0/lib/gli/app_support.rb:83:in `run'
[2021-05-06T18:38:11.852Z]      # ./lib/conjur/cli.rb:68:in `run'
[2021-05-06T18:38:11.852Z]      # ./lib/conjur/command/rspec/describe_command.rb:20:in `block (2 levels) in describe_command'
[2021-05-06T18:38:11.852Z]      # ./spec/command/hosts_spec.rb:29:in `block (4 levels) in <top (required)>'
[2021-05-06T18:38:11.852Z] 
[2021-05-06T18:38:11.82Z]   2) Conjur::Command::Hosts rotating api key host rotate_api_key --host non-existing rotate_api_key with non-existing --host option
[2021-05-06T18:38:11.852Z]      Failure/Error: expect { invoke }.to raise_error(GLI::CustomExit, /Host 'non-existing' not found/i)
[2021-05-06T18:38:11.852Z] 
[2021-05-06T18:38:11.852Z]        expected GLI::CustomExit with message matching /Host 'non-existing' not found/i, got #<RSpec::Mocks::ExpiredTestDoubleError: #<Double :cert_store> was originally created in one example b...only last for one example, and you need to create a new one in each example you wish to use it for.> with backtrace:
[2021-05-06T18:38:11.852Z]          # /usr/local/bundle/gems/rest-client-2.0.2/lib/restclient/resource.rb:59:in `head'
[2021-05-06T18:38:11.852Z]          # /usr/local/bundle/gems/conjur-api-5.3.5/lib/conjur/acts_as_resource.rb:64:in `exists?'
[2021-05-06T18:38:11.852Z]          # ./lib/conjur/command/hosts.rb:38:in `block (3 levels) in <class:Hosts>'
[2021-05-06T18:38:11.852Z]          # /usr/local/bundle/gems/gli-2.20.0/lib/gli/command_support.rb:131:in `execute'
[2021-05-06T18:38:11.852Z]          # /usr/local/bundle/gems/gli-2.20.0/lib/gli/app_support.rb:296:in `block in call_command'
[2021-05-06T18:38:11.852Z]          # ./lib/conjur/cli.rb:146:in `block in <class:CLI>'
[2021-05-06T18:38:11.852Z]          # /usr/local/bundle/gems/gli-2.20.0/lib/gli/app_support.rb:307:in `call_command'
[2021-05-06T18:38:11.852Z]          # /usr/local/bundle/gems/gli-2.20.0/lib/gli/app_support.rb:83:in `run'
[2021-05-06T18:38:11.852Z]          # ./lib/conjur/cli.rb:68:in `run'
[2021-05-06T18:38:11.852Z]          # ./lib/conjur/command/rspec/describe_command.rb:20:in `block (2 levels) in describe_command'
[2021-05-06T18:38:11.852Z]          # ./spec/command/hosts_spec.rb:43:in `block (5 levels) in <top (required)>'
[2021-05-06T18:38:11.852Z]          # ./spec/command/hosts_spec.rb:43:in `block (4 levels) in <top (required)>'
[2021-05-06T18:38:11.852Z]      # ./spec/command/hosts_spec.rb:43:in `block (4 levels) in <top (required)>'
[2021-05-06T18:38:11.852Z] 
[2021-05-06T18:38:11.852Z]   3) Conjur::Command::Users updating password user:update_password -p new-password PUTs the new password
[2021-05-06T18:38:11.852Z]      Failure/Error: Conjur::API.update_password username, password, new_password
[2021-05-06T18:38:11.852Z] 
[2021-05-06T18:38:11.852Z]        #<RestClient::Request (class)> received :execute with unexpected arguments
[2021-05-06T18:38:11.852Z]          expected: ({:headers=>{}, :method=>:put, :password=>"sekrit", :payload=>"new-password", :url=>"https://authn.example.com/the-account/password", :user=>"dknuth"})
[2021-05-06T18:38:11.852Z]               got: ({:headers=>{}, :method=>:put, :password=>"sekrit", :payload=>"new-password", :ssl_cert_store=>#<Double :cert_store>, :url=>"https://authn.example.com/the-account/password", :user=>"dknuth"})
[2021-05-06T18:38:11.852Z]        Diff:
[2021-05-06T18:38:11.852Z]        @@ -2,6 +2,7 @@
[2021-05-06T18:38:11.852Z]           :method=>:put,
[2021-05-06T18:38:11.852Z]           :password=>"sekrit",
[2021-05-06T18:38:11.852Z]           :payload=>"new-password",
[2021-05-06T18:38:11.852Z]        +  :ssl_cert_store=>#<Double :cert_store>,
[2021-05-06T18:38:11.852Z]           :url=>"https://authn.example.com/the-account/password",
[2021-05-06T18:38:11.852Z]           :user=>"dknuth"}]
[2021-05-06T18:38:11.852Z]      # /usr/local/bundle/gems/rest-client-2.0.2/lib/restclient/resource.rb:76:in `put'
[2021-05-06T18:38:11.852Z]      # /usr/local/bundle/gems/conjur-api-5.3.5/lib/conjur/api/authn.rb:99:in `update_password'
[2021-05-06T18:38:11.852Z]      # ./lib/conjur/command/users.rb:36:in `block (3 levels) in <class:Users>'
[2021-05-06T18:38:11.852Z]      # /usr/local/bundle/gems/gli-2.20.0/lib/gli/command_support.rb:131:in `execute'
[2021-05-06T18:38:11.852Z]      # /usr/local/bundle/gems/gli-2.20.0/lib/gli/app_support.rb:296:in `block in call_command'
[2021-05-06T18:38:11.852Z]      # ./lib/conjur/cli.rb:146:in `block in <class:CLI>'
[2021-05-06T18:38:11.852Z]      # /usr/local/bundle/gems/gli-2.20.0/lib/gli/app_support.rb:307:in `call_command'
[2021-05-06T18:38:11.852Z]      # /usr/local/bundle/gems/gli-2.20.0/lib/gli/app_support.rb:83:in `run'
[2021-05-06T18:38:11.852Z]      # ./lib/conjur/cli.rb:68:in `run'
[2021-05-06T18:38:11.852Z]      # ./lib/conjur/command/rspec/describe_command.rb:20:in `block (2 levels) in describe_command'
[2021-05-06T18:38:11.852Z]      # ./spec/command/users_spec.rb:21:in `block (4 levels) in <top (required)>'
[2021-05-06T18:38:11.852Z] 
[2021-05-06T18:38:11.852Z]   4) Conjur::Command::Users updating password user:update_password PUTs the new password
[2021-05-06T18:38:11.852Z]      Failure/Error: Conjur::API.update_password username, password, new_password
[2021-05-06T18:38:11.852Z]        #<Double :cert_store> was originally created in one example but has leaked into another example and can no longer be used. rspec-mocks' doubles are designed to only last for one example, and you need to create a new one in each example you wish to use it for.
[2021-05-06T18:38:11.852Z]      # /usr/local/bundle/gems/rest-client-2.0.2/lib/restclient/resource.rb:76:in `put'
[2021-05-06T18:38:11.852Z]      # /usr/local/bundle/gems/conjur-api-5.3.5/lib/conjur/api/authn.rb:99:in `update_password'
[2021-05-06T18:38:11.852Z]      # ./lib/conjur/command/users.rb:36:in `block (3 levels) in <class:Users>'
[2021-05-06T18:38:11.852Z]      # /usr/local/bundle/gems/gli-2.20.0/lib/gli/command_support.rb:131:in `execute'
[2021-05-06T18:38:11.852Z]      # /usr/local/bundle/gems/gli-2.20.0/lib/gli/app_support.rb:296:in `block in call_command'
[2021-05-06T18:38:11.852Z]      # ./lib/conjur/cli.rb:146:in `block in <class:CLI>'
[2021-05-06T18:38:11.852Z]      # /usr/local/bundle/gems/gli-2.20.0/lib/gli/app_support.rb:307:in `call_command'
[2021-05-06T18:38:11.852Z]      # /usr/local/bundle/gems/gli-2.20.0/lib/gli/app_support.rb:83:in `run'
[2021-05-06T18:38:11.852Z]      # ./lib/conjur/cli.rb:68:in `run'
[2021-05-06T18:38:11.852Z]      # ./lib/conjur/command/rspec/describe_command.rb:20:in `block (2 levels) in describe_command'
[2021-05-06T18:38:11.852Z]      # ./spec/command/users_spec.rb:29:in `block (4 levels) in <top (required)>'
[2021-05-06T18:38:11.852Z] 
[2021-05-06T18:38:11.852Z]   5) Conjur::Command::Users rotating api key user rotate_api_key puts with basic auth
[2021-05-06T18:38:11.852Z]      Failure/Error: new_api_key = Conjur::API.rotate_api_key username, password
[2021-05-06T18:38:11.852Z]        #<Double :cert_store> was originally created in one example but has leaked into another example and can no longer be used. rspec-mocks' doubles are designed to only last for one example, and you need to create a new one in each example you wish to use it for.
[2021-05-06T18:38:11.852Z]      # /usr/local/bundle/gems/rest-client-2.0.2/lib/restclient/resource.rb:76:in `put'
[2021-05-06T18:38:11.852Z]      # /usr/local/bundle/gems/conjur-api-5.3.5/lib/conjur/api/authn.rb:119:in `rotate_api_key'
[2021-05-06T18:38:11.852Z]      # ./lib/conjur/command/users.rb:57:in `block (3 levels) in <class:Users>'
[2021-05-06T18:38:11.852Z]      # /usr/local/bundle/gems/gli-2.20.0/lib/gli/command_support.rb:131:in `execute'
[2021-05-06T18:38:11.852Z]      # /usr/local/bundle/gems/gli-2.20.0/lib/gli/app_support.rb:296:in `block in call_command'
[2021-05-06T18:38:11.852Z]      # ./lib/conjur/cli.rb:146:in `block in <class:CLI>'
[2021-05-06T18:38:11.852Z]      # /usr/local/bundle/gems/gli-2.20.0/lib/gli/app_support.rb:307:in `call_command'
[2021-05-06T18:38:11.852Z]      # /usr/local/bundle/gems/gli-2.20.0/lib/gli/app_support.rb:83:in `run'
[2021-05-06T18:38:11.852Z]      # ./lib/conjur/cli.rb:68:in `run'
[2021-05-06T18:38:11.852Z]      # ./lib/conjur/command/rspec/describe_command.rb:20:in `block (2 levels) in describe_command'
[2021-05-06T18:38:11.852Z]      # ./spec/command/users_spec.rb:52:in `block (4 levels) in <top (required)>'
[2021-05-06T18:38:11.852Z] 
[2021-05-06T18:38:11.82Z]   6) Conjur::Command::Users rotating api key user rotate_api_key --user non-existing rotate_api_key with non-existing --user option
[2021-05-06T18:38:11.852Z]      Failure/Error: expect { invoke }.to raise_error(GLI::CustomExit, /User 'non-existing' not found/i)
[2021-05-06T18:38:11.852Z] 
[2021-05-06T18:38:11.852Z]        expected GLI::CustomExit with message matching /User 'non-existing' not found/i, got #<RSpec::Mocks::ExpiredTestDoubleError: #<Double :cert_store> was originally created in one example b...only last for one example, and you need to create a new one in each example you wish to use it for.> with backtrace:
[2021-05-06T18:38:11.852Z]          # /usr/local/bundle/gems/rest-client-2.0.2/lib/restclient/resource.rb:59:in `head'
[2021-05-06T18:38:11.852Z]          # /usr/local/bundle/gems/conjur-api-5.3.5/lib/conjur/acts_as_resource.rb:64:in `exists?'
[2021-05-06T18:38:11.852Z]          # ./lib/conjur/command/users.rb:51:in `block (3 levels) in <class:Users>'
[2021-05-06T18:38:11.852Z]          # /usr/local/bundle/gems/gli-2.20.0/lib/gli/command_support.rb:131:in `execute'
[2021-05-06T18:38:11.852Z]          # /usr/local/bundle/gems/gli-2.20.0/lib/gli/app_support.rb:296:in `block in call_command'
[2021-05-06T18:38:11.852Z]          # ./lib/conjur/cli.rb:146:in `block in <class:CLI>'
[2021-05-06T18:38:11.852Z]          # /usr/local/bundle/gems/gli-2.20.0/lib/gli/app_support.rb:307:in `call_command'
[2021-05-06T18:38:11.852Z]          # /usr/local/bundle/gems/gli-2.20.0/lib/gli/app_support.rb:83:in `run'
[2021-05-06T18:38:11.852Z]          # ./lib/conjur/cli.rb:68:in `run'
[2021-05-06T18:38:11.852Z]          # ./lib/conjur/command/rspec/describe_command.rb:20:in `block (2 levels) in describe_command'
[2021-05-06T18:38:11.852Z]          # ./spec/command/users_spec.rb:65:in `block (5 levels) in <top (required)>'
[2021-05-06T18:38:11.852Z]          # ./spec/command/users_spec.rb:65:in `block (4 levels) in <top (required)>'
[2021-05-06T18:38:11.852Z]      # ./spec/command/users_spec.rb:65:in `block (4 levels) in <top (required)>'
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging a pull request may close this issue.

2 participants