summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn McCrae <john.mccrae@progress.com>2023-03-27 06:20:51 -0700
committerGitHub <noreply@github.com>2023-03-27 06:20:51 -0700
commitc4cfa3b5036fafde1257b0a21efe471d9899bb35 (patch)
treebac957e7d5ef86636d64e430ce63c88f68bba64f
parentf7c411f6320fe04e308a28fa111b19d50723f5e2 (diff)
parentd7aa06589592950b7019f2d19770d0d30067b05d (diff)
downloadchef-c4cfa3b5036fafde1257b0a21efe471d9899bb35.tar.gz
Merge pull request #13649 from chef/neha-p6/fix_habitat_test_pipeline_chef18
Fix issues in habitat/test pipeline
-rw-r--r--.buildkite/hooks/pre-command2
-rw-r--r--.expeditor/habitat-test.pipeline.yml4
-rw-r--r--.expeditor/scripts/habitat-test.ps111
3 files changed, 10 insertions, 7 deletions
diff --git a/.buildkite/hooks/pre-command b/.buildkite/hooks/pre-command
index 115ab101af..81d1513c45 100644
--- a/.buildkite/hooks/pre-command
+++ b/.buildkite/hooks/pre-command
@@ -3,7 +3,7 @@
set -eu
# Only execute in the verify pipeline
-[[ "$BUILDKITE_PIPELINE_NAME" =~ (verify|validate/(release|adhoc|canary)|habitat/build|docker/build)$ ]]
+[[ "$BUILDKITE_PIPELINE_NAME" =~ (verify|validate/(release|adhoc|canary)|habitat/build|habitat/test|docker/build|macos_universal_package)$ ]]
docker ps || true
diff --git a/.expeditor/habitat-test.pipeline.yml b/.expeditor/habitat-test.pipeline.yml
index b802ea1aa8..ca7e159197 100644
--- a/.expeditor/habitat-test.pipeline.yml
+++ b/.expeditor/habitat-test.pipeline.yml
@@ -11,7 +11,6 @@ steps:
- label: ":linux: Validate Linux"
commands:
- - export EXPEDITOR_PKG_IDENTS_CHEFINFRACLIENTX86_64LINUX="chef/chef-infra-client/18.0.179/20221109103645"
- sudo ./.expeditor/scripts/install-hab.sh x86_64-linux
- echo "--- Installing $EXPEDITOR_PKG_IDENTS_CHEFINFRACLIENTX86_64LINUX"
- sudo hab pkg install $EXPEDITOR_PKG_IDENTS_CHEFINFRACLIENTX86_64LINUX
@@ -24,7 +23,6 @@ steps:
- label: ":linux: Validate Linux (kernel2)"
commands:
- - export EXPEDITOR_PKG_IDENTS_CHEFINFRACLIENTX86_64LINUX="chef/chef-infra-client/18.0.179/20221109103648"
- sudo ./.expeditor/scripts/install-hab.sh x86_64-linux-kernel2
- echo "--- Installing $EXPEDITOR_PKG_IDENTS_CHEFINFRACLIENTX86_64LINUXKERNEL2"
- sudo hab pkg install $EXPEDITOR_PKG_IDENTS_CHEFINFRACLIENTX86_64LINUXKERNEL2
@@ -37,7 +35,7 @@ steps:
- label: ":windows: Validate Habitat Builds of Chef Infra"
commands:
- - .expeditor/scripts/habitat-test.ps1
+ - .expeditor/scripts/habitat-test.ps1 -WindowsArtifact $EXPEDITOR_PKG_IDENTS_CHEFINFRACLIENTX86_64WINDOWS
expeditor:
executor:
windows:
diff --git a/.expeditor/scripts/habitat-test.ps1 b/.expeditor/scripts/habitat-test.ps1
index 49f070dad4..57394c60ce 100644
--- a/.expeditor/scripts/habitat-test.ps1
+++ b/.expeditor/scripts/habitat-test.ps1
@@ -1,9 +1,14 @@
+param ($WindowsArtifact = $(throw "WindowsArtifact parameter is required."))
$ErrorActionPreference = 'Stop'
$ScriptRoute = [System.IO.Path]::GetFullPath([System.IO.Path]::Combine($PSScriptRoot, "ensure-minimum-viable-hab.ps1"))
& "$ScriptRoute"
# . ./scripts/ensure-minimum-viable-hab.ps1
-Write-Host "--- Installing $EXPEDITOR_PKG_IDENTS_CHEFINFRACLIENTX86_64WINDOWS"
+Write-Host "--- Installing $WindowsArtifact"
$env:Path = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
-hab pkg install $EXPEDITOR_PKG_IDENTS_CHEFINFRACLIENTX86_64WINDOWS
-. ./habitat/tests/test.ps1 -PackageIdentifier $EXPEDITOR_PKG_IDENTS_CHEFINFRACLIENTX86_64WINDOWS
+
+hab pkg install $WindowsArtifact
+if (-not $?) { throw "Unable to install $WindowsArtifact" }
+
+. ./habitat/tests/test.ps1 -PackageIdentifier $WindowsArtifact
+if (-not $?) { throw "Habitat tests failed" } \ No newline at end of file