summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremiah Snapp <jeremiah@chef.io>2022-05-16 22:31:34 -0400
committerGitHub <noreply@github.com>2022-05-16 22:31:34 -0400
commit2ba6ce8c38ba371c9cacd7ec0e0f913b2a4338c5 (patch)
tree822c08db166b0bca580a5f1b6aba17673a9432b4
parent8ad3cd769732fbd89a40aef6d9cd5d17c52375e4 (diff)
parent0885c40f6cadf8776f2f293b1802f2585396ecff (diff)
downloadchef-2ba6ce8c38ba371c9cacd7ec0e0f913b2a4338c5.tar.gz
Merge pull request #12888 from chef/jsnapp/fix-omnibus-test.ps1-for-chef-17
Fix omnibus-test.ps1
-rw-r--r--omnibus/omnibus-test.ps123
1 files changed, 20 insertions, 3 deletions
diff --git a/omnibus/omnibus-test.ps1 b/omnibus/omnibus-test.ps1
index 7e3488f060..71af497dd1 100644
--- a/omnibus/omnibus-test.ps1
+++ b/omnibus/omnibus-test.ps1
@@ -47,24 +47,34 @@ ForEach ($b in
}
Else {
Write-Output "Error: Could not find $b"
- exit 1
+ Throw 1
}
}
$Env:PATH = "C:\opscode\chef\bin;$Env:PATH"
chef-client --version
+If ($lastexitcode -ne 0) { Throw $lastexitcode }
# Exercise various packaged tools to validate binstub shebangs
& $embedded_bin_dir\ruby --version
+If ($lastexitcode -ne 0) { Throw $lastexitcode }
+
& $embedded_bin_dir\gem.bat --version
+If ($lastexitcode -ne 0) { Throw $lastexitcode }
+
& $embedded_bin_dir\bundle.bat --version
+If ($lastexitcode -ne 0) { Throw $lastexitcode }
+
& $embedded_bin_dir\rspec.bat --version
+If ($lastexitcode -ne 0) { Throw $lastexitcode }
$Env:PATH = "C:\opscode\chef\bin;C:\opscode\chef\embedded\bin;$Env:PATH"
# Test against the vendored chef gem (cd into the output of "gem which chef")
$chefdir = gem which chef
+If ($lastexitcode -ne 0) { Throw $lastexitcode }
+
$chefdir = Split-Path -Path "$chefdir" -Parent
$chefdir = Split-Path -Path "$chefdir" -Parent
Set-Location -Path $chefdir
@@ -79,9 +89,10 @@ $Env:CHEF_LICENSE = "accept-no-persist"
# some tests need winrm configured
winrm quickconfig -quiet
+If ($lastexitcode -ne 0) { Throw $lastexitcode }
bundle
-If ($lastexitcode -ne 0) { Exit $lastexitcode }
+If ($lastexitcode -ne 0) { Throw $lastexitcode }
# buildkite changes the casing of the Path variable to PATH
# It is not clear how or where that happens, but it breaks the choco
@@ -98,11 +109,17 @@ $exit = 0
bundle exec rspec -f progress --profile -- ./spec/unit
If ($lastexitcode -ne 0) { $exit = 1 }
+Write-Output "Last exit code: $lastexitcode"
+Write-Output ""
bundle exec rspec -f progress --profile -- ./spec/functional
If ($lastexitcode -ne 0) { $exit = 1 }
+Write-Output "Last exit code: $lastexitcode"
+Write-Output ""
bundle exec rspec -f progress --profile -- ./spec/integration
If ($lastexitcode -ne 0) { $exit = 1 }
+Write-Output "Last exit code: $lastexitcode"
+Write-Output ""
-Exit $exit
+Throw $exit