summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2020-09-04 22:28:54 -0700
committerGitHub <noreply@github.com>2020-09-04 22:28:54 -0700
commitbef4d5046cfe2234c8224fc8a280f0efba5d93ec (patch)
tree6f958bae0651fe8fe514f4f55035f62088219a29
parente6b27505dfeeb5ed80b96b2563919fca1bf769a9 (diff)
parent0466ec287d7f87d3974bf02aba613d0072c9bb7c (diff)
downloadchef-bef4d5046cfe2234c8224fc8a280f0efba5d93ec.tar.gz
Merge pull request #10387 from chef/debug-windows-hab
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--habitat/tests/test.pester.ps117
1 files changed, 15 insertions, 2 deletions
diff --git a/habitat/tests/test.pester.ps1 b/habitat/tests/test.pester.ps1
index a5f665c9de..56f31e9a2f 100644
--- a/habitat/tests/test.pester.ps1
+++ b/habitat/tests/test.pester.ps1
@@ -12,8 +12,21 @@ Describe "chef-infra-client" {
$? | Should be $true
}
+ <#
+ At some point hab's argument parsing changed and it started interpreting the trailing `--version` as being
+ an argument passed to hab instead of an argument to the command passed to `hab pkg exec`.
+
+ Powershell 5.1 and 7 appear to differ in how they treat following arguments as well, such that these two
+ versions of the command fail in powershell 5.1 (which is currently what is running in the windows machines
+ in Buildkite) but pass in powershell 7 (which is currently what is running in a stock Windows 10 VM).
+
+ $the_version = (hab pkg exec $PackageIdentifier chef-client.bat '--version' | Out-String).split(':')[1].Trim()
+ $the_version = (hab pkg exec $PackageIdentifier chef-client.bat --version | Out-String).split(':')[1].Trim()
+
+ This version of the command passes in powershell 5.1 but fails in powershell 7.
+ #>
It "is the expected version" {
- $the_version = (hab pkg exec $PackageIdentifier chef-client.bat --version | Out-String).split(':')[1].Trim()
+ $the_version = (hab pkg exec $PackageIdentifier chef-client.bat -- --version | Out-String).split(':')[1].Trim()
$the_version | Should be $PackageVersion
}
}
@@ -52,4 +65,4 @@ Describe "chef-infra-client" {
$? | Should be $true
}
}
-} \ No newline at end of file
+}