diff options
-rw-r--r-- | .buildkite/hooks/pre-command | 2 | ||||
-rw-r--r-- | .expeditor/habitat-test.pipeline.yml | 4 | ||||
-rw-r--r-- | .expeditor/scripts/habitat-test.ps1 | 11 |
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 |