Skip to content

Commit

Permalink
Fix Converge Debug Logging and Prepare 7.0.1 (#522)
Browse files Browse the repository at this point in the history
* Fix connection debug logging

* Add entry to changelog

* Prepare 7.0.1

---------

Co-authored-by: Aaron Lane <2400330-aaron-lane@users.noreply.gitlab.com>
  • Loading branch information
aaron-lane and Aaron Lane committed Apr 21, 2023
1 parent fb2db9f commit 3d20d60
Show file tree
Hide file tree
Showing 31 changed files with 36 additions and 11 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@ and this project adheres to

## [Unreleased][unreleased]

## [7.0.1] - 2023-04-20

### Fixed

- The doctor check for the `client` attribute uses the PATH to validate
the value.
- The debug connection logger for `kitchen converge` is properly
initialized.

## [7.0.0] - 2023-04-09

Expand Down Expand Up @@ -815,7 +819,8 @@ Free-As-In-Beer
- Initial release

[unreleased]:
https://github.com/newcontext/kitchen-terraform/compare/v7.0.0...HEAD
https://github.com/newcontext/kitchen-terraform/compare/v7.0.1...HEAD
[7.0.1]: https://github.com/newcontext/kitchen-terraform/compare/v7.0.0...v7.0.1
[7.0.0]: https://github.com/newcontext/kitchen-terraform/compare/v6.1.0...v7.0.0
[6.1.0]: https://github.com/newcontext/kitchen-terraform/compare/v6.0.0...v6.1.0
[6.0.0]: https://github.com/newcontext/kitchen-terraform/compare/v5.8.0...v6.0.0
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ example.
---

```sh
gem install kitchen-terraform --version 7.0.0
gem install kitchen-terraform --version 7.0.1
```

---
Expand Down
Binary file modified docs/apple-touch-icon-114x114-precomposed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/apple-touch-icon-120x120-precomposed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/apple-touch-icon-144x144-precomposed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/apple-touch-icon-152x152-precomposed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/apple-touch-icon-180x180-precomposed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/apple-touch-icon-57x57-precomposed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/apple-touch-icon-60x60-precomposed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/apple-touch-icon-72x72-precomposed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/apple-touch-icon-76x76-precomposed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/apple-touch-icon-precomposed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/favicon-160x160.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/favicon-196x196.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/favicon-96x96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/favicon.ico
Binary file not shown.
Binary file modified docs/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/mstile-144x144.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/mstile-150x150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/mstile-310x150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/mstile-310x310.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/mstile-70x70.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion lib/kitchen/provisioner/terraform.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def call(state)
::Kitchen::Terraform::Provisioner::Converge.new(
config: driver.send(:config),
connection: transport.connection({}),
debug_connection: transport.connection(logger: ::Kitchen::Terraform::DebugLogger.new(logger: logger)),
debug_connection: transport.connection(logger: ::Kitchen::Terraform::DebugLogger.new(logger)),
logger: logger,
version_requirement: version_requirement,
workspace_name: workspace_name,
Expand Down
13 changes: 13 additions & 0 deletions lib/kitchen/terraform/debug_logger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,19 @@ module Kitchen
module Terraform
# This class delegates to a logger but ensures the debug level is the default level used for logging messages.
class DebugLogger < ::SimpleDelegator
class << self
# .new creates a new instance of the class.
#
# @return [Kitchen::Terraform::DebugLogger]
def new(obj)
if !obj.kind_of? ::Kitchen::Logger
raise ::TypeError, "delegate must be a Kitchen::Logger; recevied #{obj.class}"
end

super
end
end

# This method overrides the #<< method of the delegate to call #debug.
#
# @param message [#to_s] the message to be logged.
Expand Down
2 changes: 1 addition & 1 deletion lib/kitchen/terraform/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def temporarily_override(version:)

# @api private
def value
self.value = ::Gem::Version.new "7.0.0" if not @value
self.value = ::Gem::Version.new "7.0.1" if not @value
@value
end

Expand Down
17 changes: 12 additions & 5 deletions spec/lib/kitchen/terraform/debug_logger_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,30 @@

require "kitchen"
require "kitchen/terraform/debug_logger"
require "support/kitchen/logger_context"

::RSpec.describe ::Kitchen::Terraform::DebugLogger do
subject do
described_class.new logger
describe ".new" do
specify "raises an error if the delegate is not a Kitchen::Logger" do
expect do
described_class.new ::Object.new
end.to raise_error ::TypeError
end
end

let :logger do
instance_double ::Kitchen::Logger
subject do
described_class.new ::Kitchen.logger
end

include_context "Kitchen::Logger"

shared_examples "#debug" do
after do
subject << "message"
end

specify "forwards the message to #debug of the wrapped logger" do
expect(logger).to receive(:debug).with "message"
expect(::Kitchen.logger).to receive(:debug).with "message"
end
end

Expand Down
2 changes: 1 addition & 1 deletion spec/lib/kitchen/terraform/version_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
end

let :version do
::Gem::Version.new "7.0.0"
::Gem::Version.new "7.0.1"
end

describe ".assign_plugin_version" do
Expand Down
2 changes: 1 addition & 1 deletion spec/support/kitchen/terraform/configurable_examples.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

describe "@plugin_version" do
it "equals the gem version" do
expect(described_class.instance_variable_get(:@plugin_version)).to eq "7.0.0"
expect(described_class.instance_variable_get(:@plugin_version)).to eq "7.0.1"
end
end

Expand Down

0 comments on commit 3d20d60

Please sign in to comment.