Skip to content

Commit

Permalink
fixing for windows
Browse files Browse the repository at this point in the history
Signed-off-by: nikhil2611 <[email protected]>
  • Loading branch information
nikhil2611 committed Dec 2, 2024
1 parent ec0487c commit 8773008
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 41 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/habitat-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ jobs:
run: |
write-output "--- STARTING HAB INSTALL ON ${{ matrix.os }} WINDOWS with habitat version:${{vars.HABITAT_VERSION_SET}}"
$env:HAB_LICENSE = "accept-no-persist"
$env:HAB_NONINTERACTIVE = "true"
$env:HAB_FALLBACK_CHANNEL= "${{vars.HAB_FALLBACK_CHANNEL}}"
Invoke-Expression "& { $(Invoke-RestMethod https://raw.githubusercontent.com/habitat-sh/habitat/main/components/hab/install.ps1) } -Version ${{vars.HABITAT_VERSION_SET}}"
- name: run habitat packaging windows
Expand All @@ -110,7 +111,7 @@ jobs:
hab origin key download --auth ${{ secrets.HAB_AUTH_TOKEN }} --secret ${{ env.HAB_ORIGIN }}
write-output "--- running windows hab build"
hab pkg build .
hartfile=$(ls ./results | grep "cookstyle" | tail -n 1)
$hartfile=(ls ./results -Name | findstr "cookstyle")
hab pkg install ./results/$hartfile
. ./results/last_build.env
habitat/tests/test.ps1
. ./results/last_build.ps1
habitat/tests/test.ps1 $pkg_ident
33 changes: 0 additions & 33 deletions habitat/tests/test.pester.ps1

This file was deleted.

14 changes: 9 additions & 5 deletions habitat/tests/test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@ if (-Not (Get-Module -ListAvailable -Name Pester)){

Write-Host "--- :fire: Smokish Pestering"
# Pester the Package
$__dir=(Get-Item $PSScriptRoot)
$test_result = Invoke-Pester -Strict -PassThru -Script @{
Path = "habitat/tests/test.pester.ps1";
Parameters = @{PackageIdentifier=$PackageIdentifier}
$version=hab pkg exec "${pkg_ident}" cookstyle -v
$actual_version=[Regex]::Match($version,"([0-9]+.[0-9]+.[0-9]+)").Value
$package_version=$PackageIdentifier.split("/",4)[2]
if ($package_version -eq $actual_version)
{
Write "cookstyle working fine"
}
if ($test_result.FailedCount -ne 0) { Exit $test_result.FailedCount }
else {
Write-Error "cookstyle version not met expected $package_version actual version $actual_version "
}

0 comments on commit 8773008

Please sign in to comment.