Atalanta / leibniz

Leibniz is an integration testing framework for Chef
MIT License
80 stars 16 forks source link

Provisioning an infrastructure results in Kitchen::ShellOut::ShellCommandFailed #1

Closed Atalanta closed 11 years ago

Atalanta commented 11 years ago

When the Infrastructure.new(config.instances) call is made, the following error is given:

[5] pry(Leibniz)> config.instances
       [kitchen::driver::vagrant command] BEGIN (vagrant --version)
       [kitchen::driver::vagrant command] END (0m0.53s)
Kitchen::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of vagrant --version ----
STDOUT:
STDERR: /Users/stephen/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/rubygems_integration.rb:214:in `block in replace_gem': vagrant is not part of the bundle. Add it to Gemfile. (Gem::LoadError)
        from /Users/stephen/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/bin/vagrant:22:in `<main>'
---- End output of vagrant --version ----
Ran vagrant --version returned 1
from /Users/stephen/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/test-kitchen-1.0.0.beta.4/lib/kitchen/shell_out.rb:73:in `rescue in run_command'
Atalanta commented 11 years ago

[4] pry(#Kitchen::Config)> driver = new_driver(merge_driver_hash(platform_hash)) Kitchen::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1' ---- Begin output of vagrant --version ---- STDOUT: STDERR: /Users/stephen/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/rubygems_integration.rb:214:in block in replace_gem': vagrant is not part of the bundle. Add it to Gemfile. (Gem::LoadError) from /Users/stephen/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/bin/vagrant:22:in

' ---- End output of vagrant --version ---- Ran vagrant --version returned 1 from /Users/stephen/src/test-kitchen/lib/kitchen/shell_out.rb:70:in `rescue in run_command'

Atalanta commented 11 years ago

[8] pry(Kitchen::Driver)> object.verify_dependencies Kitchen::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1' ---- Begin output of vagrant --version ---- STDOUT: STDERR: /Users/stephen/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/rubygems_integration.rb:214:in block in replace_gem': vagrant is not part of the bundle. Add it to Gemfile. (Gem::LoadError) from /Users/stephen/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/bin/vagrant:22:in

' ---- End output of vagrant --version ---- Ran vagrant --version returned 1 from /Users/stephen/src/test-kitchen/lib/kitchen/shell_out.rb:70:in `rescue in run_command' [9] pry(Kitchen::Driver)> show-method object.verify_dependencies

From: /Users/stephen/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/kitchen-vagrant-0.11.2/lib/kitchen/driver/vagrant.rb @ line 86: Owner: Kitchen::Driver::Vagrant Visibility: public Number of lines: 3

def verify_dependencies check_vagrant_version end

Atalanta commented 11 years ago

[5] pry(#Kitchen::Driver::Vagrant)> silently_run("echo $PATH") => "/Users/stephen/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/bin:/Users/stephen/.rbenv/versions/1.9.3-p392/bin:/Users/stephen/.rbenv/libexec:/Users/stephen/.rbenv/shims:/Users/stephen/.rbenv/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/local/git/bin\n"

Contrast:

lemur> echo $PATH /Users/stephen/.rbenv/shims:/Users/stephen/.rbenv/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/local/git/bin

Atalanta commented 11 years ago

Looks like old stuff left behind...

lemur> cd /Users/stephen/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/bin/
lemur> ls
kitchen vagrant veewee
lemur> ls -l
total 24
-rwxr-xr-x  1 stephen  staff  477  7 Nov 14:23 kitchen
-rwxr-xr-x  1 stephen  staff  462 30 Apr  2013 vagrant
-rwxr-xr-x  1 stephen  staff  458 30 Apr  2013 veewee
lemur> cat vagrant
#!/usr/bin/env ruby
#
# This file was generated by RubyGems.
#
# The application 'vagrant' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require 'rubygems'

version = ">= 0"

if ARGV.first
  str = ARGV.first
  str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
  if str =~ /\A_(.*)_\z/
    version = $1
    ARGV.shift
  end
end

gem 'vagrant', version
load Gem.bin_path('vagrant', 'vagrant', version)
Atalanta commented 11 years ago

Removing old vagrant wrapper, error goes.