将 ruby 从 2.7 升级到 3.0 再到 3.1 后,我在运行黄瓜测试时遇到了问题
Given a local mode chef repo with nodes 'one,two,three' # features/step_definitions/chef-repo.rb:2
Expected `knife client create admin -c config.rb -f admin.pem` to succeed but got non-zero exit status and the following output:
ERROR: ArgumentError: wrong number of arguments (given 3, expected 2)
(RSpec::Expectations::ExpectationNotMetError)
./features/step_definitions/chef-repo.rb:66:in `create_client'
./features/step_definitions/chef-repo.rb:58:in `create_admin'
./features/step_definitions/chef-repo.rb:20:in `block (2 levels) in <top (required)>'
./features/step_definitions/chef-repo.rb:19:in `each'
./features/step_definitions/chef-repo.rb:19:in `/^a local mode chef repo with nodes '(.+?)'(?: with admins '(.+?)')?$/'
features/clean.feature:11:in `a local mode chef repo with nodes 'one,two,three''
And I create a vault item 'test/item' containing the JSON '{"foo": "bar"}' encrypted for 'one,two' # features/step_definitions/chef-vault.rb:4
Then the vault item 'test/item' should be encrypted for 'one,two' # features/step_definitions/chef-vault.rb:48
And I update the vault item 'test/item' to be encrypted for 'two,three' # features/step_definitions/chef-vault.rb:14
Then the vault item 'test/item' should be encrypted for 'one,two,three'
它在 Auba SpawnProcess start 命令下失败。尝试升级和降级 arbua 版本 'aruba'、'~> 2.0' 和 gem 'aruba'、'0.5.4' 没有任何效果,有人可以帮我解决这个问题吗?
在 chef-repo.rb 中失败了run_command_and_stop
def create_client(name, args = nil)
command = "knife client create #{name} -c config.rb -f #{name}.pem"
run_command_and_stop(command, fail_on_error: true)
write_file("#{name}.pem", last_command_started.stdout)
end
在这里,如果我们在 arubarun_command_and_stop
中的以下代码中介入失败command.start
def start_command(command)
259: aruba.config.run_before_hook(:command, self, command)
260:
261: in_current_directory do
262: command.start
263: end
264:
=> 265: stop_signal = command.stop_signal
266: aruba.announcer.announce(:stop_signal, command.pid, stop_signal) if stop_signal
267:
268: aruba.config.run_after_hook(:command, self, command)
269: end