From bbde94e23d49522c84b8169d1ef2c86810e34e74 Mon Sep 17 00:00:00 2001 From: nitin sanghi Date: Mon, 11 Nov 2024 17:05:21 +0530 Subject: [PATCH 1/4] Change the default kitchen.yml file driver Signed-off-by: nitin sanghi --- lib/kitchen/generator/init.rb | 6 +++--- templates/driver/gemspec.erb | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/kitchen/generator/init.rb b/lib/kitchen/generator/init.rb index f73d35212..c2afe3709 100644 --- a/lib/kitchen/generator/init.rb +++ b/lib/kitchen/generator/init.rb @@ -30,7 +30,7 @@ class Init < Thor::Group class_option :driver, type: :array, aliases: "-D", - default: %w{kitchen-vagrant}, + default: %w{kitchen-dokken}, desc: <<-D.gsub(/^\s+/, "").tr("\n", " ") One or more Kitchen Driver gems to be installed or added to a Gemfile @@ -213,8 +213,8 @@ def create_gemfile_if_missing # # @api private def add_gem_to_gemfile - if not_in_file?("Gemfile", /gem ('|")test-kitchen('|")/) - append_to_file("Gemfile", %{gem "test-kitchen"\n}) + if not_in_file?("Gemfile", /gem ('|")chef-test-kitchen-enterprise('|")/) + append_to_file("Gemfile", %{gem "chef-test-kitchen-enterprise"\n}) @display_bundle_msg = true end end diff --git a/templates/driver/gemspec.erb b/templates/driver/gemspec.erb index 9e23df737..67132fe79 100644 --- a/templates/driver/gemspec.erb +++ b/templates/driver/gemspec.erb @@ -18,7 +18,7 @@ Gem::Specification.new do |spec| spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ['lib'] - spec.add_dependency 'test-kitchen', '~> 1.0.0' + spec.add_dependency 'chef-test-kitchen-enterprise', '~> 1.0.0' spec.add_development_dependency 'bundler' spec.add_development_dependency 'rake' From cdcea58295aca60ac3d86e5f012749ac614ca74d Mon Sep 17 00:00:00 2001 From: nitin sanghi Date: Mon, 11 Nov 2024 17:15:25 +0530 Subject: [PATCH 2/4] Change the default transport and provisioner Signed-off-by: nitin sanghi --- lib/kitchen/generator/init.rb | 10 +++++++++- templates/init/kitchen.yml.erb | 3 +++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/kitchen/generator/init.rb b/lib/kitchen/generator/init.rb index c2afe3709..9842e9bf2 100644 --- a/lib/kitchen/generator/init.rb +++ b/lib/kitchen/generator/init.rb @@ -39,11 +39,18 @@ class Init < Thor::Group class_option :provisioner, type: :string, aliases: "-P", - default: "chef_solo", + default: "dokken", desc: <<-D.gsub(/^\s+/, "").tr("\n", " ") The default Kitchen Provisioner to use D + class_option :transport, + type: :string, + aliases: "-T", + default: "dokken", + desc: <<-D.gsub(/^\s+/, "").tr("\n", " ") + The default Kitchen Transport to use + D class_option :create_gemfile, type: :boolean, default: false, @@ -81,6 +88,7 @@ def create_kitchen_yaml template("kitchen.yml.erb", "kitchen.yml", driver_plugin: driver_plugin.sub(/^kitchen-/, ""), provisioner: options[:provisioner], + transport: options[:transport], run_list: Array(run_list)) end diff --git a/templates/init/kitchen.yml.erb b/templates/init/kitchen.yml.erb index 11e657858..b48009ac0 100644 --- a/templates/init/kitchen.yml.erb +++ b/templates/init/kitchen.yml.erb @@ -5,6 +5,9 @@ driver: provisioner: name: <%= config[:provisioner] %> +transport: + name: <%= config[:transport] %> + platforms: - name: ubuntu-20.04 - name: centos-8 From e157be97c4699cca4aed70a89667941bd320bb13 Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Mon, 11 Nov 2024 18:25:53 +0530 Subject: [PATCH 3/4] Updated the cucumber tests Signed-off-by: Ashique Saidalavi --- features/kitchen_init_command.feature | 39 ++++++++++++++++----------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/features/kitchen_init_command.feature b/features/kitchen_init_command.feature index a8e28b23f..78140778d 100644 --- a/features/kitchen_init_command.feature +++ b/features/kitchen_init_command.feature @@ -26,7 +26,7 @@ Feature: Add Test Kitchen support to an existing project And the file "kitchen.yml" should contain: """ driver: - name: vagrant + name: dokken """ And a file named "Gemfile" should not exist And a file named "Rakefile" should not exist @@ -40,7 +40,7 @@ Feature: Add Test Kitchen support to an existing project Then the file "Gemfile" should contain "https://rubygems.org" And the file "Gemfile" should contain: """ - gem "test-kitchen" + gem "chef-test-kitchen-enterprise" """ And the output should contain "You must run `bundle install'" @@ -56,7 +56,7 @@ Feature: Add Test Kitchen support to an existing project """ source "https://rubygems.org" - gem "test-kitchen" + gem "chef-test-kitchen-enterprise" """ And the output should contain "You must run `bundle install'" @@ -67,7 +67,7 @@ Feature: Add Test Kitchen support to an existing project """ source "https://rubygems.org" - gem 'test-kitchen' + gem "chef-test-kitchen-enterprise" """ When I successfully run `kitchen init` @@ -75,7 +75,7 @@ Feature: Add Test Kitchen support to an existing project """ source "https://rubygems.org" - gem 'test-kitchen' + gem "chef-test-kitchen-enterprise" """ @@ -85,7 +85,7 @@ Feature: Add Test Kitchen support to an existing project """ source "https://rubygems.org" - gem 'test-kitchen' + gem "chef-test-kitchen-enterprise" gem 'kitchen-ec2' """ @@ -94,7 +94,7 @@ Feature: Add Test Kitchen support to an existing project """ source "https://rubygems.org" - gem 'test-kitchen' + gem "chef-test-kitchen-enterprise" gem 'kitchen-ec2' """ @@ -122,13 +122,13 @@ Feature: Add Test Kitchen support to an existing project """ Scenario: Running init without a provisioner sets the default provisioner - to chef_solo in kitchen.yml + to dokken in kitchen.yml Given an empty file named "Gemfile" When I successfully run `kitchen init --no-driver` Then the file "kitchen.yml" should contain: """ provisioner: - name: chef_solo + name: dokken """ Scenario: Running init with a provisioner sets the provisioner in kitchen.yml @@ -190,10 +190,13 @@ Feature: Add Test Kitchen support to an existing project """ --- driver: - name: vagrant + name: dokken provisioner: - name: chef_solo + name: dokken + + transport: + name: dokken platforms: - name: ubuntu-20.04 @@ -214,10 +217,13 @@ Feature: Add Test Kitchen support to an existing project """ --- driver: - name: vagrant + name: dokken provisioner: - name: chef_solo + name: dokken + + transport: + name: dokken platforms: - name: ubuntu-20.04 @@ -237,10 +243,13 @@ Feature: Add Test Kitchen support to an existing project """ --- driver: - name: vagrant + name: dokken provisioner: - name: chef_solo + name: dokken + + transport: + name: dokken platforms: - name: ubuntu-20.04 From ec59b062583968d026788e5de39176e2c7486427 Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Mon, 11 Nov 2024 18:27:45 +0530 Subject: [PATCH 4/4] Updated the changelog Signed-off-by: Ashique Saidalavi --- CHANGELOG.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b351d492..41f5d32ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,17 +1,23 @@ # Test Kitchen Change Log + ## [v1.0.0](https://github.com/chef/chef-test-kitchen-enterprise/tree/v1.0.0) (2024-11-11) -#### Merged Pull Requests +### Merged Pull Requests + - Rebranding Change and the new version and change.log file [#11](https://github.com/chef/chef-test-kitchen-enterprise/pull/11) ([sanghinitin](https://github.com/sanghinitin)) + + ### Changes not yet released to rubygems.org -#### Merged Pull Requests +### Merged Pull Requests + - Rebranding Change and the new version and change.log file [#11](https://github.com/chef/chef-test-kitchen-enterprise/pull/11) ([sanghinitin](https://github.com/sanghinitin)) +