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

[CHEF-18291] Habitat tests for the windows platform #23

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
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
3 changes: 3 additions & 0 deletions .expeditor/build.habitat.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
origin: chef

env:
HAB_REFRESH_CHANNEL: "LTS-2024"

expeditor:
defaults:
buildkite:
Expand Down
1 change: 0 additions & 1 deletion .expeditor/buildkite/artifact.habitat.test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# TODO: Set-StrictMode -Version Latest
$PSDefaultParameterValues['*:ErrorAction']='Stop'
$ErrorActionPreference = 'Stop'
$env:HAB_BLDR_CHANNEL = "LTS-2024"
$env:HAB_ORIGIN = 'ci'
$env:CHEF_LICENSE = 'accept-no-persist'
$env:HAB_LICENSE = 'accept-no-persist'
Expand Down
1 change: 0 additions & 1 deletion .expeditor/buildkite/artifact.habitat.test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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_BLDR_CHANNEL="LTS-2024"

echo "--- checking if git is installed"
if ! command -v git &> /dev/null; then
Expand Down
2 changes: 1 addition & 1 deletion .expeditor/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,4 @@ subscriptions:
- built_in:promote_habitat_packages
- workload: project_promoted:{{agent_id}}:workstation-build:*
actions:
- built_in:promote_habitat_packages
- built_in:promote_habitat_packages
33 changes: 17 additions & 16 deletions .expeditor/habitat-test.pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ expeditor:
defaults:
buildkite:
timeout_in_minutes: 30
env:
HAB_REFRESH_CHANNEL: "LTS-2024"
retry:
automatic:
limit: 1
Expand All @@ -18,19 +20,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/
12 changes: 8 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@
<!-- latest_release 1.0.8 -->
## [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))

<!-- latest_release -->

<!-- release_rollup -->
### 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)) <!-- 1.0.8 -->
- Removing changelog pipeline [#21](https://github.com/chef/chef-test-kitchen-enterprise/pull/21) ([sanghinitin](https://github.com/sanghinitin)) <!-- 1.0.7 -->
- added slack promot pipeline [#20](https://github.com/chef/chef-test-kitchen-enterprise/pull/20) ([sanghinitin](https://github.com/sanghinitin)) <!-- 1.0.6 -->
Expand All @@ -22,7 +25,8 @@
- Kitchen init change [#13](https://github.com/chef/chef-test-kitchen-enterprise/pull/13) ([sanghinitin](https://github.com/sanghinitin)) <!-- 1.0.1 -->


#### 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)) <!-- 1.0.8 -->
- Removing changelog pipeline [#21](https://github.com/chef/chef-test-kitchen-enterprise/pull/21) ([sanghinitin](https://github.com/sanghinitin)) <!-- 1.0.7 -->
- added slack promot pipeline [#20](https://github.com/chef/chef-test-kitchen-enterprise/pull/20) ([sanghinitin](https://github.com/sanghinitin)) <!-- 1.0.6 -->
Expand All @@ -31,8 +35,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)) <!-- 1.0.3 -->
- 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)) <!-- 1.0.2 -->
- Kitchen init change [#13](https://github.com/chef/chef-test-kitchen-enterprise/pull/13) ([sanghinitin](https://github.com/sanghinitin)) <!-- 1.0.1 -->

- 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)) <!-- 1.0.0 -->

<!-- release_rollup -->

<!-- latest_stable_release -->
Expand Down
1 change: 0 additions & 1 deletion habitat/plan.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
$ErrorActionPreference = "Stop"
$PSDefaultParameterValues['*:ErrorAction']='Stop'

$env:HAB_BLDR_CHANNEL = "LTS-2024"
$pkg_name="chef-test-kitchen-enterprise"
$pkg_origin="chef"
$pkg_version=$(Get-Content "$PLAN_CONTEXT/../VERSION")
Expand Down
23 changes: 14 additions & 9 deletions habitat/plan.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
export HAB_BLDR_CHANNEL="LTS-2024"
_chef_client_ruby="core/ruby3_1"
pkg_name="chef-test-kitchen-enterprise"
pkg_origin="chef"
pkg_maintainer="The Chef Maintainers <[email protected]>"
pkg_description="The Chef Test Kitchen Enterprise"
pkg_license=('Apache-2.0')
_chef_client_ruby="core/ruby3_1"
pkg_bin_dirs=(
bin
vendor/bin
)
pkg_build_deps=(
core/make
core/bash
core/gcc
)
pkg_deps=(
$_chef_client_ruby
${_chef_client_ruby}
core/coreutils
core/git
)
Expand All @@ -29,14 +27,21 @@ 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/gems"
export GEM_HOME="$pkg_prefix/vendor"

build_line "Setting GEM_PATH=$GEM_HOME"
export GEM_PATH="$GEM_HOME"
Expand All @@ -50,15 +55,15 @@ 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"
gem install chef-test-kitchen-enterprise-*.gem --no-document
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() {
Expand All @@ -85,7 +90,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 \$@
Expand Down
1 change: 1 addition & 0 deletions kitchen.dokken.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
driver:
name: dokken
privileged: true
chef_version: unstable

provisioner:
name: dokken
Expand Down
Loading