From 4e7964fed446b9127320e8ade8f1c19319e64a67 Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Wed, 22 Jan 2025 01:56:04 +0530 Subject: [PATCH 1/8] Adding the windows hab tests Signed-off-by: Ashique Saidalavi --- .expeditor/habitat-test.pipeline.yml | 31 ++++++++++++++-------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/.expeditor/habitat-test.pipeline.yml b/.expeditor/habitat-test.pipeline.yml index 5089fd325..afc6244e4 100644 --- a/.expeditor/habitat-test.pipeline.yml +++ b/.expeditor/habitat-test.pipeline.yml @@ -18,19 +18,18 @@ steps: image: ruby:3.1 privileged: true -# Commenting out the Windows test since it is not required for the RC1 release -# - label: ":windows: Validate Habitat Builds of Test Kitchen" -# commands: -# - .expeditor/buildkite/artifact.habitat.test.ps1 -# expeditor: -# executor: -# docker: -# host_os: windows -# shell: ["powershell", "-Command"] -# image: rubydistros/windows-2019:3.1 -# user: 'NT AUTHORITY\SYSTEM' -# environment: -# - FORCE_FFI_YAJL=ext -# - EXPIRE_CACHE=true -# - CHEF_LICENSE=accept-no-persist -# - CHEF_LICENSE_SERVER=http://hosted-license-service-lb-8000-606952349.us-west-2.elb.amazonaws.com:8000/ + - label: ":windows: Validate Habitat Builds of Test Kitchen" + commands: + - .expeditor/buildkite/artifact.habitat.test.ps1 + expeditor: + executor: + docker: + host_os: windows + shell: ["powershell", "-Command"] + image: rubydistros/windows-2019:3.1 + user: 'NT AUTHORITY\SYSTEM' + environment: + - FORCE_FFI_YAJL=ext + - EXPIRE_CACHE=true + - CHEF_LICENSE=accept-no-persist + - CHEF_LICENSE_SERVER=http://hosted-license-service-lb-8000-606952349.us-west-2.elb.amazonaws.com:8000/ From 235971de5938b59ac0c2ada86fe114911a3ed218 Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Wed, 22 Jan 2025 09:27:01 +0530 Subject: [PATCH 2/8] Linting fixes Signed-off-by: Ashique Saidalavi --- .expeditor/config.yml | 2 +- CHANGELOG.md | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.expeditor/config.yml b/.expeditor/config.yml index 9ab2c899f..7306e438a 100644 --- a/.expeditor/config.yml +++ b/.expeditor/config.yml @@ -83,4 +83,4 @@ subscriptions: - built_in:promote_habitat_packages - workload: project_promoted:{{agent_id}}:workstation-build:* actions: - - built_in:promote_habitat_packages \ No newline at end of file + - built_in:promote_habitat_packages diff --git a/CHANGELOG.md b/CHANGELOG.md index 6068592cb..b81f3e3fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,14 +4,15 @@ ## [v1.0.8](https://github.com/chef/chef-test-kitchen-enterprise/tree/v1.0.8) (2025-01-06) -#### Merged Pull Requests +### Merged Pull Requests - Removed hab test duplicate pipeline [#22](https://github.com/chef/chef-test-kitchen-enterprise/pull/22) ([sanghinitin](https://github.com/sanghinitin)) + ### Changes not yet released to rubygems.org -#### Merged Pull Requests +### Merged Pull Requests - Removed hab test duplicate pipeline [#22](https://github.com/chef/chef-test-kitchen-enterprise/pull/22) ([sanghinitin](https://github.com/sanghinitin)) - Removing changelog pipeline [#21](https://github.com/chef/chef-test-kitchen-enterprise/pull/21) ([sanghinitin](https://github.com/sanghinitin)) - added slack promot pipeline [#20](https://github.com/chef/chef-test-kitchen-enterprise/pull/20) ([sanghinitin](https://github.com/sanghinitin)) @@ -22,7 +23,7 @@ - Kitchen init change [#13](https://github.com/chef/chef-test-kitchen-enterprise/pull/13) ([sanghinitin](https://github.com/sanghinitin)) -#### Merged Pull Requests +### Merged Pull Requests - Removed hab test duplicate pipeline [#22](https://github.com/chef/chef-test-kitchen-enterprise/pull/22) ([sanghinitin](https://github.com/sanghinitin)) - Removing changelog pipeline [#21](https://github.com/chef/chef-test-kitchen-enterprise/pull/21) ([sanghinitin](https://github.com/sanghinitin)) - added slack promot pipeline [#20](https://github.com/chef/chef-test-kitchen-enterprise/pull/20) ([sanghinitin](https://github.com/sanghinitin)) @@ -31,8 +32,8 @@ - Updated the kitchen context approach with env variable [#15](https://github.com/chef/chef-test-kitchen-enterprise/pull/15) ([ashiqueps](https://github.com/ashiqueps)) - Include the Chef-cli as gem with the test-kitchen hab package [#14](https://github.com/chef/chef-test-kitchen-enterprise/pull/14) ([ashiqueps](https://github.com/ashiqueps)) - Kitchen init change [#13](https://github.com/chef/chef-test-kitchen-enterprise/pull/13) ([sanghinitin](https://github.com/sanghinitin)) - - 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)) + From 58d349a333b4996cdaa4f62a3d4ce309432bebff Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Wed, 22 Jan 2025 11:32:01 +0530 Subject: [PATCH 3/8] Updated the fallback channel env variable Signed-off-by: Ashique Saidalavi --- habitat/plan.ps1 | 2 +- habitat/plan.sh | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/habitat/plan.ps1 b/habitat/plan.ps1 index 29403fab3..c04c92ade 100644 --- a/habitat/plan.ps1 +++ b/habitat/plan.ps1 @@ -1,7 +1,7 @@ $ErrorActionPreference = "Stop" $PSDefaultParameterValues['*:ErrorAction']='Stop' -$env:HAB_BLDR_CHANNEL = "LTS-2024" +$env:HAB_REFRESH_CHANNEL = "LTS-2024" $pkg_name="chef-test-kitchen-enterprise" $pkg_origin="chef" $pkg_version=$(Get-Content "$PLAN_CONTEXT/../VERSION") diff --git a/habitat/plan.sh b/habitat/plan.sh index d74f0cc15..2d9070032 100644 --- a/habitat/plan.sh +++ b/habitat/plan.sh @@ -1,4 +1,4 @@ -export HAB_BLDR_CHANNEL="LTS-2024" +export HAB_REFRESH_CHANNEL="LTS-2024" _chef_client_ruby="core/ruby3_1" pkg_name="chef-test-kitchen-enterprise" pkg_origin="chef" @@ -36,7 +36,7 @@ do_unpack() { do_build() { echo $(pkg_path_for $_chef_client_ruby) - export GEM_HOME="$pkg_prefix/vendor/gems" + export GEM_HOME="$pkg_prefix/vendor" build_line "Setting GEM_PATH=$GEM_HOME" export GEM_PATH="$GEM_HOME" @@ -50,7 +50,7 @@ do_build() { } do_install() { - export GEM_HOME="$pkg_prefix/vendor/gems" + export GEM_HOME="$pkg_prefix/vendor" build_line "Setting GEM_PATH=$GEM_HOME" export GEM_PATH="$GEM_HOME" @@ -58,7 +58,7 @@ do_install() { gem install chef-cli wrap_ruby_kitchen wrap_ruby_chef_cli - set_runtime_env "GEM_PATH" "${pkg_prefix}/vendor/gems" + set_runtime_env "GEM_PATH" "${pkg_prefix}/vendor" } wrap_ruby_kitchen() { @@ -85,7 +85,7 @@ set -e export PATH="/sbin:/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:\$PATH" # Set Ruby paths defined from 'do_setup_environment()' -export GEM_HOME="$pkg_prefix/vendor/gems" +export GEM_HOME="$pkg_prefix/vendor" export GEM_PATH="\$GEM_HOME" exec $(pkg_path_for $_chef_client_ruby)/bin/ruby $real_bin \$@ From a4ef842e0cd89db2729f4c1fd72042b91e336794 Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Wed, 22 Jan 2025 13:33:11 +0530 Subject: [PATCH 4/8] Habitat plan updates Signed-off-by: Ashique Saidalavi --- habitat/plan.sh | 12 +++++++++--- kitchen.dokken.yml | 1 + 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/habitat/plan.sh b/habitat/plan.sh index 2d9070032..21fb506ea 100644 --- a/habitat/plan.sh +++ b/habitat/plan.sh @@ -7,7 +7,6 @@ pkg_description="The Chef Test Kitchen Enterprise" pkg_license=('Apache-2.0') pkg_bin_dirs=( bin - vendor/bin ) pkg_build_deps=( core/make @@ -15,7 +14,7 @@ pkg_build_deps=( core/gcc ) pkg_deps=( - $_chef_client_ruby + ${_chef_client_ruby} core/coreutils core/git ) @@ -29,13 +28,20 @@ do_before() { update_pkg_version } +do_setup_environment() { + build_line 'Setting GEM_HOME="$pkg_prefix/vendor"' + export GEM_HOME="$pkg_prefix/vendor" + + build_line "Setting GEM_PATH=$GEM_HOME" + export GEM_PATH="$GEM_HOME" +} + do_unpack() { mkdir -pv "$HAB_CACHE_SRC_PATH/$pkg_dirname" cp -RT "$PLAN_CONTEXT"/.. "$HAB_CACHE_SRC_PATH/$pkg_dirname/" } do_build() { - echo $(pkg_path_for $_chef_client_ruby) export GEM_HOME="$pkg_prefix/vendor" build_line "Setting GEM_PATH=$GEM_HOME" diff --git a/kitchen.dokken.yml b/kitchen.dokken.yml index 2d99e701b..0876e4a8b 100644 --- a/kitchen.dokken.yml +++ b/kitchen.dokken.yml @@ -2,6 +2,7 @@ driver: name: dokken privileged: true + chef_version: unstable provisioner: name: dokken From ffeabf8290b802a827aa3500d70acdc4fb122fe2 Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Wed, 22 Jan 2025 15:22:35 +0530 Subject: [PATCH 5/8] changelog updates Signed-off-by: Ashique Saidalavi --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b81f3e3fe..9a6a9a5bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ## [v1.0.8](https://github.com/chef/chef-test-kitchen-enterprise/tree/v1.0.8) (2025-01-06) ### Merged Pull Requests + - Removed hab test duplicate pipeline [#22](https://github.com/chef/chef-test-kitchen-enterprise/pull/22) ([sanghinitin](https://github.com/sanghinitin)) @@ -13,6 +14,7 @@ ### Changes not yet released to rubygems.org ### Merged Pull Requests + - Removed hab test duplicate pipeline [#22](https://github.com/chef/chef-test-kitchen-enterprise/pull/22) ([sanghinitin](https://github.com/sanghinitin)) - Removing changelog pipeline [#21](https://github.com/chef/chef-test-kitchen-enterprise/pull/21) ([sanghinitin](https://github.com/sanghinitin)) - added slack promot pipeline [#20](https://github.com/chef/chef-test-kitchen-enterprise/pull/20) ([sanghinitin](https://github.com/sanghinitin)) @@ -24,6 +26,7 @@ ### Merged Pull Requests + - Removed hab test duplicate pipeline [#22](https://github.com/chef/chef-test-kitchen-enterprise/pull/22) ([sanghinitin](https://github.com/sanghinitin)) - Removing changelog pipeline [#21](https://github.com/chef/chef-test-kitchen-enterprise/pull/21) ([sanghinitin](https://github.com/sanghinitin)) - added slack promot pipeline [#20](https://github.com/chef/chef-test-kitchen-enterprise/pull/20) ([sanghinitin](https://github.com/sanghinitin)) From 9b4193bb73f43ba470e9c9d4df53892188a94924 Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Wed, 22 Jan 2025 16:21:57 +0530 Subject: [PATCH 6/8] Updated the fallback channel env variable for the test pipeline Signed-off-by: Ashique Saidalavi --- .expeditor/buildkite/artifact.habitat.test.ps1 | 2 +- .expeditor/buildkite/artifact.habitat.test.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.expeditor/buildkite/artifact.habitat.test.ps1 b/.expeditor/buildkite/artifact.habitat.test.ps1 index ee2f366d6..1173686c1 100755 --- a/.expeditor/buildkite/artifact.habitat.test.ps1 +++ b/.expeditor/buildkite/artifact.habitat.test.ps1 @@ -5,7 +5,7 @@ # TODO: Set-StrictMode -Version Latest $PSDefaultParameterValues['*:ErrorAction']='Stop' $ErrorActionPreference = 'Stop' -$env:HAB_BLDR_CHANNEL = "LTS-2024" +$env:HAB_REFRESH_CHANNEL = "LTS-2024" $env:HAB_ORIGIN = 'ci' $env:CHEF_LICENSE = 'accept-no-persist' $env:HAB_LICENSE = 'accept-no-persist' diff --git a/.expeditor/buildkite/artifact.habitat.test.sh b/.expeditor/buildkite/artifact.habitat.test.sh index 5a17b7d79..cf2aaf6e9 100755 --- a/.expeditor/buildkite/artifact.habitat.test.sh +++ b/.expeditor/buildkite/artifact.habitat.test.sh @@ -6,7 +6,7 @@ export HAB_ORIGIN='ci' export PLAN='chef-test-kitchen-enterprise' export CHEF_LICENSE="accept-no-persist" export HAB_LICENSE="accept-no-persist" -export HAB_BLDR_CHANNEL="LTS-2024" +export HAB_REFRESH_CHANNEL="LTS-2024" echo "--- checking if git is installed" if ! command -v git &> /dev/null; then From da2fff98880a1f67685d89ab9e1ace90bec33962 Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Thu, 23 Jan 2025 15:02:56 +0530 Subject: [PATCH 7/8] Moved the env variable from plan file to the config Signed-off-by: Ashique Saidalavi --- .expeditor/build.habitat.yml | 3 +++ .expeditor/buildkite/artifact.habitat.test.ps1 | 1 - .expeditor/buildkite/artifact.habitat.test.sh | 1 - habitat/plan.ps1 | 1 - habitat/plan.sh | 3 +-- 5 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.expeditor/build.habitat.yml b/.expeditor/build.habitat.yml index 72ea2567a..3b1512ff4 100644 --- a/.expeditor/build.habitat.yml +++ b/.expeditor/build.habitat.yml @@ -1,6 +1,9 @@ --- origin: chef +env: + HAB_REFRESH_CHANNEL: "LTS-2024" + expeditor: defaults: buildkite: diff --git a/.expeditor/buildkite/artifact.habitat.test.ps1 b/.expeditor/buildkite/artifact.habitat.test.ps1 index 1173686c1..159b83aea 100755 --- a/.expeditor/buildkite/artifact.habitat.test.ps1 +++ b/.expeditor/buildkite/artifact.habitat.test.ps1 @@ -5,7 +5,6 @@ # TODO: Set-StrictMode -Version Latest $PSDefaultParameterValues['*:ErrorAction']='Stop' $ErrorActionPreference = 'Stop' -$env:HAB_REFRESH_CHANNEL = "LTS-2024" $env:HAB_ORIGIN = 'ci' $env:CHEF_LICENSE = 'accept-no-persist' $env:HAB_LICENSE = 'accept-no-persist' diff --git a/.expeditor/buildkite/artifact.habitat.test.sh b/.expeditor/buildkite/artifact.habitat.test.sh index cf2aaf6e9..35858e382 100755 --- a/.expeditor/buildkite/artifact.habitat.test.sh +++ b/.expeditor/buildkite/artifact.habitat.test.sh @@ -6,7 +6,6 @@ export HAB_ORIGIN='ci' export PLAN='chef-test-kitchen-enterprise' export CHEF_LICENSE="accept-no-persist" export HAB_LICENSE="accept-no-persist" -export HAB_REFRESH_CHANNEL="LTS-2024" echo "--- checking if git is installed" if ! command -v git &> /dev/null; then diff --git a/habitat/plan.ps1 b/habitat/plan.ps1 index c04c92ade..54b359298 100644 --- a/habitat/plan.ps1 +++ b/habitat/plan.ps1 @@ -1,7 +1,6 @@ $ErrorActionPreference = "Stop" $PSDefaultParameterValues['*:ErrorAction']='Stop' -$env:HAB_REFRESH_CHANNEL = "LTS-2024" $pkg_name="chef-test-kitchen-enterprise" $pkg_origin="chef" $pkg_version=$(Get-Content "$PLAN_CONTEXT/../VERSION") diff --git a/habitat/plan.sh b/habitat/plan.sh index 21fb506ea..eebe50be6 100644 --- a/habitat/plan.sh +++ b/habitat/plan.sh @@ -1,10 +1,9 @@ -export HAB_REFRESH_CHANNEL="LTS-2024" -_chef_client_ruby="core/ruby3_1" pkg_name="chef-test-kitchen-enterprise" pkg_origin="chef" pkg_maintainer="The Chef Maintainers " pkg_description="The Chef Test Kitchen Enterprise" pkg_license=('Apache-2.0') +_chef_client_ruby="core/ruby3_1" pkg_bin_dirs=( bin ) From 2eea474c30e612a7d922ca08549a0d3b639f4e1e Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Thu, 23 Jan 2025 15:09:02 +0530 Subject: [PATCH 8/8] Added the env in hab test pipeline Signed-off-by: Ashique Saidalavi --- .expeditor/habitat-test.pipeline.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.expeditor/habitat-test.pipeline.yml b/.expeditor/habitat-test.pipeline.yml index afc6244e4..9f86302df 100644 --- a/.expeditor/habitat-test.pipeline.yml +++ b/.expeditor/habitat-test.pipeline.yml @@ -3,6 +3,8 @@ expeditor: defaults: buildkite: timeout_in_minutes: 30 + env: + HAB_REFRESH_CHANNEL: "LTS-2024" retry: automatic: limit: 1