Skip to content

Commit

Permalink
Removed should operators in test hab install script for windows
Browse files Browse the repository at this point in the history
Signed-off-by: Sougata Bhattacharjee <sougatab@progress.com>
  • Loading branch information
sougata-progress committed Aug 28, 2024
1 parent d512920 commit d9bdbef
Showing 1 changed file with 26 additions and 8 deletions.
34 changes: 26 additions & 8 deletions components/hab/tests/test_install_script.ps1
Original file line number Diff line number Diff line change
@@ -1,31 +1,49 @@
Describe "Install habitat using install.ps1" {
It "can install the latest version of Habitat" {
components/hab/install.ps1
$LASTEXITCODE | Should -Be 0
(Get-Command hab).Path | Should -Be "C:\ProgramData\Habitat\hab.exe"
if ($LASTEXITCODE -ne 0) {
throw "Installation failed with exit code $LASTEXITCODE"
}

$path = (Get-Command hab).Path
if ($path -ne "C:\ProgramData\Habitat\hab.exe") {
throw "Expected Habitat path 'C:\ProgramData\Habitat\hab.exe' but got '$path'"
}
}

It "can install a specific version of Habitat" {
components/hab/install.ps1 -v 0.90.6
$LASTEXITCODE | Should -Be 0
if ($LASTEXITCODE -ne 0) {
throw "Installation failed with exit code $LASTEXITCODE"
}

$result = hab --version
$result | Should -Match "hab 0.90.6/*"
if ($result -notmatch "hab 0\.90\.6/.*") {
throw "Expected version 'hab 0.90.6/*' but got '$result'"
}
}

It "can install a specific version of legacy Habitat package" {
components/hab/install.ps1 -v 0.79.1
$LASTEXITCODE | Should -Be 0
if ($LASTEXITCODE -ne 0) {
throw "Installation failed with exit code $LASTEXITCODE"
}

$result = hab --version
$result | Should -Match "hab 0.79.1/*"
if ($result -notmatch "hab 0\.79\.1/.*") {
throw "Expected version 'hab 0.79.1/*' but got '$result'"
}
}

It "ignores release when installing from packages.chef.io" {
components/hab/install.ps1 -v "0.90.6/20191112141314"
$LASTEXITCODE | Should -Be 0
if ($LASTEXITCODE -ne 0) {
throw "Installation failed with exit code $LASTEXITCODE"
}

$result = hab --version
$result | Should -Match "hab 0.90.6/*"
if ($result -notmatch "hab 0\.90\.6/.*") {
throw "Expected version 'hab 0.90.6/*' but got '$result'"
}
}
}

0 comments on commit d9bdbef

Please sign in to comment.