Skip to content
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

Fix a few chefstyle issues #1921

Merged
merged 1 commit into from Nov 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions CHANGELOG.md
Expand Up @@ -2,8 +2,9 @@

## [3.4.0](https://github.com/test-kitchen/test-kitchen/tree/v3.4.0) (2022-10-20)

- Support modern SSH keys on test instances with newer net-ssh/net-scp ([@tas50](https://github.com/tas50))
- Require Ruby 2.7 or later since 2.6 is now EOL ([@tas50](https://github.com/tas50))
- Support modern SSH keys on test instances with newer net-ssh/net-scp ([@tas50](https://github.com/tas50))
- Require Ruby 2.7 or later since 2.6 is now EOL ([@tas50](https://github.com/tas50))

## [3.3.2](https://github.com/test-kitchen/test-kitchen/tree/v3.3.2) (2022-08-03)

[Full Changelog](https://github.com/test-kitchen/test-kitchen/compare/v3.3.1...v3.3.2)
Expand Down
12 changes: 5 additions & 7 deletions lib/kitchen/lifecycle_hooks.rb
Expand Up @@ -43,13 +43,11 @@ def initialize(config, state_file)
# @param block [Proc] Block of code implementing the lifecycle phase.
# @return [void]
def run_with_hooks(phase, state_file, &block)
begin
run(phase, :pre)
yield
run(phase, :post)
ensure
run(phase, :finally)
end
run(phase, :pre)
yield
run(phase, :post)
ensure
run(phase, :finally)
end

# @return [Kitchen::StateFile]
Expand Down
2 changes: 1 addition & 1 deletion lib/kitchen/verifier/base.rb
Expand Up @@ -73,7 +73,7 @@ def call(state)
conn.upload(sandbox_dirs, config[:root_path])
debug("Transfer complete")
conn.execute(prepare_command)

begin
conn.execute(run_command)
ensure
Expand Down
2 changes: 1 addition & 1 deletion spec/kitchen/lifecycle_hooks_spec.rb
Expand Up @@ -111,7 +111,7 @@ def expect_remote_hook_generated_and_run(phase, hook)
it "runs finally even if stage fails" do
local_command = "echo foo"
config.update(finally_create: [local_command])
hook = expect_local_hook_generated_and_run(:finally, { local: local_command })
hook = expect_local_hook_generated_and_run(:finally, { local: local_command }) # rubocop: disable Lint/UselessAssignment
begin
lifecycle_hooks.run_with_hooks(:create, state_file) {
raise Error
Expand Down