summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRobb Kidd <rkidd@chef.io>2019-10-08 13:49:19 -0400
committerRobb Kidd <robb@thekidds.org>2019-11-01 14:22:33 -0400
commit6dad9e3243cc8fffba58476040c1534e72d90345 (patch)
treeded0246f6514672cbf9b16dda26894e158100e4f /scripts
parent3f2d235ac75c59cba3eb9360128376992a65161d (diff)
downloadchef-6dad9e3243cc8fffba58476040c1534e72d90345.tar.gz
add tests for the Windows habitat plan
Adds a test PowersShell script to habitat/tests/ to run some simple tests on executable version output and then run the functional specs suite like the omnibus_test script does. scripts/ci/verify-plan.ps1 will perform a throwaway build of the plan under a "ci" origin and then run the test script upon the built package. The habitat/verify pipeline was updated to run the verify-plan.ps1 script. Signed-off-by: Robb Kidd <robb@thekidds.org> add Windows plan verification to verify-hab pipeline Signed-off-by: Robb Kidd <robb@thekidds.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/ci/verify-plan.ps137
1 files changed, 37 insertions, 0 deletions
diff --git a/scripts/ci/verify-plan.ps1 b/scripts/ci/verify-plan.ps1
new file mode 100644
index 0000000000..de711cf542
--- /dev/null
+++ b/scripts/ci/verify-plan.ps1
@@ -0,0 +1,37 @@
+#!/usr/bin/env powershell
+
+#Requires -Version 5
+
+param(
+ # The name of the plan that is to be built.
+ [string]$Plan
+)
+
+$env:HAB_ORIGIN = 'ci'
+$Plan = 'chef-infra-client'
+
+Write-Host "--- :8ball: :windows: Verifying $Plan"
+
+Write-Host "--- :habicat: Installing the version of Habitat required"
+Install-Habitat --version 0.85.0.20190916
+
+Write-Host "--- :key: Generating fake origin key"
+hab origin key generate $env:HAB_ORIGIN
+
+
+$project_root = "$(git rev-parse --show-toplevel)"
+Set-Location $project_root
+
+Write-Host "--- :construction: Building $Plan"
+$env:DO_CHECK=$true; hab pkg build .
+if (-not $?) { throw "unable to build"}
+
+. results/last_build.ps1
+if (-not $?) { throw "unable to determine details about this build"}
+
+Write-Host "--- :hammer_and_wrench: Installing $pkg_ident"
+hab pkg install results/$pkg_artifact
+if (-not $?) { throw "unable to install this build"}
+
+Write-Host "--- :mag_right: Testing $Plan"
+powershell -File "./habitat/tests/test.ps1" -PackageIdentifier $pkg_ident \ No newline at end of file