diff options
author | neha-p6 <neha.pansare@progress.com> | 2023-02-14 20:35:58 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-14 20:35:58 +0530 |
commit | afe8a1bbdc91a8b1b273f3ba1e8f09252efddaaf (patch) | |
tree | e82e2c2013db5198c1b25aec3035fc4e9870df59 | |
parent | ea5ee1d54abae873a1f60427fcfe5ae3f93a9fbd (diff) | |
parent | 7e2ef5a4b98917061f963ad44b2dbbbd65ac9ca2 (diff) | |
download | chef-afe8a1bbdc91a8b1b273f3ba1e8f09252efddaaf.tar.gz |
Merge pull request #13566 from chef/neha-p6/INFC-431_fix_hab_windows
[Chef-16] Fix habitat test pipeline windows
-rw-r--r-- | .expeditor/habitat-test.pipeline.yml | 3 | ||||
-rw-r--r-- | .expeditor/scripts/ensure-minimum-viable-hab.ps1 | 4 | ||||
-rw-r--r-- | .expeditor/scripts/habitat-test.ps1 | 9 |
3 files changed, 7 insertions, 9 deletions
diff --git a/.expeditor/habitat-test.pipeline.yml b/.expeditor/habitat-test.pipeline.yml index 836f9c91f4..1df53a8d59 100644 --- a/.expeditor/habitat-test.pipeline.yml +++ b/.expeditor/habitat-test.pipeline.yml @@ -8,7 +8,6 @@ expeditor: limit: 1 steps: - - label: ":linux: Validate Linux" commands: - sudo ./.expeditor/scripts/install-hab.sh x86_64-linux @@ -35,7 +34,7 @@ steps: - label: ":windows: Validate Habitat Builds of Chef Infra" commands: - - .expeditor/scripts/habitat-test.ps1 $EXPEDITOR_PKG_IDENTS_CHEFINFRACLIENTX86_64WINDOWS + - .expeditor/scripts/habitat-test.ps1 -WindowsArtifact $EXPEDITOR_PKG_IDENTS_CHEFINFRACLIENTX86_64WINDOWS expeditor: executor: windows: diff --git a/.expeditor/scripts/ensure-minimum-viable-hab.ps1 b/.expeditor/scripts/ensure-minimum-viable-hab.ps1 index 5d1bf1f54b..44fdd79548 100644 --- a/.expeditor/scripts/ensure-minimum-viable-hab.ps1 +++ b/.expeditor/scripts/ensure-minimum-viable-hab.ps1 @@ -16,6 +16,4 @@ catch { Write-Host "--- :habicat: Installing the version of Habitat required" Set-ExecutionPolicy Bypass -Scope Process -Force Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/habitat-sh/habitat/main/components/hab/install.ps1')) -} -Write-Host "--- :habicat: Refreshing the Path" -$env:Path = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User") + ";C:\ProgramData\Habitat;" +}
\ No newline at end of file diff --git a/.expeditor/scripts/habitat-test.ps1 b/.expeditor/scripts/habitat-test.ps1 index 824cbf94b5..0dbcf3e4af 100644 --- a/.expeditor/scripts/habitat-test.ps1 +++ b/.expeditor/scripts/habitat-test.ps1 @@ -1,15 +1,16 @@ +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 +hab pkg install $WindowsArtifact -if (-not $?) { throw "Unable to install $EXPEDITOR_PKG_IDENTS_CHEFINFRACLIENTX86_64WINDOWS" } +if (-not $?) { throw "Unable to install $WindowsArtifact" } -. ./habitat/tests/test.ps1 -PackageIdentifier $EXPEDITOR_PKG_IDENTS_CHEFINFRACLIENTX86_64WINDOWS +. ./habitat/tests/test.ps1 -PackageIdentifier $WindowsArtifact if (-not $?) { throw "Habitat tests failed" } |