Skip to content

fix: require test-kitchen 3.0 or newer - #492

Merged
tas50 merged 1 commit into
mainfrom
fix/test-kitchen-3-floor
Aug 23, 2026
Merged

fix: require test-kitchen 3.0 or newer#492
tas50 merged 1 commit into
mainfrom
fix/test-kitchen-3-floor

Conversation

@tas50

@tas50 tas50 commented Aug 23, 2026

Copy link
Copy Markdown
Member

The dependency floor was >= 1.0.0:

spec.add_dependency "test-kitchen", ">= 1.0.0", "< 5.0"

That has not been true for a long time. The gem already declares required_ruby_version >= 3.1, Test Kitchen 1.x and 2.x are both end of life, and CI has never run against anything below 4. Bundler was free to resolve a pairing nobody has ever run.

spec.add_dependency "test-kitchen", ">= 3.0", "< 5.0"

The < 5.0 ceiling is unchanged.

rake style clean; rspec 313 examples, 0 failures; bundle check satisfied.


One thing worth knowing before this merges. I tested the gem against real Test Kitchen 1.25.0 / 2.12.0 / 3.0.0 / 3.9.1 bundles, and it does not currently work on Test Kitchen 3 at all:

$ kitchen create          # test-kitchen 3.9.1, real ubuntu-24.04
-----> Creating <default-ubuntu-2404>...
>>>>>> Failed to complete #create action:
       [undefined method 'to_blob' for an instance of OpenSSL::PKey::RSA]

generate_keys calls OpenSSL::PKey::RSA#to_blob, which net-ssh adds by reopening the class. The driver requires net-ssh as require "net/ssh" unless defined?(Net::SSH) — but Test Kitchen 3's kitchen/ssh.rb contains:

module Net
  autoload :SSH, "net/ssh"
end

An autoload defines the constant immediately as a placeholder, so defined?(Net::SSH) is truthy before net-ssh has loaded a line. The guard skips the require, the monkey patch is never applied, and every Linux kitchen create dies. Test Kitchen 4 dropped kitchen/ssh.rb, which is the only reason this is invisible today.

That is a separate one-line fix (drop the guard — the require is for a side effect, not a constant), so I have left it out of this PR. Happy to open it next; this floor bump is still strictly an improvement on >= 1.0.0 either way.

The floor was `>= 1.0.0`, which has not been true for a long time. This gem
already declares `required_ruby_version >= 3.1`, and Test Kitchen 1.x and 2.x
are both end of life; nothing tests them, and CI has never run against
anything below 4.

Raising the floor to 3.0 says what is actually supported rather than letting
bundler resolve a pairing nobody has run.

The `< 5.0` ceiling is unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@tas50
tas50 merged commit 0c64225 into main Aug 23, 2026
3 checks passed
@tas50
tas50 deleted the fix/test-kitchen-3-floor branch August 23, 2026 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant