summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2020-06-25 20:25:07 -0700
committerGitHub <noreply@github.com>2020-06-25 20:25:07 -0700
commit21f3c9886558a161ab42b2e75058ce7fe598007c (patch)
treebbb8244f3a6c0a276c193092afc32acab5fb49ac
parent4007395fba618f10f070d4b4aa438179c8d07bc7 (diff)
parent47fbfd3799b7dc5d3a0dad7076b5b1b14d5b406f (diff)
downloadchef-21f3c9886558a161ab42b2e75058ce7fe598007c.tar.gz
Merge pull request #10070 from mwrock/win_service
fix habitat based windows service tests
-rw-r--r--habitat/tests/spec.ps17
1 files changed, 7 insertions, 0 deletions
diff --git a/habitat/tests/spec.ps1 b/habitat/tests/spec.ps1
index ab1656b221..0229ac487f 100644
--- a/habitat/tests/spec.ps1
+++ b/habitat/tests/spec.ps1
@@ -10,6 +10,13 @@ $chef_gem_root = (hab pkg exec $PackageIdentifier gem.cmd which chef | Split-Pat
try {
Push-Location $chef_gem_root
$env:PATH = "C:\hab\bin;$env:PATH"
+
+ # Put chef's GEM_PATH in the machine environment so that the windows service
+ # tests will be able to consume the win32-service gem
+ $pkgEnv = hab pkg env $PackageIdentifier
+ $gemPath = $pkgEnv | Where-Object { $_.StartsWith("`$env:GEM_PATH=") }
+ SETX GEM_PATH $($gemPath.Split("=")[1]) /m
+
hab pkg binlink --force $PackageIdentifier
/hab/bin/rspec --format progress --tag ~executables --tag ~choco_installed spec/functional
if (-not $?) { throw "functional testing failed"}