summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobb Kidd <robb@thekidds.org>2020-04-28 16:58:18 -0400
committerRobb Kidd <robb@thekidds.org>2020-04-28 17:06:19 -0400
commitf99f7463f2aa5cd6373ce25188853f003c147682 (patch)
tree0fac1140bb5beb60bcc30188016e990e295f9ffe
parentf0b399f34c2573d6a0666b987c7d22cdaf667f8c (diff)
downloadchef-f99f7463f2aa5cd6373ce25188853f003c147682.tar.gz
exclude choco tests from run
Explicitly exclude the chocolatey tests from the function spec run by using the rspec tag instead of deleting the executable to nerf detection. Signed-off-by: Robb Kidd <robb@thekidds.org>
-rw-r--r--scripts/bk_tests/bk_run_choco.ps13
-rw-r--r--scripts/bk_tests/bk_win_functional.ps18
2 files changed, 5 insertions, 6 deletions
diff --git a/scripts/bk_tests/bk_run_choco.ps1 b/scripts/bk_tests/bk_run_choco.ps1
index 2dacc9283d..01d0a75a0d 100644
--- a/scripts/bk_tests/bk_run_choco.ps1
+++ b/scripts/bk_tests/bk_run_choco.ps1
@@ -1,8 +1,9 @@
$BKScriptDir = Split-Path $script:MyInvocation.MyCommand.Path
& "$BKScriptDir\win_setup.ps1"
-echo "!!! Chocolatey version !!!"
+echo "+++ Chocolatey version +++"
choco --version
+if (-not $?) { throw "choco run failed. Can't test choco without choco." }
echo "+++ bundle exec rspec chocolatey_package_spec"
bundle exec rspec spec/functional/resource/chocolatey_package_spec.rb
diff --git a/scripts/bk_tests/bk_win_functional.ps1 b/scripts/bk_tests/bk_win_functional.ps1
index ce6929801f..c77aaab8f7 100644
--- a/scripts/bk_tests/bk_win_functional.ps1
+++ b/scripts/bk_tests/bk_win_functional.ps1
@@ -71,9 +71,6 @@ Function InstallRuby
Remove-Item $RubyPath -Force -ErrorAction SilentlyContinue
}
-# chocolatey functional tests fail so delete the chocolatey binary to avoid triggering them
-Remove-Item -Path C:\ProgramData\chocolatey\bin\choco.exe -ErrorAction SilentlyContinue
-
echo "--- install ruby + devkit"
$ErrorActionPreference = 'Stop'
@@ -85,6 +82,7 @@ $Env:Path+=";C:\ruby26\bin"
$BKScriptDir = Split-Path $script:MyInvocation.MyCommand.Path
& "$BKScriptDir\win_setup.ps1"
-echo "+++ bundle exec rake spec:functional"
-bundle exec rake spec:functional
+echo "+++ bundle exec rake spec:functional (minus chocolatey tests)"
+# chocolatey functional tests are shakey so exclude them from this function test run
+bundle exec rake --tag ~choco_installed spec:functional
if (-not $?) { throw "Chef functional specs failing." }