Skip to content
This repository has been archived by the owner on Jul 14, 2021. It is now read-only.

Chef DK 0.11.2 ignores a newly installed Test Kitchen #742

Closed
burtlo opened this issue Mar 14, 2016 · 2 comments
Closed

Chef DK 0.11.2 ignores a newly installed Test Kitchen #742

burtlo opened this issue Mar 14, 2016 · 2 comments

Comments

@burtlo
Copy link
Contributor

burtlo commented Mar 14, 2016

Having issues on Windows working with Test Kitchen and InSpec (inspec/kitchen-inspec#57). When I attempted to work around this by installing the latest version of Test Kitchen I found that the Chef DK creates/installs a kitchen file that is hard-coded to use Test Kitchen 1.5.0.

Installed test-kitchen 1.6.0 but ChefDK does not use this version and instead falls back to the older version.

C:\Users\Administrator\test [master +9 ~0 -0 !]> kitchen verify
C:\Users\Administrator\test [master +9 ~0 -0 !]> chef exec kitchen verify
-----> Starting Kitchen (v1.5.0)
-----> Verifying <default-windows-2012r2>...
       Preparing files for transfer
-----> Busser installation detected (busser)

       Installing Busser plugins: busser-inspec

$$$$$$ busser.bat : C:/opscode/chef/embedded/lib/ruby/site_ruby/2.0.0/rubygems/resolve
$$$$$$ r/installer_set.rb:71:in `add_always_install': Unable to resolve dependency:
$$$$$$ user requested 'busser-inspec (&gt;= 0)' (Gem::UnsatisfiableDependencyError)
$$$$$$ At line:26 char:
$$$$$$ + &amp; "$busser" plugin install $plugins.Split() 2&gt;&amp;1
$$$$$$ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$$$$$$     + CategoryInfo          : NotSpecified: (C:/opscode/chef...ependencyError)
$$$$$$    :String) [], RemoteException
$$$$$$     + FullyQualifiedErrorId : NativeCommandError
$$$$$$
$$$$$$     from C:/opscode/chef/embedded/lib/ruby/site_ruby/2.0.0/rubygems/dependency_
$$$$$$ installer.rb:474:in `resolve_dependencies'
$$$$$$     from C:/opscode/chef/embedded/lib/ruby/site_ruby/2.0.0/rubygems/dependency_
$$$$$$ installer.rb:384:in `install'
$$$$$$     from C:/Users/ADMINI~1/AppData/Local/Temp/verifier/gems/gems/busser-0.7.1/l
$$$$$$ ib/busser/rubygems.rb:44:in `install_gem'
$$$$$$     from C:/Users/ADMINI~1/AppData/Local/Temp/verifier/gems/gems/busser-0.7.1/l
$$$$$$ ib/busser/command/plugin_install.rb:66:in `install_plugin_gem'
$$$$$$     from C:/Users/ADMINI~1/AppData/Local/Temp/verifier/gems/gems/busser-0.7.1/l
$$$$$$ ib/busser/command/plugin_install.rb:53:in `install'
$$$$$$     from C:/Users/ADMINI~1/AppData/Local/Temp/verifier/gems/gems/busser-0.7.1/l
$$$$$$ ib/busser/command/plugin_install.rb:43:in `block (2 levels) in install_all'
$$$$$$     from C:/Users/ADMINI~1/AppData/Local/Temp/verifier/gems/gems/busser-0.7.1/l
$$$$$$ ib/busser/command/plugin_install.rb:43:in `each'
$$$$$$     from C:/Users/ADMINI~1/AppData/Local/Temp/verifier/gems/gems/busser-0.7.1/l
$$$$$$ ib/busser/command/plugin_install.rb:43:in `block in install_all'
$$$$$$     from C:/Users/ADMINI~1/AppData/Local/Temp/verifier/gems/gems/busser-0.7.1/l
$$$$$$ ib/busser/rubygems.rb:71:in `silence_gem_ui'
$$$$$$     from C:/Users/ADMINI~1/AppData/Local/Temp/verifier/gems/gems/busser-0.7.1/l
$$$$$$ ib/busser/command/plugin_install.rb:42:in `install_all'
$$$$$$     from C:/Users/ADMINI~1/AppData/Local/Temp/verifier/gems/gems/thor-0.19.0/li
$$$$$$ b/thor/command.rb:27:in `run'
$$$$$$     from C:/Users/ADMINI~1/AppData/Local/Temp/verifier/gems/gems/thor-0.19.0/li
$$$$$$ b/thor/invocation.rb:126:in `invoke_command'
$$$$$$     from C:/Users/ADMINI~1/AppData/Local/Temp/verifier/gems/gems/thor-0.19.0/li
$$$$$$ b/thor/invocation.rb:133:in `block in invoke_all'
$$$$$$     from C:/Users/ADMINI~1/AppData/Local/Temp/verifier/gems/gems/thor-0.19.0/li
$$$$$$ b/thor/invocation.rb:133:in `each'
$$$$$$     from C:/Users/ADMINI~1/AppData/Local/Temp/verifier/gems/gems/thor-0.19.0/li
$$$$$$ b/thor/invocation.rb:133:in `map'
$$$$$$     from C:/Users/ADMINI~1/AppData/Local/Temp/verifier/gems/gems/thor-0.19.0/li
$$$$$$ b/thor/invocation.rb:133:in `invoke_all'
$$$$$$     from C:/Users/ADMINI~1/AppData/Local/Temp/verifier/gems/gems/thor-0.19.0/li
$$$$$$ b/thor/group.rb:232:in `dispatch'
$$$$$$     from C:/Users/ADMINI~1/AppData/Local/Temp/verifier/gems/gems/thor-0.19.0/li
$$$$$$ b/thor/invocation.rb:115:in `invoke'
$$$$$$     from C:/Users/ADMINI~1/AppData/Local/Temp/verifier/gems/gems/thor-0.19.0/li
$$$$$$ b/thor.rb:40:in `block in register'
$$$$$$     from C:/Users/ADMINI~1/AppData/Local/Temp/verifier/gems/gems/thor-0.19.0/li
$$$$$$ b/thor/command.rb:27:in `run'
$$$$$$     from C:/Users/ADMINI~1/AppData/Local/Temp/verifier/gems/gems/thor-0.19.0/li
$$$$$$ b/thor/invocation.rb:126:in `invoke_command'
$$$$$$     from C:/Users/ADMINI~1/AppData/Local/Temp/verifier/gems/gems/thor-0.19.0/li
$$$$$$ b/thor.rb:359:in `dispatch'
$$$$$$     from C:/Users/ADMINI~1/AppData/Local/Temp/verifier/gems/gems/thor-0.19.0/li
$$$$$$ b/thor/invocation.rb:115:in `invoke'
$$$$$$     from C:/Users/ADMINI~1/AppData/Local/Temp/verifier/gems/gems/thor-0.19.0/li
$$$$$$ b/thor.rb:235:in `block in subcommand'
$$$$$$     from C:/Users/ADMINI~1/AppData/Local/Temp/verifier/gems/gems/thor-0.19.0/li
$$$$$$ b/thor/command.rb:27:in `run'
$$$$$$     from C:/Users/ADMINI~1/AppData/Local/Temp/verifier/gems/gems/thor-0.19.0/li
$$$$$$ b/thor/invocation.rb:126:in `invoke_command'
$$$$$$     from C:/Users/ADMINI~1/AppData/Local/Temp/verifier/gems/gems/thor-0.19.0/li
$$$$$$ b/thor.rb:359:in `dispatch'
$$$$$$     from C:/Users/ADMINI~1/AppData/Local/Temp/verifier/gems/gems/thor-0.19.0/li
$$$$$$ b/thor/base.rb:440:in `start'
$$$$$$     from C:/Users/ADMINI~1/AppData/Local/Temp/verifier/gems/gems/busser-0.7.1/b
$$$$$$ in/busser:8:in `&lt;top (required)&gt;'
$$$$$$     from C:/Users/ADMINI~1/AppData/Local/Temp/verifier/bin/busser:22:in `load'
$$$$$$     from C:/Users/ADMINI~1/AppData/Local/Temp/verifier/bin/busser:22:in
>>>>>> Verify failed on instance <default-windows-2012r2>.
>>>>>> Please see .kitchen/logs/default-windows-2012r2.log for more details
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: WinRM exited (1) for command: [
$env:BUSSER_ROOT = "$env:TEMP\verifier"
$env:GEM_HOME = "$env:TEMP\verifier\gems"
$env:GEM_PATH = "$env:TEMP\verifier\gems"
$env:GEM_CACHE = "$env:TEMP\verifier\gems\cache"
$ruby = "$env:systemdrive\opscode\chef\embedded\bin\ruby.exe"
$gem = "$env:systemdrive\opscode\chef\embedded\bin\gem"
$version = "busser"
$gem_install_args = "busser --no-rdoc --no-ri --no-format-executable -n $env:TEMP\verifier\bin --no-user-install"
$busser = "$env:TEMP\verifier\bin\busser.bat"
$plugins = "busser-inspec"

if ((& "$ruby" "$gem" list busser -i) -ne "true") {
  Write-Host "-----> Installing Busser ($version)`n"
  & "$ruby" "$gem" install $gem_install_args.Split() 2>&1
} else {
  Write-Host "-----> Busser installation detected ($version)`n"
}

if (-Not (Test-Path "$busser")) {
  $gem_bindir = & "$ruby" -rrubygems -e "puts Gem.bindir.dup.gsub('/', '\\')"
  & "$ruby" "$gem_bindir\busser" setup --type bat 2>&1
}

Write-Host "       Installing Busser plugins: $plugins`n"
& "$busser" plugin install $plugins.Split() 2>&1
]
>>>>>> ----------------------
@burtlo burtlo changed the title Chef DK 0.11.2 ignores a newly installed Test Kitchen version Chef DK 0.11.2 ignores a newly installed Test Kitchen Mar 14, 2016
@binamov
Copy link

binamov commented Mar 15, 2016

+1
this effectively breaks inspec as a verifier for windows-based test-kitchen instances.

my current hackaround:

chef gem update test-kitchen
atom C:\opscode\chefdk\bin\kitchen
#change lines 15 and 17 from versions 1.5.0 to 1.6.0

@danielsdeleo
Copy link
Contributor

We do this to ensure that installing other gems will not break the bundled applications in ChefDK by introducing incompatible dependencies or incompatible versions of complementary tools such as berks and kitchen. Packaging applications this way also gives a significant performance benefit. Therefore it's working as designed, even though you wanted it to do something different. We do maintain this project which allows you to update the versions of tools in ChefDK, but you're on your own if the resulting package isn't working: https://github.com/chef/appbundle-updater

@chef-boneyard chef-boneyard locked and limited conversation to collaborators Feb 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants