Skip to content

Commit

Permalink
Windows chef-cli hab version check
Browse files Browse the repository at this point in the history
Signed-off-by: nitin sanghi <[email protected]>
  • Loading branch information
sanghinitin committed Dec 2, 2024
1 parent cb338d5 commit 0bc1054
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 38 deletions.
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}" chef-cli -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 "Chef-cli working fine"
}
if ($test_result.FailedCount -ne 0) { Exit $test_result.FailedCount }
else {
Write-Error "chef-cli version not met expected $package_version actual version $actual_version "
}

0 comments on commit 0bc1054

Please sign in to comment.