From 8663bb30c1804d07c4455317911471bce6fc2af6 Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Mon, 9 Dec 2024 12:12:14 +0530 Subject: [PATCH 01/11] Updated the release branches Signed-off-by: Ashique Saidalavi --- .expeditor/config.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.expeditor/config.yml b/.expeditor/config.yml index 1d2c98a..e5b8b05 100644 --- a/.expeditor/config.yml +++ b/.expeditor/config.yml @@ -9,6 +9,12 @@ slack: rubygems: - chef-vault +release_branches: + - workstation-LTS: + version_constraint: 4.* + - main: + version_constraint: 4.* + github: # This deletes the GitHub PR branch after successfully merged into the release branch delete_branch_on_merge: true From 09a1c2bc05921acb415f948c7147a362c2583cb6 Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Mon, 9 Dec 2024 16:05:00 +0530 Subject: [PATCH 02/11] commenting the user for testing Signed-off-by: Ashique Saidalavi --- .expeditor/verify.pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.expeditor/verify.pipeline.yml b/.expeditor/verify.pipeline.yml index 53fa4a1..5dfa7a4 100644 --- a/.expeditor/verify.pipeline.yml +++ b/.expeditor/verify.pipeline.yml @@ -28,7 +28,7 @@ steps: host_os: windows shell: ["powershell", "-Command"] image: rubydistros/windows-2019:3.1 - user: 'NT AUTHORITY\SYSTEM' +# user: 'NT AUTHORITY\SYSTEM' environment: - FORCE_FFI_YAJL=ext - EXPIRE_CACHE=true From 2977bcf2d725e6fbd59527992952c6121eae49fd Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Mon, 9 Dec 2024 18:09:12 +0530 Subject: [PATCH 03/11] Reverted the change that was added by mistake Signed-off-by: Ashique Saidalavi --- .expeditor/verify.pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.expeditor/verify.pipeline.yml b/.expeditor/verify.pipeline.yml index 5dfa7a4..53fa4a1 100644 --- a/.expeditor/verify.pipeline.yml +++ b/.expeditor/verify.pipeline.yml @@ -28,7 +28,7 @@ steps: host_os: windows shell: ["powershell", "-Command"] image: rubydistros/windows-2019:3.1 -# user: 'NT AUTHORITY\SYSTEM' + user: 'NT AUTHORITY\SYSTEM' environment: - FORCE_FFI_YAJL=ext - EXPIRE_CACHE=true From 0d96d1469abfa422850fc174c3f349d85a74a2b6 Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Mon, 9 Dec 2024 19:08:05 +0530 Subject: [PATCH 04/11] Config updates Signed-off-by: Ashique Saidalavi --- .expeditor/config.yml | 17 +++++++++++------ .expeditor/run_windows_tests.ps1 | 2 +- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.expeditor/config.yml b/.expeditor/config.yml index de986bc..d2865b8 100644 --- a/.expeditor/config.yml +++ b/.expeditor/config.yml @@ -9,12 +9,6 @@ slack: rubygems: - chef-vault -release_branches: - - workstation-LTS: - version_constraint: 4.* - - main: - version_constraint: 4.* - github: # This deletes the GitHub PR branch after successfully merged into the release branch delete_branch_on_merge: true @@ -27,6 +21,12 @@ github: major_bump_labels: - "Expeditor: Bump Version Major" +release_branches: + - workstation-LTS: + version_constraint: 4.* + - main: + version_constraint: 4.* + changelog: rollup_header: Changes not yet released to rubygems.org @@ -46,6 +46,11 @@ subscriptions: - "Expeditor: Skip All" - built_in:build_gem: only_if: built_in:bump_version + - trigger_pipeline:habitat/test: + only_if: built_in:bump_version + ignore_labels: + - "Expeditor: Skip Habitat" + - "Expeditor: Skip All" - trigger_pipeline:habitat/build: only_if: built_in:bump_version ignore_labels: diff --git a/.expeditor/run_windows_tests.ps1 b/.expeditor/run_windows_tests.ps1 index 3cce207..2f80a4b 100644 --- a/.expeditor/run_windows_tests.ps1 +++ b/.expeditor/run_windows_tests.ps1 @@ -18,4 +18,4 @@ If ($lastexitcode -ne 0) { Exit $lastexitcode } Write-Output "--- Bundle Execute" bundle exec rake -If ($lastexitcode -ne 0) { Exit $lastexitcode } \ No newline at end of file +If ($lastexitcode -ne 0) { Exit $lastexitcode } From 15bb95958945fcaa3f57c4a992964963c0fd0a1e Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Mon, 9 Dec 2024 19:19:18 +0530 Subject: [PATCH 05/11] Pipeline fixes Signed-off-by: Ashique Saidalavi --- .expeditor/habitat-test.pipeline.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.expeditor/habitat-test.pipeline.yml b/.expeditor/habitat-test.pipeline.yml index 838d841..4d2b646 100644 --- a/.expeditor/habitat-test.pipeline.yml +++ b/.expeditor/habitat-test.pipeline.yml @@ -9,7 +9,7 @@ expeditor: steps: - - label: ":linux: Validate Habitat Builds of Test Kitchen" + - label: ":linux: Validate Habitat Builds of Chef-cli" commands: - .expeditor/buildkite/artifact.habitat.test.sh expeditor: @@ -18,7 +18,7 @@ steps: image: ruby:3.1 privileged: true - - label: ":windows: Validate Habitat Builds of Test Kitchen" + - label: ":windows: Validate Habitat Builds of Chef-cli" commands: - .expeditor/buildkite/artifact.habitat.test.ps1 expeditor: From c9b353065ec9e1a03c0b5acfd8e6e38e47c36d4c Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Mon, 9 Dec 2024 19:55:38 +0530 Subject: [PATCH 06/11] Test updates Signed-off-by: Ashique Saidalavi --- .../buildkite/artifact.habitat.test.ps1 | 11 ++-------- .expeditor/habitat-test.pipeline.yml | 1 + habitat/tests/test.ps1 | 22 +++++++++++++++++++ 3 files changed, 25 insertions(+), 9 deletions(-) create mode 100644 habitat/tests/test.ps1 diff --git a/.expeditor/buildkite/artifact.habitat.test.ps1 b/.expeditor/buildkite/artifact.habitat.test.ps1 index af4b98d..b9befd9 100644 --- a/.expeditor/buildkite/artifact.habitat.test.ps1 +++ b/.expeditor/buildkite/artifact.habitat.test.ps1 @@ -76,15 +76,8 @@ Write-Host "+++ Testing $Plan" Push-Location $project_root try { - Write-Host "Running unit tests..." - hab pkg exec "${pkg_ident}" rake unit - - If ($lastexitcode -ne 0) { - Write-Host "Rake unit tests failed!" -ForegroundColor Red - Exit $lastexitcode - } else { - Write-Host "Rake unit tests passed!" -ForegroundColor Green - } + $scriptPath = Join-Path $project_root "habitat/tests/test.ps1" + & $scriptPath $pkg_ident } finally { # Ensure we always return to the original directory diff --git a/.expeditor/habitat-test.pipeline.yml b/.expeditor/habitat-test.pipeline.yml index 4d2b646..f000a08 100644 --- a/.expeditor/habitat-test.pipeline.yml +++ b/.expeditor/habitat-test.pipeline.yml @@ -11,6 +11,7 @@ steps: - label: ":linux: Validate Habitat Builds of Chef-cli" commands: + - chmod +x .expeditor/buildkite/artifact.habitat.test.sh - .expeditor/buildkite/artifact.habitat.test.sh expeditor: executor: diff --git a/habitat/tests/test.ps1 b/habitat/tests/test.ps1 new file mode 100644 index 0000000..ec127ee --- /dev/null +++ b/habitat/tests/test.ps1 @@ -0,0 +1,22 @@ +param ( + [Parameter()] + [string]$PackageIdentifier = $(throw "Usage: test.ps1 [test_pkg_ident] e.g. test.ps1 ci/user-windows/1.0.0/20190812103929") +) + + +Write-Host "--- :fire: Smokish test" +# Pester the Package +$help_message=hab pkg exec "${pkg_ident}" -- chef-vault -h +$original_message="Usage: chef-vault" + +Write-Host "Checking the help message of the package" +Write-Host "Expected: $original_message" +Write-Host "Actual: $help_message" +if ($help_message.Contains($original_message)) +{ + Write "Chef-vault is working fine" +} +else { + Write-Error "chef-vault binary doesn't return the correct usage message " + throw "Chef-vault windows pipeline not working for hab pkg" +} From a6111f070c47d7d5725540e86a5baecbecdd4c06 Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Mon, 9 Dec 2024 21:31:34 +0530 Subject: [PATCH 07/11] Fixed the verify tests for windows Signed-off-by: Ashique Saidalavi --- .expeditor/buildkite/artifact.habitat.test.sh | 1 + .expeditor/habitat-test.pipeline.yml | 4 ++-- habitat/tests/test.ps1 | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.expeditor/buildkite/artifact.habitat.test.sh b/.expeditor/buildkite/artifact.habitat.test.sh index 225255b..c07fa77 100644 --- a/.expeditor/buildkite/artifact.habitat.test.sh +++ b/.expeditor/buildkite/artifact.habitat.test.sh @@ -68,4 +68,5 @@ export PATH echo "PATH is $PATH" echo "--- :mag_right: Testing $PLAN" +chmod +x "${project_root}/habitat/tests/test.sh" ${project_root}/habitat/tests/test.sh "$pkg_ident" || error 'failures during test of executables' diff --git a/.expeditor/habitat-test.pipeline.yml b/.expeditor/habitat-test.pipeline.yml index f000a08..a3af2f4 100644 --- a/.expeditor/habitat-test.pipeline.yml +++ b/.expeditor/habitat-test.pipeline.yml @@ -9,7 +9,7 @@ expeditor: steps: - - label: ":linux: Validate Habitat Builds of Chef-cli" + - label: ":linux: Validate Habitat Builds of Chef-vault" commands: - chmod +x .expeditor/buildkite/artifact.habitat.test.sh - .expeditor/buildkite/artifact.habitat.test.sh @@ -19,7 +19,7 @@ steps: image: ruby:3.1 privileged: true - - label: ":windows: Validate Habitat Builds of Chef-cli" + - label: ":windows: Validate Habitat Builds of Chef-vault" commands: - .expeditor/buildkite/artifact.habitat.test.ps1 expeditor: diff --git a/habitat/tests/test.ps1 b/habitat/tests/test.ps1 index ec127ee..07ecf03 100644 --- a/habitat/tests/test.ps1 +++ b/habitat/tests/test.ps1 @@ -12,7 +12,7 @@ $original_message="Usage: chef-vault" Write-Host "Checking the help message of the package" Write-Host "Expected: $original_message" Write-Host "Actual: $help_message" -if ($help_message.Contains($original_message)) +if ($help_message -like "*$original_message*") { Write "Chef-vault is working fine" } From d82159da9f98d25b23a4516a66824c530bc749fa Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Mon, 9 Dec 2024 22:07:55 +0530 Subject: [PATCH 08/11] Testing the linux habitat verify test Signed-off-by: Ashique Saidalavi --- .expeditor/buildkite/artifact.habitat.test.sh | 2 +- habitat/tests/test.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.expeditor/buildkite/artifact.habitat.test.sh b/.expeditor/buildkite/artifact.habitat.test.sh index c07fa77..24f46c8 100644 --- a/.expeditor/buildkite/artifact.habitat.test.sh +++ b/.expeditor/buildkite/artifact.habitat.test.sh @@ -69,4 +69,4 @@ echo "PATH is $PATH" echo "--- :mag_right: Testing $PLAN" chmod +x "${project_root}/habitat/tests/test.sh" -${project_root}/habitat/tests/test.sh "$pkg_ident" || error 'failures during test of executables' +"${project_root}/habitat/tests/test.sh" "$pkg_ident" diff --git a/habitat/tests/test.sh b/habitat/tests/test.sh index bb5f881..39d0383 100644 --- a/habitat/tests/test.sh +++ b/habitat/tests/test.sh @@ -12,6 +12,7 @@ error () { exit 1 } +echo "--- :mag_right: Starting the testing" [[ -n "$pkg_ident" ]] || error 'no hab package identity provided' From 71a2091542f8738ef865fb54f6b6fbc236ef0208 Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Mon, 9 Dec 2024 22:38:27 +0530 Subject: [PATCH 09/11] Fixed the issue with the shell script parameter Signed-off-by: Ashique Saidalavi --- habitat/tests/test.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/habitat/tests/test.sh b/habitat/tests/test.sh index 39d0383..b2d9452 100644 --- a/habitat/tests/test.sh +++ b/habitat/tests/test.sh @@ -3,6 +3,7 @@ set -euo pipefail project_root="$(git rev-parse --show-toplevel)" +pkg_ident="$1" # print error message followed by usage and exit error () { From 15819039329ff8f2884cfa0c19abd9793f8a61c0 Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Mon, 9 Dec 2024 22:56:18 +0530 Subject: [PATCH 10/11] Removed the logs added for testing Signed-off-by: Ashique Saidalavi --- habitat/tests/test.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/habitat/tests/test.sh b/habitat/tests/test.sh index b2d9452..30c7348 100644 --- a/habitat/tests/test.sh +++ b/habitat/tests/test.sh @@ -13,7 +13,6 @@ error () { exit 1 } -echo "--- :mag_right: Starting the testing" [[ -n "$pkg_ident" ]] || error 'no hab package identity provided' From 6964e667c7f5405bf671b9da9f05858dbcd411ac Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Tue, 10 Dec 2024 12:02:56 +0530 Subject: [PATCH 11/11] Updated the file permissions and changed the notify channel Signed-off-by: Ashique Saidalavi --- .expeditor/buildkite/artifact.habitat.test.sh | 1 - .expeditor/config.yml | 2 +- .expeditor/habitat-test.pipeline.yml | 1 - habitat/tests/test.sh | 0 4 files changed, 1 insertion(+), 3 deletions(-) mode change 100644 => 100755 .expeditor/buildkite/artifact.habitat.test.sh mode change 100644 => 100755 habitat/tests/test.sh diff --git a/.expeditor/buildkite/artifact.habitat.test.sh b/.expeditor/buildkite/artifact.habitat.test.sh old mode 100644 new mode 100755 index 24f46c8..a78e0a8 --- a/.expeditor/buildkite/artifact.habitat.test.sh +++ b/.expeditor/buildkite/artifact.habitat.test.sh @@ -68,5 +68,4 @@ export PATH echo "PATH is $PATH" echo "--- :mag_right: Testing $PLAN" -chmod +x "${project_root}/habitat/tests/test.sh" "${project_root}/habitat/tests/test.sh" "$pkg_ident" diff --git a/.expeditor/config.yml b/.expeditor/config.yml index d2865b8..5ede865 100644 --- a/.expeditor/config.yml +++ b/.expeditor/config.yml @@ -3,7 +3,7 @@ # Slack channel in Chef Software slack to send notifications about build failures, etc slack: - notify_channel: chef-infra-notify + notify_channel: chef-ws-notify # This publish is triggered by the `built_in:publish_rubygems` artifact_action. rubygems: diff --git a/.expeditor/habitat-test.pipeline.yml b/.expeditor/habitat-test.pipeline.yml index a3af2f4..f49e004 100644 --- a/.expeditor/habitat-test.pipeline.yml +++ b/.expeditor/habitat-test.pipeline.yml @@ -11,7 +11,6 @@ steps: - label: ":linux: Validate Habitat Builds of Chef-vault" commands: - - chmod +x .expeditor/buildkite/artifact.habitat.test.sh - .expeditor/buildkite/artifact.habitat.test.sh expeditor: executor: diff --git a/habitat/tests/test.sh b/habitat/tests/test.sh old mode 100644 new mode 100755