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: remove test-kitchen dependency #502

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
echo "deb [signed-by=/usr/share/keyrings/oracle-virtualbox-2016.gpg] https://download.virtualbox.org/virtualbox/debian $(lsb_release -cs) contrib" | sudo tee /etc/apt/sources.list.d/virtualbox.list
sudo apt-get update
sudo apt-get install -y software-properties-common vagrant virtualbox-7.0
sudo apt-get install -y software-properties-common vagrant virtualbox-7.1
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
Expand Down
4 changes: 1 addition & 3 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
require:
- chefstyle

AllCops:
TargetRubyVersion: 3.1
Include:
- "**/*.rb"
Exclude:
Expand Down
8 changes: 6 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ source "https://rubygems.org"
# Specify your gem"s dependencies in kitchen-vagrant.gemspec
gemspec

if ENV['CHEF_TEST_KITCHEN_ENTERPRISE']
gem "chef-test-kitchen-enterprise", git: "https://github.com/chef/test-kitchen", branch: "main"
end

group :test do
gem "rake"
gem "kitchen-inspec"
Expand All @@ -13,6 +17,6 @@ group :debug do
gem "pry"
end

group :chefstyle do
gem "chefstyle", "2.2.3"
group :cookstyle do
gem "cookstyle"
end
6 changes: 3 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ RSpec::Core::RakeTask.new(:test) do |t|
end

begin
require "chefstyle"
require "cookstyle"
require "rubocop/rake_task"
RuboCop::RakeTask.new(:style) do |task|
task.options += ["--display-cop-names", "--no-color"]
task.options += ["--chefstyle", "--display-cop-names", "--no-color"]
end
rescue LoadError
puts "chefstyle is not available. (sudo) gem install chefstyle to do style checking."
puts "cookstyle is not available. (sudo) gem install cookstyle to do style checking."
end

task default: %i{test style}
4 changes: 3 additions & 1 deletion kitchen-vagrant.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ Gem::Specification.new do |gem|

gem.required_ruby_version = ">= 3.0"

gem.add_dependency "test-kitchen", ">= 1.4", "< 4"
unless ENV['CHEF_TEST_KITCHEN_ENTERPRISE']
gem.add_dependency "test-kitchen", ">= 1.4", "< 4"
end
end
Loading