Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Commit

Permalink
Add Ruby 3.2 to development and tests (#509)
Browse files Browse the repository at this point in the history
* Add Ruby 3.2 to development and tests

* Drop support for InSpec 4.X

* Fix documented errors

* Patch RSpec::Mocks::VerifyingMethodDouble

---------

Co-authored-by: Aaron Lane <2400330-aaron-lane@users.noreply.gitlab.com>
  • Loading branch information
aaron-lane and Aaron Lane authored Mar 25, 2023
1 parent 9bf241b commit 8719f53
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 12 deletions.
21 changes: 13 additions & 8 deletions .github/workflows/delivery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ jobs:
ruby-version: '3.0'
- operating-system: ubuntu
ruby-version: '3.1'
- operating-system: ubuntu
ruby-version: '3.2'
- operating-system: windows
ruby-version: '3.1'
ruby-version: '3.2'
commit-unit-test:
name: Commit - Unit Test
needs:
Expand Down Expand Up @@ -70,12 +72,15 @@ jobs:
- code-coverage: false
operating-system: ubuntu
ruby-version: '3.0'
- code-coverage: true
- code-coverage: false
operating-system: ubuntu
ruby-version: '3.1'
- code-coverage: true
operating-system: ubuntu
ruby-version: '3.2'
- code-coverage: false
operating-system: windows
ruby-version: '3.1'
ruby-version: '3.2'
commit-assemble:
name: Commit - Assemble
needs:
Expand All @@ -88,14 +93,14 @@ jobs:
- name: Download Bundler Lockfile
uses: actions/download-artifact@v3
with:
name: bundler-lockfile-os-ubuntu-rv-3.1
name: bundler-lockfile-os-ubuntu-rv-3.2
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1'
ruby-version: '3.2'
bundler: '2.4'
bundler-cache: true
cache-version: '1-os-ubuntu-rv-3.1'
cache-version: '1-os-ubuntu-rv-3.2'
- name: Build Ruby Gem
env:
GEM_PRIVATE_KEY: ${{ secrets.GEM_PRIVATE_KEY }}
Expand Down Expand Up @@ -136,7 +141,7 @@ jobs:
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1'
ruby-version: '3.2'
bundler-cache: false
- name: Download Ruby Gem
uses: actions/download-artifact@v3
Expand Down Expand Up @@ -193,7 +198,7 @@ jobs:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1'
ruby-version: '3.2'
bundler-cache: false
- name: Download Ruby Gem Release Candidate
uses: actions/download-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# kitchen/rake_tasks raises a `NameError: undefined method `=~'` error on Ruby 3.2
ruby 3.1.3
ruby 3.2.0
terraform 1.3.7
terragrunt 0.36.0
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ and this project adheres to
- Dropped support for Inspec < 4.25.1
- Dropped support for Ruby 2.6 which reached end of life on 2022-04-12.
- Dropped support for Ruby 2.7 which reached end of life on 2023-03-31.
- Dropped support for InSpec 4.X which reached end of life on some
indeterminate date.

## [6.1.0] - 2022-01-22

Expand Down
2 changes: 1 addition & 1 deletion kitchen-terraform.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ require "rubygems"
specification.add_development_dependency "webrick", "~> 1.7"
specification.add_runtime_dependency "delegate", "~> 0.3.0"
specification.add_runtime_dependency "dry-validation", "~> 1.6"
specification.add_runtime_dependency "inspec", ">= 4.25.1", "< 6"
specification.add_runtime_dependency "inspec", "~> 5.21", ">= 5.21.29"
specification.add_runtime_dependency "json", "~> 2.3"
specification.add_runtime_dependency "test-kitchen", ">= 2.1", "< 4.0"
specification.add_runtime_dependency "tty-which", "~> 0.5.0"
Expand Down
2 changes: 1 addition & 1 deletion lib/kitchen/terraform/transport/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Connection < ::Kitchen::Transport::Exec::Connection
#
# @param command [String] the Terraform command to be executed locally.
# @return [String] the standard output of the command.
# @raise [Kitchen::TransportFailed] if the command does not exit successfully.
# @raise [Kitchen::Transport::TransportFailed] if the command does not exit successfully.
def execute(command)
super "#{client} #{command}"

Expand Down
2 changes: 1 addition & 1 deletion lib/kitchen/transport/terraform.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class Terraform < ::Kitchen::Transport::Exec
#
# @param state [Hash] mutable instance state.
# @return [Kitchen::Terraform::Transport::Connection] a connection for this transport.
# @raise [Kitchen::TransportFailed] if a connection could not be returned.
# @raise [Kitchen::Transport::TransportFailed] if a connection could not be returned.
def connection(state, &block)
options = connection_options config.to_hash.merge state

Expand Down
10 changes: 10 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,13 @@

configuration.profile_examples = 10
end

module RSpec
module Mocks
# This is a patch to work around an issue that is fixed by rspec-mocks 3.12.2.
# SEE: https://github.com/rspec/rspec-mocks/pull/1514
class VerifyingMethodDouble
ruby2_keywords :proxy_method_invoked if respond_to?(:ruby2_keywords, true)
end
end
end

0 comments on commit 8719f53

Please sign in to comment.