Giter VIP home page Giter VIP logo

busser-serverspec's Introduction

Test Kitchen

Gem Version Build Status

Website https://kitchen.ci/
Source Code https://kitchen.ci/docs/getting-started/introduction/
Slack #test-kitchen channel on Chef Community Slack

Test Kitchen is an integration tool for developing and testing infrastructure code and software on isolated target platforms.

Getting Started Guide

To learn how to install and setup Test Kitchen for developing infrastructure code, check out the Getting Started Guide.

If you want to get going super fast, then try the Quick Start next...

Quick Start

Test Kitchen is a RubyGem and can be installed with:

gem install test-kitchen

If you use Bundler, you can add gem "test-kitchen" to your Gemfile and make sure to run bundle install.

Next add support to your library, Chef cookbook, or empty project with kitchen init:

kitchen init

A kitchen.yml file will be created in your project base directory. This file describes your testing configuration; what you want to test and on which target platforms. Each of these suite and platform combinations are called instances. By default your instances will be converged with Chef Solo and run in Vagrant virtual machines.

Get a listing of your instances with:

kitchen list

Run Chef Infra Client on an instance, in this case default-ubuntu-2004, with:

kitchen converge default-ubuntu-2004

Destroy all instances with:

kitchen destroy

You can clone a Chef Infra cookbook project that contains Test Kitchen support and run through all the instances in serial by running:

kitchen test

Usage

There is help included with the kitchen help subcommand which will list all subcommands and their usage:

kitchen help test

More verbose logging for test-kitchen can be specified when running test-kitchen from the command line using:

kitchen test -l debug

For the provisioner (e.g. chef-solo or chef-infra) add a log_level item to the provisioner section of the .kitchen.yml For more information on setting log_level see the configuration documentation.

Documentation

Documentation is being added on the Test Kitchen website. Please read and contribute to improve them!

Versioning

Test Kitchen aims to adhere to Semantic Versioning 2.0.0.

Community and Ecosystem

If you would like to see a few of the plugins or ecosystem helpers, please look at ECOSYSTEM.md.

Development

Pull requests are very welcome! Make sure your patches are well tested. Ideally create a topic branch for every separate change you make. For example:

  1. Fork the repo
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Authors

Created by Fletcher Nichol ([email protected]).

Maintained by Chef Software and a growing community of contributors.

License

Apache License, Version 2.0 (see LICENSE)

busser-serverspec's People

Contributors

arangamani avatar biinari avatar chuhn avatar coderanger avatar d-higuchi avatar dai-vdr avatar damacus avatar dependabot-preview[bot] avatar jkeiser avatar tas50 avatar tyler-ball avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

busser-serverspec's Issues

test-kitchen check for ports broken on newer versions?

I know these tests used to work, but they've been failing at some point and I'm trying to figure out if it's because I upgraded or if there's something else.

I have this in my _spec.rb file:

# test ssh port
describe port(22) do
  it { should be_listening }
end

I can ssh onto the server fine. I know the port is listening, but I get this when I run kitchen verify:

       Failures:

     1) Port "22" should be listening
        Failure/Error: it { should be_listening }
          expected Port "22" to be listening
        # /tmp/verifier/suites/serverspec/base_spec.rb:5:in `block (2 levels) in <top (required)>'

Severspec gem version

Is there anyway to set which version of the serverspec gem gets installed (during the postinstall phase)? Every time serverspec releases an update all our tests start breaking, and locking that version down would be super helpful.

Install Gems like busser-rspec

Hello! Would you consider doing something like busser-rspec where a Gemfile can be provided for bundler to install any dependencies? I think https://github.com/test-kitchen/busser-serverspec/blob/master/lib/busser/runner_plugin/serverspec.rb would need to be modified to include something like:

      if File.exists?(File.join(rspec_path, "Gemfile"))
        # Bundle install local completes quickly if the gems are already found locally
        # it fails if it needs to talk to the internet. The || below is the fallback
        # to the internet-enabled version. It's a speed optimization.
        run("PATH=#{ENV['PATH']}:#{Gem.bindir}; bundle install --local || bundle install")
      end

Source: https://github.com/test-kitchen/busser-rspec/blob/master/lib/busser/runner_plugin/rspec.rb#L39-L44

Rspec output should be configurable

Hi,

especially when using test-kitchen / busser within a CI system it's quite odd that the test result output is just part of the stdout stream. It would be great if you could allow to pass other formatter options to rspec / serverspec. So that HTML or junit reports could be generated from the testruns.

Cheers

Fail to run busser-server spec since serverspec v2 has been released (3rd Octber /2014)

More details #13

From Serverspec

spec_helper.rb incompatible
spec_helper.rb does not have backward compatibility. So you should re-generate spec_helper.rb by serverspec-init and check it.

Backend helper and DetectOS helper have been removed
In version 1, you need to include SpecInfra::Helper::backend_type SpecInfra::Helper::DetectOS to detect the os of target hosts like this.

require 'serverspec'
include SpecInfra::Helper::Ssh
include SpecInfra::Helper::DetectOS

http://serverspec.org/changes-of-v2.html

[Question] Keeping shared examples in git

Hi guys,

We're using kitchen to test our Salt-Stack formulas. We have some shared examples, like for nginx or service shared functions, so is there any mechanism in kitchen to get such examples from git as a dependency? Is there any detailed description on that? Currently we have to add such common shared examples in each formula :(

ps: we use serverspec currently, looks like inspec could cover all our needs?

Thanks,

net-telnet 0.2.0 requires ruby >=2.3.0

Hi Guys,

Our chef is still using ruby 1.9.1. Since net-telnet made an upgrade from 0.1.1 to 0.2.0, it is no longer supported ruby 1.9.x. Can you make a version restriction like you did for net-ssh in PR
c917279

Below is the log when I ran into the issue:
10:40:34 -----> Installing Serverspec..
10:41:01 Fetching: rspec-support-3.7.1.gem
Fetching: rspec-support-3.7.1.gem ( 44%)
Fetching: rspec-support-3.7.1.gem ( 90%)
Fetching: rspec-support-3.7.1.gem ( 97%)
Fetching: rspec-support-3.7.1.gem (100%)
Fetching: rspec-support-3.7.1.gem (100%)
10:41:01 Fetching: rspec-core-3.7.1.gem
Fetching: rspec-core-3.7.1.gem ( 10%)
Fetching: rspec-core-3.7.1.gem ( 20%)
Fetching: rspec-core-3.7.1.gem ( 24%)
Fetching: rspec-core-3.7.1.gem ( 33%)
Fetching: rspec-core-3.7.1.gem ( 44%)
Fetching: rspec-core-3.7.1.gem ( 48%)
Fetching: rspec-core-3.7.1.gem ( 59%)
Fetching: rspec-core-3.7.1.gem ( 66%)
Fetching: rspec-core-3.7.1.gem ( 73%)
Fetching: rspec-core-3.7.1.gem ( 74%)
Fetching: rspec-core-3.7.1.gem ( 85%)
Fetching: rspec-core-3.7.1.gem ( 94%)
Fetching: rspec-core-3.7.1.gem ( 98%)
Fetching: rspec-core-3.7.1.gem (100%)
Fetching: rspec-core-3.7.1.gem (100%)
10:41:01 Fetching: diff-lcs-1.3.gem
Fetching: diff-lcs-1.3.gem ( 5%)
Fetching: diff-lcs-1.3.gem ( 40%)
Fetching: diff-lcs-1.3.gem ( 76%)
Fetching: diff-lcs-1.3.gem ( 82%)
Fetching: diff-lcs-1.3.gem ( 91%)
Fetching: diff-lcs-1.3.gem (100%)
Fetching: diff-lcs-1.3.gem (100%)
10:41:01 Fetching: rspec-expectations-3.7.0.gem
Fetching: rspec-expectations-3.7.0.gem ( 20%)
Fetching: rspec-expectations-3.7.0.gem ( 40%)
Fetching: rspec-expectations-3.7.0.gem ( 50%)
Fetching: rspec-expectations-3.7.0.gem ( 52%)
Fetching: rspec-expectations-3.7.0.gem ( 64%)
Fetching: rspec-expectations-3.7.0.gem ( 71%)
Fetching: rspec-expectations-3.7.0.gem ( 72%)
Fetching: rspec-expectations-3.7.0.gem ( 79%)
Fetching: rspec-expectations-3.7.0.gem ( 84%)
Fetching: rspec-expectations-3.7.0.gem ( 86%)
Fetching: rspec-expectations-3.7.0.gem (100%)
Fetching: rspec-expectations-3.7.0.gem (100%)
10:41:01 Fetching: rspec-mocks-3.7.0.gem
Fetching: rspec-mocks-3.7.0.gem ( 20%)
Fetching: rspec-mocks-3.7.0.gem ( 42%)
Fetching: rspec-mocks-3.7.0.gem ( 52%)
Fetching: rspec-mocks-3.7.0.gem ( 73%)
Fetching: rspec-mocks-3.7.0.gem ( 79%)
Fetching: rspec-mocks-3.7.0.gem (100%)
Fetching: rspec-mocks-3.7.0.gem (100%)
10:41:02 Fetching: rspec-3.7.0.gem
Fetching: rspec-3.7.0.gem (100%)
Fetching: rspec-3.7.0.gem (100%)
10:41:02 Fetching: rspec-its-1.2.0.gem
Fetching: rspec-its-1.2.0.gem (100%)
Fetching: rspec-its-1.2.0.gem (100%)
10:41:02 Fetching: multi_json-1.13.1.gem
Fetching: multi_json-1.13.1.gem ( 29%)
Fetching: multi_json-1.13.1.gem ( 93%)
Fetching: multi_json-1.13.1.gem (100%)
Fetching: multi_json-1.13.1.gem (100%)
10:41:02 Fetching: net-scp-1.2.1.gem
Fetching: net-scp-1.2.1.gem ( 48%)
Fetching: net-scp-1.2.1.gem ( 98%)
Fetching: net-scp-1.2.1.gem (100%)
Fetching: net-scp-1.2.1.gem (100%)
10:41:02 Fetching: net-telnet-0.2.0.gem
Fetching: net-telnet-0.2.0.gem ( 60%)
Fetching: net-telnet-0.2.0.gem (100%)
Fetching: net-telnet-0.2.0.gem (100%)
10:41:02 /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:388:in ensure_required_ruby_version_met': net-telnet requires Ruby version >= 2.3.0. (Gem::InstallError) 10:41:02 from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:156:in install'
10:41:02 from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/dependency_installer.rb:297:in block in install' 10:41:02 from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/dependency_installer.rb:270:in each'
10:41:02 from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/dependency_installer.rb:270:in each_with_index' 10:41:02 from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/dependency_installer.rb:270:in install'
10:41:02 from /tmp/verifier/gems/gems/busser-0.7.1/lib/busser/rubygems.rb:44:in install_gem' 10:41:02 from /tmp/verifier/gems/gems/busser-0.7.1/lib/busser/helpers.rb:57:in install_gem'
10:41:02 from /tmp/verifier/gems/gems/busser-serverspec-0.5.9/lib/busser/runner_plugin/serverspec.rb:64:in install_serverspec' 10:41:02 from /tmp/verifier/gems/gems/busser-serverspec-0.5.9/lib/busser/runner_plugin/serverspec.rb:33:in test'
10:41:02 from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/command.rb:27:in run' 10:41:02 from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:126:in invoke_command'
10:41:02 from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:133:in block in invoke_all' 10:41:02 from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:133:in each'
10:41:02 from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:133:in map' 10:41:02 from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:133:in invoke_all'
10:41:02 from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/group.rb:232:in dispatch' 10:41:02 from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:115:in invoke'
10:41:02 from /tmp/verifier/gems/gems/busser-0.7.1/lib/busser/command/test.rb:43:in block in perform' 10:41:02 from /tmp/verifier/gems/gems/busser-0.7.1/lib/busser/command/test.rb:35:in each'
10:41:02 from /tmp/verifier/gems/gems/busser-0.7.1/lib/busser/command/test.rb:35:in perform' 10:41:02 from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/command.rb:27:in run'
10:41:02 from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:126:in invoke_command' 10:41:02 from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:133:in block in invoke_all'
10:41:02 from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:133:in each' 10:41:02 from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:133:in map'
10:41:02 from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:133:in invoke_all' 10:41:02 from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/group.rb:232:in dispatch'
10:41:02 from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:115:in invoke' 10:41:02 from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor.rb:40:in block in register'
10:41:02 from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/command.rb:27:in run' 10:41:02 from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:126:in invoke_command'
10:41:02 from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor.rb:359:in dispatch' 10:41:02 from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/base.rb:440:in start'
10:41:02 from /tmp/verifier/gems/gems/busser-0.7.1/bin/busser:8:in <top (required)>' 10:41:02 from /tmp/verifier/gems/bin/busser:23:in load'
10:41:02 from /tmp/verifier/gems/bin/busser:23:in `

'
10:41:02 D Cleaning up local sandbox in /tmp/default-centos-64-sandbox-20180726-3436-w804m6
10:41:02 -----> Destroying ...
10:41:03 OpenStack instance <3e2a9228-1222-428a-9941-0b5168e1cb77> destroyed.
10:41:03 Finished destroying (0m0.95s).
10:41:03 >>>>>> Verify failed on instance .
10:41:03 >>>>>> Please see .kitchen/logs/default-centos-64.log for more details
10:41:03 >>>>>> ------Exception-------
10:41:03 >>>>>> Class: Kitchen::ActionFailed
10:41:03 >>>>>> Message: SSH exited (1) for command: [sh -c '

Specifying an alternate version of serverspec

Is there a way to override the default version for gem install of serverspec? I need to be able to test a Solaris10 branch of serverspec from within test kitchen and haven't been able to see where I can override the serverspec version.

The code in this library appears to just call install_gem("serverspec") with no version for serverspec which results in obtaining the latest released version.

Option to specify serverspec version

Please add an option so the version of the serverspec (and specinfra) gem can be specified. It appears that install_gem supports a version number so hopefully it would not be too hard to implement.

We've been bitten by serverspec changes several times recently and this would be a nice feature to have.

Bundler version in postinstall

Hi,

I'm using busser and busser-serverspec with Chef 12.13.81 on CentOS 7.
Since today, I'm facing this issue:

-----> Installing Busser (busser)
Fetching: thor-0.19.0.gem (100%)
       Successfully installed thor-0.19.0
Fetching: busser-0.7.1.gem (100%)
       Successfully installed busser-0.7.1
       2 gems installed
-----> Installing Busser plugin: busser-serverspec
       Plugin serverspec installed (version 0.5.10)
-----> Running postinstall for serverspec plugin
       /opt/chef/embedded/lib/ruby/site_ruby/2.3.0/rubygems/installer.rb:619:in `ensure_required_rubygems_version_met': bundler requires RubyGems version >= 3.0.0. Try 'gem update --system' to update RubyGems itself. (Gem::InstallError)
        from /opt/chef/embedded/lib/ruby/site_ruby/2.3.0/rubygems/installer.rb:828:in `pre_install_checks'
        from /opt/chef/embedded/lib/ruby/site_ruby/2.3.0/rubygems/installer.rb:279:in `install'
        from /opt/chef/embedded/lib/ruby/site_ruby/2.3.0/rubygems/resolver/specification.rb:97:in `install'
        from /opt/chef/embedded/lib/ruby/site_ruby/2.3.0/rubygems/request_set.rb:166:in `block in install'
        from /opt/chef/embedded/lib/ruby/site_ruby/2.3.0/rubygems/request_set.rb:156:in `each'
        from /opt/chef/embedded/lib/ruby/site_ruby/2.3.0/rubygems/request_set.rb:156:in `install'
        from /opt/chef/embedded/lib/ruby/site_ruby/2.3.0/rubygems/dependency_installer.rb:405:in `install'
        from /tmp/verifier/gems/gems/busser-0.7.1/lib/busser/rubygems.rb:44:in `install_gem'
        from /tmp/verifier/gems/gems/busser-0.7.1/lib/busser/helpers.rb:57:in `install_gem'
        from /tmp/verifier/gems/gems/busser-serverspec-0.5.10/lib/busser/runner_plugin/serverspec.rb:28:in `block in <class:Serverspec>'

In this line https://github.com/test-kitchen/busser-serverspec/blob/master/lib/busser/runner_plugin/serverspec.rb#L28 busser-serverspec installs bundler at the last version.
How can we pin a version for bundler ?
I can't upgrade rubygems.

Tests for all suites

Hi,

Is it possible to run some tests for all suites? Then it saves from duplicating the tests those are applicable for all suites

Arif

Can not install gems from Gemfile on Windows

The PATH on a Windows guest does not seem to get updated properly so it can not find bundler command when trying to install gems from a Gemfile.

Get the following error when trying to install gems from a Gemfile on a Windows guest:

-----> Starting Kitchen (v1.4.0.rc.1)
-----> Verifying <default-win-2012r2>...
       Preparing files for transfer
-----> Busser installation detected (busser)
       Installing Busser plugins: busser-serverspec
       Plugin serverspec already installed
       Transferring files to <default-win-2012r2>
-----> Running serverspec test suite
-----> Bundle Installing..
         run  bundle install --gemfile C:\Users\vagrant\AppData\Local\Temp\verifier/suites/serverspec/Gemfile --local || bundle install --gemfile C:\Users\vagrant\AppData\Local\Temp\verifier/suites/serverspec/Gemfile from "."
       C:/opscode/chef/embedded/bin/ruby.exe -IC:/Users/vagrant/AppData/Local/Temp/verifier/suites/serverspec -I'C:/Users/vagrant/AppData/Local/Temp/verifier/gems/gems/rspec-support-3.2.2/lib';'C:/Users/vagrant/AppData/Local/Temp/verifier/gems/gems/rspec-core-3.2.2/lib' 'C:/Users/vagrant/AppData/Local/Temp/verifier/gems/gems/rspec-core-3.2.2/exe/rspec' --pattern 'C:/Users/vagrant/AppData/Local/Temp/verifier/suites/serverspec/**/*_spec.rb' --color --format documentation --default-path C:/Users/vagrant/AppData/Local/Temp/verifier/suites/serverspec
$$$$$$ C:/Users/vagrant/AppData/Local/Temp/verifier/gems/gems/busser-serverspec-0.5.4/lib/busser/runner_plugin/serverspec.rb:49:in `run_bundle_install': Use RbConfig instead of obsolete and deprecated Config.
$$$$$$ C:/Users/vagrant/AppData/Local/Temp/verifier/gems/gems/busser-serverspec-0.5.4/lib/busser/runner_plugin/serverspec.rb:49:in `run_bundle_install': Use RbConfig instead of obsolete and deprecated Config.
$$$$$$ 'bundle' is not recognized as an internal or external command,
$$$$$$ operable program or batch file.
$$$$$$ 'bundle' is not recognized as an internal or external command,
$$$$$$ operable program or batch file.

Support for running *_spec.rb according to the hostname or private ipaddress of a node

my .kitchen.yml file


---
driver:
  name: vagrant

provisioner:
  name: chef_zero

platforms:
  - name: nfs-server-ubuntu
    run_list:
      - recipe[nfs::server]
    driver:
      network:
      - ["private_network", {ip: "192.168.33.33"}]
  - name: nfs-client-ubuntu
    run_list:
      - recipe[nfs::client]
    driver:
      network:
      - ["private_network", {ip: "192.168.33.32"}]

suites:
  - name: nfs
    run_list:
    attributes:
...

my spec files

`-- test
    `-- integration
        `-- default
            `-- serverspec
                |-- 192.168.33.33
                |   `-- nfs_server_spec.rb
                |-- 192.168.33.32
                |   `-- nfs_client_spec.rb
                `-- spec_helper.rb

It runs both spec files on both nodes.
It would be great if the test can be carried out respectively. e.g. nfs_server_spec.rb only runs on 192.168.33.33 & nfs_client_spec.rb only runs on 192.168.33.32

How do I run a command as sudo?

Since I accidentally upgraded the busser I can't run any specs anymore. It keeps asking for sudo password prompt and I have no way of providing it back.

How do I turn on the previous functionality with not asking for the password?
I tried the following but it doesn't accept anything I write:

app-server zsh 2014-10-20 22-36-41

In a spec_helper I have the following:

require 'serverspec'

set :backend, :exec
set :path, '/sbin:/usr/sbin:/usr/local/sbin:$PATH'
set :sudo_password, 'vagrant'

Doesn't seem to help and I have no idea if that is the password test kitchen sets for my vagrant user.

I simply can't start the busser with

# .kitchen.yml
busser:
  sudo: true

anymore.

Gems installed from git aren't available to tests

Gems in the serverspec Gemfile that are installed from git aren't available to tests.

For example, a Gemfile containing:
gem 'dummy_gem', git: '[email protected]:test/dummy_gem.git'

And a test that requires said gem:
require 'dummy_gem'

Will result in rubygems raising a LoadError exception. I can see from the bundler output that the gem is in fact getting installed; it's just not available.

Be able to use chef attributes in serverspec

For now we are using tests to manage if executable is installed with:

describe command('which nodejs') do
  it { should return_exit_status 0 }
end

But that's quite limited, we don't know if version installed is what we really want.
Something really good can be to be able to use:

describe command('nodejs -v') do
  it { should return_stdout "v#{node['nodejs']['version']}" }
end

It can be related to this:
https://github.com/serverspec/serverspec/issues/155

I don't know if it must be manage by serverspec (be able to parse chef), or a work for busser to be able to export in serverspec yml format.
But this feature is clearly a must-have.

PS: If it's already possible, don't hesitate to tell me how :)
PS bis: another ticket talk about it... but I really don't understand why using chef attributes in tests is a bad idea... really

Typos in bundle_install

While playing around with system rubies I found, or at least I am pretty sure, a typo in bundle_install [1].
Config::CONFIG['bindir'] should actually be RbConfig::CONFIG['bindir']. I changed it locally and it worked with RbConfig although I am not sure what any of them is supposed to be. Otherwise I get this:

-----> Running serverspec test suite
-----> Bundle Installing..
/tmp/verifier/gems/gems/busser-serverspec-0.5.6/lib/busser/runner_plugin/serverspec.rb:50:in `run_bundle_install': uninitialized constant Busser::RunnerPlugin::Serverspec::Config (NameError)
    from /tmp/verifier/gems/gems/busser-serverspec-0.5.6/lib/busser/runner_plugin/serverspec.rb:32:in `test'
    from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/command.rb:27:in `run'
    from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:126:in `invoke_command'
    from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:133:in `block in invoke_all'
    from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:133:in `each'
    from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:133:in `map'
    from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:133:in `invoke_all'
    from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/group.rb:232:in `dispatch'
    from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:115:in `invoke'
    from /tmp/verifier/gems/gems/busser-0.7.1/lib/busser/command/test.rb:43:in `block in perform'
    from /tmp/verifier/gems/gems/busser-0.7.1/lib/busser/command/test.rb:35:in `each'
    from /tmp/verifier/gems/gems/busser-0.7.1/lib/busser/command/test.rb:35:in `perform'
    from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/command.rb:27:in `run'
    from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:126:in `invoke_command'
    from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:133:in `block in invoke_all'
    from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:133:in `each'
    from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:133:in `map'
    from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:133:in `invoke_all'
    from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/group.rb:232:in `dispatch'
    from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:115:in `invoke'
    from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor.rb:40:in `block in register'
    from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/command.rb:27:in `run'
    from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:126:in `invoke_command'
    from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor.rb:359:in `dispatch'
    from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/base.rb:440:in `start'
    from /tmp/verifier/gems/gems/busser-0.7.1/bin/busser:8:in `<top (required)>'
    from /tmp/verifier/gems/bin/busser:23:in `load'
    from /tmp/verifier/gems/bin/busser:23:in `<main>'

[1] https://github.com/test-kitchen/busser-serverspec/blob/v0.5.6/lib/busser/runner_plugin/serverspec.rb#L49

busser-serverspec is failing to use sandbox for spec location

Fetching: thor-0.18.1.gem (100%)
Fetching: busser-0.6.0.gem (100%)
       Successfully installed thor-0.18.1
       Successfully installed busser-0.6.0
       2 gems installed
-----> Setting up Busser
       Creating BUSSER_ROOT in /tmp/busser
       Creating busser binstub
       Plugin serverspec installed (version 0.2.5)
-----> Running postinstall for serverspec plugin
       Finished setting up <default-ubuntu-1204> (0m22.31s).
-----> Verifying <default-ubuntu-1204>...
       Suite path directory /tmp/busser/suites does not exist, skipping.
       Uploading /tmp/busser/suites/serverspec/localhost/default.rb (mode=0644)
       Uploading /tmp/busser/suites/serverspec/spec_helper.rb (mode=0644)
-----> Running serverspec test suite
       /opt/chef/embedded/bin/ruby -I/tmp/busser/suites/serverspec -S /opt/chef/embedded/bin/rspec --color --format documentation
       /tmp/busser/gems/gems/rspec-core-2.14.7/lib/rspec/core/configuration.rb:896:in `load': cannot load such file -- /home/ubuntu/spec (LoadError)
        from /tmp/busser/gems/gems/rspec-core-2.14.7/lib/rspec/core/configuration.rb:896:in `block in load_spec_files'
        from /tmp/busser/gems/gems/rspec-core-2.14.7/lib/rspec/core/configuration.rb:896:in `each'

        from /tmp/busser/gems/gems/rspec-core-2.14.7/lib/rspec/core/configuration.rb:896:in `load_spec_files'
        from /tmp/busser/gems/gems/rspec-core-2.14.7/lib/rspec/core/command_line.rb:22:in `run'
        from /tmp/busser/gems/gems/rspec-core-2.14.7/lib/rspec/core/runner.rb:80:in `run'
        from /tmp/busser/gems/gems/rspec-core-2.14.7/lib/rspec/core/runner.rb:17:in `block in autorun'
       /opt/chef/embedded/bin/ruby -I/tmp/busser/suites/serverspec -S /opt/chef/embedded/bin/rspec --color --format documentation failed
       Ruby Script[/tmp/busser/gems/gems/busser-serverspec-0.2.5/lib/busser/runner_plugin/../serverspec/runner.rb /tmp/busser/suites/serverspec] exit code was 1

serverspec now has json gem as runtime dependency

The new runtime dependency of the json gem requires building native extensions. Neither busser nor serverspec-busser actually ensures there is a compiler or autoconf or any other tools to build those gems. Is this something that should be handled in busser-serverspec, or would you rather everyone just ensure the dependencies for serverspec are installed first.

Thanks!

Allow testing using the ssh driver

I don't always want to require Chef Omnibus to be installed and it is certainly possible to test with server spec using the ssh driver.
Can we support it as well?

Gem pulled from rubygems?

๐Ÿ—ฃ๏ธ Foreword

Thank for taking the time to fill this bug report fully. Without it we may not be able to fix the bug, and the issue may be closed without resolution.

๐Ÿ‘ป Brief Description

My chef tests started failing a few hours ago. I ended up finding this dependency error

       /usr/share/rubygems/rubygems/resolver/installer_set.rb:70:in `add_always_install': Unable to resolve dependency: user requested 'busser-serverspec (>= 0)' (Gem::UnsatisfiableDependencyError)

Then looking on rubygems, it looks like the gem was yanked.

https://rubygems.org/gems/busser-serverspec

Has this gem been deprecated? Is there a replacement that can be used instead?

Version

[Version of the project installed]

Environment

[Details about the environment such as the Operating System, cookbook details, etc...]

Scenario

[What you are trying to achieve and you can't?]

Steps to Reproduce

[If you are filing an issue what are the things we need to do in order to repro your problem?]

example:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected Result

[What are you expecting to happen as the consequence of above reproduction steps?]

Actual Result

[What actually happens after the reproduction steps?]

โž• Additional context

Add any other context about the problem here. e.g. related issues or existing pull requests.

busser-serverspec requires Ruby version >= 2.3.0

Hello there,

Rubygems site states that the subject gem should work with any Ruby version but on Redhat during "Kitchen exec kitchen test", it's asking for Ruby >= 2.3.0. I have pasted the logs for your kind review, will appreciate any help in this regard. Thanks.

Fetching: busser-0.7.1.gem (100%)
Successfully installed busser-0.7.1
2 gems installed
-----> Installing Busser plugin: busser-serverspec
Plugin serverspec installed (version 0.5.10)
-----> Running postinstall for serverspec plugin
/usr/share/rubygems/rubygems/installer.rb:518:in ensure_required_ruby_version_met': bundler requires Ruby version >= 2.3.0. (Gem::InstallError) from /usr/share/rubygems/rubygems/installer.rb:781:in pre_install_checks'
from /usr/share/rubygems/rubygems/installer.rb:216:in install' from /usr/share/rubygems/rubygems/dependency_installer.rb:374:in block in install'
from /usr/share/rubygems/rubygems/dependency_installer.rb:337:in each' from /usr/share/rubygems/rubygems/dependency_installer.rb:337:in each_with_index'
from /usr/share/rubygems/rubygems/dependency_installer.rb:337:in install' from /tmp/verifier/gems/gems/busser-0.7.1/lib/busser/rubygems.rb:44:in install_gem'
from /tmp/verifier/gems/gems/busser-0.7.1/lib/busser/helpers.rb:57:in install_gem' from /tmp/verifier/gems/gems/busser-serverspec-0.5.10/lib/busser/runner_plugin/serverspec.rb:28:in block in class:Serverspec'
from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/command.rb:27:in run' from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:126:in invoke_command'
from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:133:in block in invoke_all' from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:133:in each'
from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:133:in map' from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:133:in invoke_all'
from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/group.rb:232:in dispatch' from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/base.rb:440:in start'
from /tmp/verifier/gems/gems/busser-0.7.1/lib/busser/runner_plugin.rb:36:in block in postinstall' from /tmp/verifier/gems/gems/busser-0.7.1/lib/busser/command/plugin_install.rb:80:in block in run_postinstall'
from /tmp/verifier/gems/gems/busser-0.7.1/lib/busser/command/plugin_install.rb:100:in drop_ssl_verify_peer' from /tmp/verifier/gems/gems/busser-0.7.1/lib/busser/command/plugin_install.rb:80:in run_postinstall'
from /tmp/verifier/gems/gems/busser-0.7.1/lib/busser/command/plugin_install.rb:57:in install' from /tmp/verifier/gems/gems/busser-0.7.1/lib/busser/command/plugin_install.rb:43:in block (2 levels) in install_all'
from /tmp/verifier/gems/gems/busser-0.7.1/lib/busser/command/plugin_install.rb:43:in each' from /tmp/verifier/gems/gems/busser-0.7.1/lib/busser/command/plugin_install.rb:43:in block in install_all'
from /tmp/verifier/gems/gems/busser-0.7.1/lib/busser/rubygems.rb:71:in silence_gem_ui' from /tmp/verifier/gems/gems/busser-0.7.1/lib/busser/command/plugin_install.rb:42:in install_all'
from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/command.rb:27:in run' from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:126:in invoke_command'
from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:133:in block in invoke_all' from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:133:in each'
from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:133:in map' from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:133:in invoke_all'
from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/group.rb:232:in dispatch' from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:115:in invoke'
from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor.rb:40:in block in register' from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/command.rb:27:in run'
from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:126:in invoke_command' from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor.rb:359:in dispatch'
from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:115:in invoke' from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor.rb:235:in block in subcommand'
from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/command.rb:27:in run' from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:126:in invoke_command'
from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor.rb:359:in dispatch' from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/base.rb:440:in start'
from /tmp/verifier/gems/gems/busser-0.7.1/bin/busser:8:in <top (required)>' from /tmp/verifier/bin/busser:23:in load'
from /tmp/verifier/bin/busser:23:in `

'

------Exception-------
Class: Kitchen::ActionFailed
Message: 1 actions failed.
Verify failed on instance . Please see .kitchen/logs/default-codeninjas-rhel-7-java-18.log for more details

Please see .kitchen/logs/kitchen.log for more details
Also try running kitchen diagnose --all for configuration

Busser installing newest rspec-core (3.9) where serverspec is using 3.8

 Gem::ConflictError:
         Unable to activate rspec-3.8.0, because rspec-core-3.9.0 conflicts with rspec-core (~> 3.8.0)
       # /tmp/verifier/suites/serverspec/xinetd_spec.rb:1:in `<top (required)>'
       # ------------------
       # --- Caused by: ---
       # LoadError:
       #   cannot load such file -- serverspec
       #   /tmp/verifier/suites/serverspec/xinetd_spec.rb:1:in `<top (required)>'
       No examples found.

kitchen test with serverspec fails: `run_ruby_script!': undefined method `success?' for nil:NilClass (NoMethodError)

Ohai!

I'm having a weird behaviour where the kitchen test reproducibly fails with the below error:

C:\Repos\_github\bills-kitchen\target\build\repo\vagrant-workflow-tests\playground\sample-toplevel-cookbook>bundle exec kitchen test
...
<snip>
...
       Suite path directory /tmp/busser/suites does not exist, skipping.
Uploading /tmp/busser/suites/serverspec/localhost/default_spec.rb (mode=0644)
Uploading /tmp/busser/suites/serverspec/spec_helper.rb (mode=0644)
D      [SSH] [email protected]:2201<{:user_known_hosts_file=>"/dev/null", :paranoid=>false, :keys_only=>true, :port=>"2201", :keys=>["C:/Repos/_github/bills-k
itchen/target/build/repo/vagrant-workflow-tests/playground/sample-toplevel-cookbook/.kitchen/kitchen-vagrant/default-ubuntu-1204/.vagrant/machines/default/vir
tualbox/private_key"], :user=>"vagrant"}> (sh -c 'BUSSER_ROOT="/tmp/busser" GEM_HOME="/tmp/busser/gems" GEM_PATH="/tmp/busser/gems" GEM_CACHE="/tmp/busser/gem
s/cache" ; export BUSSER_ROOT GEM_HOME GEM_PATH GEM_CACHE; sudo -E /tmp/busser/bin/busser test')
-----> Running serverspec test suite
-----> Installing Serverspec..
Fetching: rspec-support-3.1.2.gem (100%)
Fetching: rspec-core-3.1.7.gem (100%)
Fetching: diff-lcs-1.2.5.gem (100%)
Fetching: rspec-expectations-3.1.2.gem (100%)
Fetching: rspec-mocks-3.1.3.gem (100%)
Fetching: rspec-3.1.0.gem (100%)
Fetching: rspec-its-1.1.0.gem (100%)
Fetching: multi_json-1.10.1.gem (100%)
Fetching: net-ssh-2.9.1.gem (100%)
Fetching: net-scp-1.2.1.gem (100%)
Fetching: specinfra-2.11.2.gem (100%)
Fetching: serverspec-2.7.1.gem (100%)
-----> serverspec installed (version 2.7.1)
/tmp/busser/gems/gems/busser-0.6.2/lib/busser/ui.rb:58:in `run_ruby_script!': undefined method `success?' for nil:NilClass (NoMethodError)
        from /tmp/busser/gems/gems/busser-serverspec-0.5.3/lib/busser/runner_plugin/serverspec.rb:36:in `test'
        from /tmp/busser/gems/gems/thor-0.19.0/lib/thor/command.rb:27:in `run'
        from /tmp/busser/gems/gems/thor-0.19.0/lib/thor/invocation.rb:126:in `invoke_command'
        from /tmp/busser/gems/gems/thor-0.19.0/lib/thor/invocation.rb:133:in `block in invoke_all'
        from /tmp/busser/gems/gems/thor-0.19.0/lib/thor/invocation.rb:133:in `each'
        from /tmp/busser/gems/gems/thor-0.19.0/lib/thor/invocation.rb:133:in `map'
        from /tmp/busser/gems/gems/thor-0.19.0/lib/thor/invocation.rb:133:in `invoke_all'
        from /tmp/busser/gems/gems/thor-0.19.0/lib/thor/group.rb:232:in `dispatch'
        from /tmp/busser/gems/gems/thor-0.19.0/lib/thor/invocation.rb:115:in `invoke'
        from /tmp/busser/gems/gems/busser-0.6.2/lib/busser/command/test.rb:43:in `block in perform'
        from /tmp/busser/gems/gems/busser-0.6.2/lib/busser/command/test.rb:35:in `each'
        from /tmp/busser/gems/gems/busser-0.6.2/lib/busser/command/test.rb:35:in `perform'
        from /tmp/busser/gems/gems/thor-0.19.0/lib/thor/command.rb:27:in `run'
        from /tmp/busser/gems/gems/thor-0.19.0/lib/thor/invocation.rb:126:in `invoke_command'
        from /tmp/busser/gems/gems/thor-0.19.0/lib/thor/invocation.rb:133:in `block in invoke_all'
        from /tmp/busser/gems/gems/thor-0.19.0/lib/thor/invocation.rb:133:in `each'
        from /tmp/busser/gems/gems/thor-0.19.0/lib/thor/invocation.rb:133:in `map'
        from /tmp/busser/gems/gems/thor-0.19.0/lib/thor/invocation.rb:133:in `invoke_all'
        from /tmp/busser/gems/gems/thor-0.19.0/lib/thor/group.rb:232:in `dispatch'
        from /tmp/busser/gems/gems/thor-0.19.0/lib/thor/invocation.rb:115:in `invoke'
        from /tmp/busser/gems/gems/thor-0.19.0/lib/thor.rb:40:in `block in register'
        from /tmp/busser/gems/gems/thor-0.19.0/lib/thor/command.rb:27:in `run'
        from /tmp/busser/gems/gems/thor-0.19.0/lib/thor/invocation.rb:126:in `invoke_command'
        from /tmp/busser/gems/gems/thor-0.19.0/lib/thor.rb:359:in `dispatch'
        from /tmp/busser/gems/gems/thor-0.19.0/lib/thor/base.rb:440:in `start'
        from /tmp/busser/gems/gems/busser-0.6.2/bin/busser:8:in `<top (required)>'
        from /tmp/busser/gems/bin/busser:23:in `load'
        from /tmp/busser/gems/bin/busser:23:in `<main>'
>>>>>> Verify failed on instance <default-ubuntu-1204>.
>>>>>> Please see .kitchen/logs/default-ubuntu-1204.log for more details
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: SSH exited (1) for command: [sh -c 'BUSSER_ROOT="/tmp/busser" GEM_HOME="/tmp/busser/gems" GEM_PATH="/tmp/busser/gems" GEM_CACHE="/tmp/busser/g
ems/cache" ; export BUSSER_ROOT GEM_HOME GEM_PATH GEM_CACHE; sudo -E /tmp/busser/bin/busser test']
>>>>>> ----------------------
D      Verify failed on instance <default-ubuntu-1204>.
D      ------Exception-------
D      Class: Kitchen::InstanceFailure
D      Message: Verify failed on instance <default-ubuntu-1204>.  Please see .kitchen/logs/default-ubuntu-1204.log for more details
D      ---Nested Exception---
D      Class: Kitchen::ActionFailed
D      Message: SSH exited (1) for command: [sh -c 'BUSSER_ROOT="/tmp/busser" GEM_HOME="/tmp/busser/gems" GEM_PATH="/tmp/busser/gems" GEM_CACHE="/tmp/busser/gems/cache" ; export BUSSER_ROOT GEM_HOME GEM_PATH GEM_CACHE; sudo -E /tmp/busser/bin/busser test']
D      ------Backtrace-------
D      C:/Repos/_github/bills-kitchen/target/build/tools/chefdk/embedded/lib/ruby/gems/2.0.0/gems/test-kitchen-1.2.1/lib/kitchen/driver/ssh_base.rb:112:in `rescue in run_remote'
D      C:/Repos/_github/bills-kitchen/target/build/tools/chefdk/embedded/lib/ruby/gems/2.0.0/gems/test-kitchen-1.2.1/lib/kitchen/driver/ssh_base.rb:108:in `run_remote'
D      C:/Repos/_github/bills-kitchen/target/build/tools/chefdk/embedded/lib/ruby/gems/2.0.0/gems/test-kitchen-1.2.1/lib/kitchen/driver/ssh_base.rb:63:in `block in verify'
D      C:/Repos/_github/bills-kitchen/target/build/tools/chefdk/embedded/lib/ruby/gems/2.0.0/gems/test-kitchen-1.2.1/lib/kitchen/ssh.rb:47:in `initialize'
D      C:/Repos/_github/bills-kitchen/target/build/tools/chefdk/embedded/lib/ruby/gems/2.0.0/gems/test-kitchen-1.2.1/lib/kitchen/driver/ssh_base.rb:61:in `new'
D      C:/Repos/_github/bills-kitchen/target/build/tools/chefdk/embedded/lib/ruby/gems/2.0.0/gems/test-kitchen-1.2.1/lib/kitchen/driver/ssh_base.rb:61:in `verify'
D      C:/Repos/_github/bills-kitchen/target/build/tools/chefdk/embedded/lib/ruby/gems/2.0.0/gems/kitchen-vagrant-0.15.0/lib/kitchen/driver/vagrant.rb:85:in `verify'
D      C:/Repos/_github/bills-kitchen/target/build/tools/chefdk/embedded/lib/ruby/gems/2.0.0/gems/test-kitchen-1.2.1/lib/kitchen/instance.rb:273:in `public_send'
D      C:/Repos/_github/bills-kitchen/target/build/tools/chefdk/embedded/lib/ruby/gems/2.0.0/gems/test-kitchen-1.2.1/lib/kitchen/instance.rb:273:in `block in perform_action'
D      C:/Repos/_github/bills-kitchen/target/build/tools/chefdk/embedded/lib/ruby/gems/2.0.0/gems/test-kitchen-1.2.1/lib/kitchen/instance.rb:308:in `call'
D      C:/Repos/_github/bills-kitchen/target/build/tools/chefdk/embedded/lib/ruby/gems/2.0.0/gems/test-kitchen-1.2.1/lib/kitchen/instance.rb:308:in `synchronize_or_call'
D      C:/Repos/_github/bills-kitchen/target/build/tools/chefdk/embedded/lib/ruby/gems/2.0.0/gems/test-kitchen-1.2.1/lib/kitchen/instance.rb:283:in `block in action'
D      C:/Repos/_github/bills-kitchen/target/build/tools/chefdk/embedded/lib/ruby/2.0.0/benchmark.rb:281:in `measure'
D      C:/Repos/_github/bills-kitchen/target/build/tools/chefdk/embedded/lib/ruby/gems/2.0.0/gems/test-kitchen-1.2.1/lib/kitchen/instance.rb:282:in `action'
D      C:/Repos/_github/bills-kitchen/target/build/tools/chefdk/embedded/lib/ruby/gems/2.0.0/gems/test-kitchen-1.2.1/lib/kitchen/instance.rb:273:in `perform_action'
D      C:/Repos/_github/bills-kitchen/target/build/tools/chefdk/embedded/lib/ruby/gems/2.0.0/gems/test-kitchen-1.2.1/lib/kitchen/instance.rb:264:in `verify_action'
D      C:/Repos/_github/bills-kitchen/target/build/tools/chefdk/embedded/lib/ruby/gems/2.0.0/gems/test-kitchen-1.2.1/lib/kitchen/instance.rb:246:in `block in transition_to'                                                                                                                                                               
D      C:/Repos/_github/bills-kitchen/target/build/tools/chefdk/embedded/lib/ruby/gems/2.0.0/gems/test-kitchen-1.2.1/lib/kitchen/instance.rb:245:in `each'                   
D      C:/Repos/_github/bills-kitchen/target/build/tools/chefdk/embedded/lib/ruby/gems/2.0.0/gems/test-kitchen-1.2.1/lib/kitchen/instance.rb:245:in `transition_to'                                                                                                                                                                        
D      C:/Repos/_github/bills-kitchen/target/build/tools/chefdk/embedded/lib/ruby/gems/2.0.0/gems/test-kitchen-1.2.1/lib/kitchen/instance.rb:141:in `verify'                 
D      C:/Repos/_github/bills-kitchen/target/build/tools/chefdk/embedded/lib/ruby/gems/2.0.0/gems/test-kitchen-1.2.1/lib/kitchen/instance.rb:170:in `block in test'                                                                                                                                                                        
D      C:/Repos/_github/bills-kitchen/target/build/tools/chefdk/embedded/lib/ruby/2.0.0/benchmark.rb:281:in `measure'                                                        
D      C:/Repos/_github/bills-kitchen/target/build/tools/chefdk/embedded/lib/ruby/gems/2.0.0/gems/test-kitchen-1.2.1/lib/kitchen/instance.rb:166:in `test'                   
D      C:/Repos/_github/bills-kitchen/target/build/tools/chefdk/embedded/lib/ruby/gems/2.0.0/gems/test-kitchen-1.2.1/lib/kitchen/command.rb:109:in `public_send'                                                                                                                                                                           
D      C:/Repos/_github/bills-kitchen/target/build/tools/chefdk/embedded/lib/ruby/gems/2.0.0/gems/test-kitchen-1.2.1/lib/kitchen/command.rb:109:in `block (2 levels) in run_action'                                                                                                                                                        
D      ----------------------                                                                                                                                                

A subsequent kitchen verify works:

C:\Repos\_github\bills-kitchen\target\build\repo\vagrant-workflow-tests\playground\sample-toplevel-cookbook>bundle exec kitchen verify
-----> Starting Kitchen (v1.2.1)
-----> Verifying <default-ubuntu-1204>...
       Removing /tmp/busser/suites/serverspec
Uploading /tmp/busser/suites/serverspec/localhost/default_spec.rb (mode=0644)
Uploading /tmp/busser/suites/serverspec/spec_helper.rb (mode=0644)
-----> Running serverspec test suite
/opt/chef/embedded/bin/ruby -I/tmp/busser/suites/serverspec -I/tmp/busser/gems/gems/rspec-support-3.1.2/lib:/tmp/busser/gems/gems/rspec-core-3.1.7/lib /opt/chef/embedded/bin/rspec --pattern /tmp/busser/suites/serverspec/\*\*/\*_spec.rb --color --format documentation --default-path /tmp/busser/suites/serverspec

Package "apache2"
  should be installed

Service "apache2"
  should be enabled
  should be running

Port "80"
  should be listening

File "/var/www/sample.html"
  should be file
  should contain "I can haz cats!"

Finished in 0.11642 seconds (files took 0.29134 seconds to load)
6 examples, 0 failures
       Finished verifying <default-ubuntu-1204> (0m2.18s).
-----> Kitchen is finished. (0m5.43s)

Steps to reproduce:

  • git clone https://github.com/tknerr/sample-toplevel-cookbook.git
  • cd sample-toplevel-cookbook
  • git checkout 37ec35f7e3c43673d95eff556da455f12dcfdd1a
  • bundle install
  • rake integration or bundle exec kitchen test directly

Any ideas what the problem could be?

busser-serverspec plugin install fails because it can't resolve rspec.

Using the omnibus chef installer 11.4.4

sudo /opt/chef/embedded/bin/gem install busser
sudo /opt/chef/embedded/bin/busser setup
sudo /opt/chef/embedded/bin/busser plugin install busser-serverspec

results in

/opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/dependency_installer.rb:153:in `gather_dependencies': Unable to resolve dependencies: rspec requires rspec-core (~> 2.13.0), rspec-expectations (~> 2.13.0), rspec-mocks (~> 2.13.0) (Gem::DependencyError)
    from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/dependency_installer.rb:267:in `install'
    from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/busser-0.4.1/lib/busser/rubygems.rb:40:in `install_gem'
    from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/busser-0.4.1/lib/busser/command/plugin_install.rb:66:in `install_plugin_gem'
    from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/busser-0.4.1/lib/busser/command/plugin_install.rb:53:in `install'
    from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/busser-0.4.1/lib/busser/command/plugin_install.rb:43:in `block (2 levels) in install_all'
    from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/busser-0.4.1/lib/busser/command/plugin_install.rb:43:in `each'
    from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/busser-0.4.1/lib/busser/command/plugin_install.rb:43:in `block in install_all'
    from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/busser-0.4.1/lib/busser/rubygems.rb:67:in `silence_gem_ui'
    from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/busser-0.4.1/lib/busser/command/plugin_install.rb:42:in `install_all'
    from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/command.rb:27:in `run'
    from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/invocation.rb:120:in `invoke_command'
    from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/invocation.rb:127:in `block in invoke_all'
    from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/invocation.rb:127:in `each'
    from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/invocation.rb:127:in `map'
    from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/invocation.rb:127:in `invoke_all'
    from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/group.rb:233:in `dispatch'
    from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/invocation.rb:109:in `invoke'
    from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor.rb:43:in `block in register'
    from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/command.rb:27:in `run'
    from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/invocation.rb:120:in `invoke_command'
    from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor.rb:363:in `dispatch'
    from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/invocation.rb:109:in `invoke'
    from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor.rb:232:in `block in subcommand'
    from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/command.rb:27:in `run'
    from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/invocation.rb:120:in `invoke_command'
    from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor.rb:363:in `dispatch'
    from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/base.rb:439:in `start'
    from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/busser-0.4.1/bin/busser:8:in `<top (required)>'
    from /opt/chef/embedded/bin/busser:23:in `load'
    from /opt/chef/embedded/bin/busser:23:in `<main>'

Problem bootstrapping via test-kitchen

Hi there,

When I try to run some serverspec via test-kitchen, it fails when trying to install serverspec in the post install action. This happens on a CentOS 6.5 VM running Chef 11.8.2. Here the relevant part of the log:

       /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:312:in `ensure_dependency': rspec-mocks requires rspec-support (= 3.0.0.beta1) (Gem::InstallError)
        from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:565:in `block in ensure_dependencies_met'
        from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:564:in `each'
        from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:564:in `ensure_dependencies_met'
        from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:759:in `pre_install_checks'
        from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:213:in `install'
        from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/request_set.rb:142:in `block in install'
        from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/request_set.rb:126:in `each'
        from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/request_set.rb:126:in `install'
        from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/dependency_installer.rb:389:in `install'
        from /tmp/busser/gems/gems/busser-0.6.0/lib/busser/rubygems.rb:44:in `install_gem'
        from /tmp/busser/gems/gems/busser-0.6.0/lib/busser/helpers.rb:57:in `install_gem'
        from /tmp/busser/gems/gems/busser-serverspec-0.2.6/lib/busser/runner_plugin/serverspec.rb:27:in `block in <class:Serverspec>'
        from /tmp/busser/gems/gems/thor-0.18.1/lib/thor/command.rb:27:in `run'

I tried to replicate manually but it must not be equivalent to what's in the code because it installed 2.x series and all went well. I used this command:

sh -c 'BUSSER_ROOT="/tmp/busser" GEM_HOME="/tmp/busser/gems" GEM_PATH="/tmp/busser/gems" GEM_CACHE="/tmp/busser/gems/cache" ; export BUSSER_ROOT GEM_HOME GEM_PATH GEM_CACHE; gem install serverspec'

How could I debug that further?

Regards,
Matt

Update breaks serverspec. Requires a /home/spec directory?

When running kitchen-verify I get the following:

Running serverspec test suite
       /opt/chef/embedded/bin/ruby -I/tmp/busser/suites/serverspec -I/tmp/busser/gems/gems/rspec-support-3.1.1/lib:/tmp/busser/gems/gems/rspec-core-3.1.5/lib /opt/chef/embedded/bin/rspec --pattern /tmp/busser/suites/serverspec/\*\*/\*_spec.rb --color --format documentation
       /tmp/busser/gems/gems/rspec-core-3.1.5/lib/rspec/core/configuration.rb:1105:in `load': cannot load such file -- /root/spec (LoadError)
        from /tmp/busser/gems/gems/rspec-core-3.1.5/lib/rspec/core/configuration.rb:1105:in `block in load_spec_files'
        from /tmp/busser/gems/gems/rspec-core-3.1.5/lib/rspec/core/configuration.rb:1105:in `each'
        from /tmp/busser/gems/gems/rspec-core-3.1.5/lib/rspec/core/configuration.rb:1105:in `load_spec_files'
        from /tmp/busser/gems/gems/rspec-core-3.1.5/lib/rspec/core/runner.rb:96:in `setup'
        from /tmp/busser/gems/gems/rspec-core-3.1.5/lib/rspec/core/runner.rb:84:in `run'
        from /tmp/busser/gems/gems/rspec-core-3.1.5/lib/rspec/core/runner.rb:69:in `run'
        from /tmp/busser/gems/gems/rspec-core-3.1.5/lib/rspec/core/runner.rb:37:in `invoke'
        from /tmp/busser/gems/gems/rspec-core-3.1.5/exe/rspec:4:in `<top (required)>'
        from /opt/chef/embedded/bin/rspec:23:in `load'
        from /opt/chef/embedded/bin/rspec:23:in `<main>'
       /opt/chef/embedded/bin/ruby -I/tmp/busser/suites/serverspec -I/tmp/busser/gems/gems/rspec-support-3.1.1/lib:/tmp/busser/gems/gems/rspec-core-3.1.5/lib /opt/chef/embedded/bin/rspec --pattern /tmp/busser/suites/serverspec/\*\*/\*_spec.rb --color --format documentation failed

Notice no spec folder specified and missing dependencies:

/tmp/busser/gems/gems/rspec-core-3.1.5/lib/rspec/core/configuration.rb:1105:in `load': cannot load such file -- /root/spec (LoadError)

If I added all of the dependencies and an existing directory (/tmp) for rspec to the previous command manually:

/opt/chef/embedded/bin/ruby -I/tmp/busser/suites/serverspec:/tmp/busser/gems/gems/rspec-support-3.1.1/lib:/tmp/busser/gems/gems/rspec-core-3.1.5/lib:/tmp/busser/gems/gems/serverspec-2.1.0/lib:/tmp/busser/gems/gems/specinfra-2.1.0/lib:/tmp/busser/gems/gems/net-scp-1.2.1/lib:/tmp/busser/gems/gems/rspec-its-1.0.1/lib:/tmp/busser/gems/gems/rspec-mocks-3.1.2/lib/ /opt/chef/embedded/bin/rspec /tmp --pattern /tmp/busser/suites/serverspec/\*\*/\*_spec.rb --color --format documentation

Everything ran without problems and my tests passed.

Another thing I found is that if I just do kitchen login and mkdir ~/spec and then run kitchen verify it also passes.

Should something be done so that needing the spec directory is not needed?

busser-serverspec cannot run against chef 11

I have an older installation of Chef 11 I support on Oracle Enterprise Linux 6.4. My test kitchen tests recently stopped working because of the following issue:

       Installing Busser plugins: busser-serverspec
       /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:388:in `ensure_required_ruby_version_met': rake requires Ruby version >= 2.0.0. (Gem::InstallError)
       	from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:156:in `install'
       	from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/dependency_installer.rb:297:in `block in install'
       	from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/dependency_installer.rb:270:in `each'
       	from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/dependency_installer.rb:270:in `each_with_index'
       	from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/dependency_installer.rb:270:in `install'
       	from /tmp/verifier/gems/gems/busser-0.7.1/lib/busser/rubygems.rb:44:in `install_gem'
       	from /tmp/verifier/gems/gems/busser-0.7.1/lib/busser/command/plugin_install.rb:66:in `install_plugin_gem'
       	from /tmp/verifier/gems/gems/busser-0.7.1/lib/busser/command/plugin_install.rb:53:in `install'
       	from /tmp/verifier/gems/gems/busser-0.7.1/lib/busser/command/plugin_install.rb:43:in `block (2 levels) in install_all'
       	from /tmp/verifier/gems/gems/busser-0.7.1/lib/busser/command/plugin_install.rb:43:in `each'
       	from /tmp/verifier/gems/gems/busser-0.7.1/lib/busser/command/plugin_install.rb:43:in `block in install_all'
       	from /tmp/verifier/gems/gems/busser-0.7.1/lib/busser/rubygems.rb:71:in `silence_gem_ui'
       	from /tmp/verifier/gems/gems/busser-0.7.1/lib/busser/command/plugin_install.rb:42:in `install_all'
       	from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/command.rb:27:in `run'
       	from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:126:in `invoke_command'
       	from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:133:in `block in invoke_all'
       	from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:133:in `each'
       	from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:133:in `map'
       	from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:133:in `invoke_all'
       	from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/group.rb:232:in `dispatch'
       	from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:115:in `invoke'
       	from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor.rb:40:in `block in register'
       	from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/command.rb:27:in `run'
       	from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:126:in `invoke_command'
       	from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor.rb:359:in `dispatch'
       	from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:115:in `invoke'
       	from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor.rb:235:in `block in subcommand'
       	from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/command.rb:27:in `run'
       	from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:126:in `invoke_command'
       	from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor.rb:359:in `dispatch'
       	from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/base.rb:440:in `start'
       	from /tmp/verifier/gems/gems/busser-0.7.1/bin/busser:8:in `<top (required)>'
       	from /tmp/verifier/bin/busser:23:in `load'
       	from /tmp/verifier/bin/busser:23:in `<main>'

Is it possible to pin rake to an older version for ruby 1.9.1?

configure serverspec rspec options, ruby_opts and pattern

I would like to be able to configure the rspec_opts, ruby_ops and pattern as in the following code snippet. There are different standards for specifying rspec files. specifically ansible_spec puts then in a different place. It would be good if this was configurable so folks are not forced to put them in test/integration/...

t.rspec_path = rspec_bin if rspec_bin
t.rspec_opts = [
'--color',
'--format documentation',
"--default-path #{base_path}",
]
t.ruby_opts = "-I#{base_path}"
t.pattern = "#{base_path}/*_/__spec.rb"

If i knew how to configure a busser plugin then i could write a PR request

Unable to override rspec_opts

It seems that there's way to override rspec_opts. By default it is running with "--color" and "--format documentation".

Is there a way to disable color and execute in format json and documentation?

I've tried adding a .rspec file in the test directory but Test Kitchen doesn't pick that up. I've also tried to move the .rspec file into suite/serverspec directory and still the busser is running with --color and --format documentation.

Any ideas how to disable the color and format it in json and documentation?

Thanks!

All tests fail with NoMethodError: undefined method `[]' for nil:NilClass

I'm running Test-Kitchen with serverspec against a centos 6.5 target on Amazon using the ec2-driver.

All my tests pass when I set my backend to :exec, but all fail with the following error when I use an :ssh backend.

            NoMethodError:
              undefined method `[]' for nil:NilClass

In the .kitchen/logs/default-devtestnet.log all the tests fail with the following stacktrace:

I, [2015-07-06T09:31:04.606545 #27974]  INFO -- default-devtestnet:   22) Service "httpd" should be enabled
I, [2015-07-06T09:31:04.606560 #27974]  INFO -- default-devtestnet:       ESC[31mFailure/Error: it { should be_enabled }ESC[0m
I, [2015-07-06T09:31:04.606574 #27974]  INFO -- default-devtestnet:       ESC[31mNoMethodError:ESC[0m
I, [2015-07-06T09:31:04.606588 #27974]  INFO -- default-devtestnet:       ESC[31m  undefined method `[]' for nil:NilClassESC[0m
I, [2015-07-06T09:31:04.606602 #27974]  INFO -- default-devtestnet:       ESC[36m# /tmp/verifier/gems/gems/specinfra-2.36.14/lib/specinfra/backend/ssh.rb:174:in `sudo?'ESC[0m
I, [2015-07-06T09:31:04.621094 #27974]  INFO -- default-devtestnet:
I, [2015-07-06T09:31:04.621143 #27974]  INFO -- default-devtestnet:       ESC[36m# /tmp/verifier/gems/gems/specinfra-2.36.14/lib/specinfra/backend/ssh.rb:10:in `run_command'ESC[0m
I, [2015-07-06T09:31:04.621182 #27974]  INFO -- default-devtestnet:       ESC[36m# /tmp/verifier/gems/gems/specinfra-2.36.14/lib/specinfra/runner.rb:27:in `run'ESC[0m
I, [2015-07-06T09:31:04.621204 #27974]  INFO -- default-devtestnet:       ESC[36m# /tmp/verifier/gems/gems/specinfra-2.36.14/lib/specinfra/runner.rb:13:in `method_missing'ESC[0m
I, [2015-07-06T09:31:04.621222 #27974]  INFO -- default-devtestnet:       ESC[36m# /tmp/verifier/gems/gems/serverspec-2.19.0/lib/serverspec/type/service.rb:7:in `enabled?'ESC[0m
I, [2015-07-06T09:31:04.621240 #27974]  INFO -- default-devtestnet:       ESC[36m# /tmp/verifier/gems/gems/serverspec-2.19.0/lib/serverspec/matcher/be_enabled.rb:4:in `block (2 levels) in <top (required)>'ESC[0m
I, [2015-07-06T09:31:04.621256 #27974]  INFO -- default-devtestnet:       ESC[36m# /tmp/verifier/suites/serverspec/default_spec.rb:12:in `block (2 levels) in <top (required)>'
ESC[0m

Here is some more info from the .kitchen/logs/default-devtestnet.log if it's helpful at all.

I, [2015-07-06T09:31:04.623546 #27974]  INFO -- default-devtestnet:
I, [2015-07-06T09:31:04.623747 #27974]  INFO -- default-devtestnet: /opt/chef/embedded/bin/ruby -I/tmp/verifier/suites/serverspec -I/tmp/verifier/gems/gems/rspec-support-3.3.0/lib:/tmp/verifier/gems/gems/rspec-core-3.3.1/lib /opt/chef/embedded/bin/rspec --pattern /tmp/verifier/suites/serverspec/\*\*/\*_spec.rb --color --format documentation --default-path /tmp/verifier/suites/serverspec failed
I, [2015-07-06T09:31:04.623892 #27974]  INFO -- default-devtestnet: !!!!!! Ruby Script [/tmp/verifier/gems/gems/busser-serverspec-0.5.7/lib/busser/runner_plugin/../serverspec/runner.rb /tmp/verifier/suites/serverspec] exit code was 1
E, [2015-07-06T09:31:04.624819 #27974] ERROR -- default-devtestnet: Verify failed on instance <default-devtestnet>.
E, [2015-07-06T09:31:04.624905 #27974] ERROR -- default-devtestnet: ------Exception-------
E, [2015-07-06T09:31:04.624925 #27974] ERROR -- default-devtestnet: Class: Kitchen::ActionFailed
E, [2015-07-06T09:31:04.624938 #27974] ERROR -- default-devtestnet: Message: SSH exited (1) for command: [sh -c '

BUSSER_ROOT="/tmp/verifier"; export BUSSER_ROOT
GEM_HOME="/tmp/verifier/gems"; export GEM_HOME
GEM_PATH="/tmp/verifier/gems"; export GEM_PATH
GEM_CACHE="/tmp/verifier/gems/cache"; export GEM_CACHE

sudo -E /tmp/verifier/bin/busser test
']
E, [2015-07-06T09:31:04.624951 #27974] ERROR -- default-devtestnet: ---Nested Exception---
E, [2015-07-06T09:31:04.624972 #27974] ERROR -- default-devtestnet: Class: Kitchen::Transport::SshFailed
E, [2015-07-06T09:31:04.624984 #27974] ERROR -- default-devtestnet: Message: SSH exited (1) for command: [sh -c '

BUSSER_ROOT="/tmp/verifier"; export BUSSER_ROOT
GEM_HOME="/tmp/verifier/gems"; export GEM_HOME
GEM_PATH="/tmp/verifier/gems"; export GEM_PATH
GEM_CACHE="/tmp/verifier/gems/cache"; export GEM_CACHE

sudo -E /tmp/verifier/bin/busser test
']
E, [2015-07-06T09:31:04.624995 #27974] ERROR -- default-devtestnet: ------Backtrace-------
E, [2015-07-06T09:31:04.625006 #27974] ERROR -- default-devtestnet: /Users/Phil/.rvm/gems/ruby-2.0.0-p643/gems/test-kitchen-1.4.0/lib/kitchen/verifier/base.rb:79:in `rescue in call'
E, [2015-07-06T09:31:04.625018 #27974] ERROR -- default-devtestnet: /Users/Phil/.rvm/gems/ruby-2.0.0-p643/gems/test-kitchen-1.4.0/lib/kitchen/verifier/base.rb:82:in `call'
E, [2015-07-06T09:31:04.625030 #27974] ERROR -- default-devtestnet: /Users/Phil/.rvm/gems/ruby-2.0.0-p643/gems/test-kitchen-1.4.0/lib/kitchen/instance.rb:398:in `block in verify_action'
E, [2015-07-06T09:31:04.625041 #27974] ERROR -- default-devtestnet: /Users/Phil/.rvm/gems/ruby-2.0.0-p643/gems/test-kitchen-1.4.0/lib/kitchen/instance.rb:488:in `call'
E, [2015-07-06T09:31:04.625052 #27974] ERROR -- default-devtestnet: /Users/Phil/.rvm/gems/ruby-2.0.0-p643/gems/test-kitchen-1.4.0/lib/kitchen/instance.rb:488:in `synchronize_or_call'
E, [2015-07-06T09:31:04.625063 #27974] ERROR -- default-devtestnet: /Users/Phil/.rvm/gems/ruby-2.0.0-p643/gems/test-kitchen-1.4.0/lib/kitchen/instance.rb:453:in `block in action'
E, [2015-07-06T09:31:04.625075 #27974] ERROR -- default-devtestnet: /Users/Phil/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/benchmark.rb:281:in `measure'
E, [2015-07-06T09:31:04.625096 #27974] ERROR -- default-devtestnet: /Users/Phil/.rvm/gems/ruby-2.0.0-p643/gems/test-kitchen-1.4.0/lib/kitchen/instance.rb:452:in `action'
E, [2015-07-06T09:31:04.625109 #27974] ERROR -- default-devtestnet: /Users/Phil/.rvm/gems/ruby-2.0.0-p643/gems/test-kitchen-1.4.0/lib/kitchen/instance.rb:394:in `verify_action'
E, [2015-07-06T09:31:04.625121 #27974] ERROR -- default-devtestnet: /Users/Phil/.rvm/gems/ruby-2.0.0-p643/gems/test-kitchen-1.4.0/lib/kitchen/instance.rb:341:in `block in transition_to'
E, [2015-07-06T09:31:04.625134 #27974] ERROR -- default-devtestnet: /Users/Phil/.rvm/gems/ruby-2.0.0-p643/gems/test-kitchen-1.4.0/lib/kitchen/instance.rb:340:in `each'
E, [2015-07-06T09:31:04.625146 #27974] ERROR -- default-devtestnet: /Users/Phil/.rvm/gems/ruby-2.0.0-p643/gems/test-kitchen-1.4.0/lib/kitchen/instance.rb:340:in `transition_to'
E, [2015-07-06T09:31:04.625159 #27974] ERROR -- default-devtestnet: /Users/Phil/.rvm/gems/ruby-2.0.0-p643/gems/test-kitchen-1.4.0/lib/kitchen/instance.rb:160:in `verify'
E, [2015-07-06T09:31:04.625180 #27974] ERROR -- default-devtestnet: /Users/Phil/.rvm/gems/ruby-2.0.0-p643/gems/test-kitchen-1.4.0/lib/kitchen/command.rb:176:in `public_send'
E, [2015-07-06T09:31:04.625194 #27974] ERROR -- default-devtestnet: /Users/Phil/.rvm/gems/ruby-2.0.0-p643/gems/test-kitchen-1.4.0/lib/kitchen/command.rb:176:in `block (2 levels) in run_action'
E, [2015-07-06T09:31:04.625207 #27974] ERROR -- default-devtestnet: ----------------------

Here is the relevant version info:
My host is OSX Yosemite 10.10.4.

Test Kitchen version 1.4.0
kitchen-ansible (0.0.16)
kitchen-cfengine (0.0.5)
kitchen-ec2 (0.9.4)
kitchen-openstack (1.8.0)
kitchen-vagrant (0.18.0)

Rake dependency missing for older rubies

The serverspec runner requires rake [1] which is not part of ruby on systems like Centos 7. I just ran some tests, not using chef, and stumbled over that problem:

       Transferring files to <default-centos-7>
-----> Running serverspec test suite
-----> Installing Serverspec..
Fetching: rspec-support-3.2.2.gem (100%)
Fetching: rspec-core-3.2.3.gem (100%)
Fetching: diff-lcs-1.2.5.gem (100%)
Fetching: rspec-expectations-3.2.1.gem (100%)
Fetching: rspec-mocks-3.2.1.gem (100%)
Fetching: rspec-3.2.0.gem (100%)
Fetching: rspec-its-1.2.0.gem (100%)
Fetching: multi_json-1.11.0.gem (100%)
Fetching: net-ssh-2.9.2.gem (100%)
Fetching: net-scp-1.2.1.gem (100%)
Fetching: specinfra-2.34.4.gem (100%)
Fetching: serverspec-2.17.0.gem (100%)
-----> serverspec installed (version 2.17.0)
       /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- rake (LoadError)
        from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'

       !!!!!! Ruby Script [/tmp/verifier/gems/gems/busser-serverspec-0.5.6/lib/busser/runner_plugin/../serverspec/runner.rb /tmp/verifier/suites/serverspec] exit code was 1
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: Failed to complete #verify action: [Expected process to exit with [0], but received '1'
---- Begin output of docker exec -t f3ced5c6ed9537bf5279a07596d9c7e6292c7fc551797c563f902cbb441f8b34 sh -c '

BUSSER_ROOT="/tmp/verifier"; export BUSSER_ROOT
GEM_HOME="/tmp/verifier/gems"; export GEM_HOME
GEM_PATH="/tmp/verifier/gems"; export GEM_PATH
GEM_CACHE="/tmp/verifier/gems/cache"; export GEM_CACHE

sudo -E /tmp/verifier/bin/busser test
' ----
STDOUT: -----> Running serverspec test suite
-----> Installing Serverspec..
Fetching: rspec-support-3.2.2.gem (100%)
Fetching: rspec-core-3.2.3.gem (100%)
Fetching: diff-lcs-1.2.5.gem (100%)
Fetching: rspec-expectations-3.2.1.gem (100%)
Fetching: rspec-mocks-3.2.1.gem (100%)
Fetching: rspec-3.2.0.gem (100%)
Fetching: rspec-its-1.2.0.gem (100%)
Fetching: multi_json-1.11.0.gem (100%)
Fetching: net-ssh-2.9.2.gem (100%)
Fetching: net-scp-1.2.1.gem (100%)
Fetching: specinfra-2.34.4.gem (100%)
Fetching: serverspec-2.17.0.gem (100%)
-----> serverspec installed (version 2.17.0)
/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- rake (LoadError)
    from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /tmp/verifier/gems/gems/busser-serverspec-0.5.6/lib/busser/runner_plugin/../serverspec/runner.rb:20:in `<main>'
!!!!!! Ruby Script [/tmp/verifier/gems/gems/busser-serverspec-0.5.6/lib/busser/runner_plugin/../serverspec/runner.rb /tmp/verifier/suites/serverspec] exit code was 1
STDERR: 
---- End output of docker exec -t f3ced5c6ed9537bf5279a07596d9c7e6292c7fc551797c563f902cbb441f8b34 sh -c '

BUSSER_ROOT="/tmp/verifier"; export BUSSER_ROOT
GEM_HOME="/tmp/verifier/gems"; export GEM_HOME
GEM_PATH="/tmp/verifier/gems"; export GEM_PATH
GEM_CACHE="/tmp/verifier/gems/cache"; export GEM_CACHE

sudo -E /tmp/verifier/bin/busser test
' ----
Ran docker exec -t f3ced5c6ed9537bf5279a07596d9c7e6292c7fc551797c563f902cbb441f8b34 sh -c '

BUSSER_ROOT="/tmp/verifier"; export BUSSER_ROOT
GEM_HOME="/tmp/verifier/gems"; export GEM_HOME
GEM_PATH="/tmp/verifier/gems"; export GEM_PATH
GEM_CACHE="/tmp/verifier/gems/cache"; export GEM_CACHE

sudo -E /tmp/verifier/bin/busser test
' returned 1]
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

My kitchen.yml has "ruby_bindir: /usr/bin" and in my docker container ruby is:

[root@f3ced5c6ed95 /]# ruby --version
ruby 2.0.0p598 (2014-11-13) [x86_64-linux]

Installing rake on the system "yum install rubygems-rake", unsetting GEM_PATH und GEM_CACHE and running "/tmp/verifier/gems/bin/busser test" works perfectly fine.

EDIT: Also happens with Fedora 22, so it seems to be a general problem with Rhel derivates. It works perfectly fine on Debian 8 and Ubuntu 15.04.

EDIT2: I just tried minitest which gives the same results. Working on Debian/Ubuntu. Fails on Fedora/CentOS

STDOUT: -----> Running minitest test suite
/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- rake/testtask (LoadError)
    from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /tmp/verifier/gems/gems/busser-minitest-0.3.0/lib/busser/runner_plugin/../minitest/runner.rb:20:in `<main>'
!!!!!! Ruby Script [/tmp/verifier/gems/gems/busser-minitest-0.3.0/lib/busser/runner_plugin/../minitest/runner.rb /tmp/verifier/suites/minitest] exit code was 1

[1] https://github.com/test-kitchen/busser-serverspec/blob/master/lib/busser/serverspec/runner.rb#L20

Tidy up failure messages

If an assertion fails, we get a rather ugly stack dump:

-----> Running serverspec test suite
       /opt/chef/embedded/bin/ruby -I/opt/busser/suites/serverspec -S /opt/chef/embedded/bin/rspec /opt/busser/suites/serverspec/localhost/pound_spec.rb
       F

       Failures:

         1) Package "Pound"
            Failure/Error: it { should be_installed }
       rpm -q Pound
       package Pound is not installed
            # /opt/busser/suites/serverspec/localhost/pound_spec.rb:3:in `block (2 levels) in <top (required)>'

       Finished in 0.01938 seconds
       1 example, 1 failure

       Failed examples:

       rspec /opt/busser/suites/serverspec/localhost/pound_spec.rb:3 # Package "Pound"
       /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/rspec-core-2.13.1/lib/rspec/core/rake_task.rb:156:in `run_task': /opt/chef/embedded/bin/ruby -I/opt/busser/suites/serverspec -S /opt/chef/embedded/bin/rspec /opt/busser/suites/serverspec/localhost/pound_spec.rb failed (RuntimeError)
        from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/rspec-core-2.13.1/lib/rspec/core/rake_task.rb:124:in `block (2 levels) in initialize'
        from /opt/chef/embedded/lib/ruby/1.9.1/rake/file_utils_ext.rb:60:in `verbose'
        from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/rspec-core-2.13.1/lib/rspec/core/rake_task.rb:122:in `block in initialize'
        from /opt/chef/embedded/lib/ruby/1.9.1/rake/task.rb:205:in `call'
        from /opt/chef/embedded/lib/ruby/1.9.1/rake/task.rb:205:in `block in execute'
        from /opt/chef/embedded/lib/ruby/1.9.1/rake/task.rb:200:in `each'
        from /opt/chef/embedded/lib/ruby/1.9.1/rake/task.rb:200:in `execute'
        from /opt/chef/embedded/lib/ruby/1.9.1/rake/task.rb:158:in `block in invoke_with_call_chain'
        from /opt/chef/embedded/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
        from /opt/chef/embedded/lib/ruby/1.9.1/rake/task.rb:151:in `invoke_with_call_chain'
        from /opt/chef/embedded/lib/ruby/1.9.1/rake/task.rb:144:in `invoke'
        from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/busser-serverspec-0.1.1/lib/busser/runner_plugin/../serverspec/runner.rb:34:in `<main>'
       Ruby Script[/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/busser-serverspec-0.1.1/lib/busser/runner_plugin/../serverspec/runner.rb /opt/busser/suites/serverspec] exit code was 1

It would be much better to hide the stack trace. By contrast:

-----> Running rspec test suite
       [2013-06-14T21:45:14+00:00] INFO: Run List is []
       [2013-06-14T21:45:14+00:00] INFO: Run List expands to []
       Recipe: (chef-apply cookbook)::(chef-apply recipe)
         * execute[bundle install --local || bundle install] action run[2013-06-14T21:45:14+00:00] INFO: Processing execute[bundle install --local || bundle install] action run ((chef-apply cookbook)::(chef-apply recipe) line 42)
        (skipped due to only_if)
F

       Failures:

         1) silly should fail on account of silliness
            Failure/Error: expect(File.exists?("/bin/bogus")).to be_true
       expected: true value
            got: false
            # ./pound_spec.rb:3:in `block (2 levels) in <top (required)>'

       Finished in 0.00269 seconds
       1 example, 1 failure

       Failed examples:

       rspec ./pound_spec.rb:2 # silly should fail on account of silliness
       Ruby Script[/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/busser-rspec-0.7.0/lib/busser/rspec/runner.rb -I /opt/busser/suites/rspec -I /opt/busser/suites/rspec/lib /opt/busser/suites/rspec] exit code was 1

No output present in command().stdout and SSH exited (1)

My integration test is not stable because sometime all tests are passing but sometimes one or two fails. The error message shows that there was not output from command().stdout and the kitchen verify exited.

My kitchen verify fails with

Failure/Error: expect(cmd).to match 'Cache-Control: max-age=86400'
expected "" to match "200 OK"

 >>>>>> ------Exception-------
 >>>>>> Class: Kitchen::ActionFailed
 >>>>>> Message: SSH exited (1) for command: [sh -c '

BUSSER_ROOT="/tmp/verifier"; export BUSSER_ROOT
GEM_HOME="/tmp/verifier/gems"; export GEM_HOME
GEM_PATH="/tmp/verifier/gems"; export GEM_PATH
GEM_CACHE="/tmp/verifier/gems/cache"; export GEM_CACHE

My Integration Test has:

context 'some test group' do
before do
  command("sudo mkdir -p #{path}").stdout
  command("sudo touch #{path}test.txt #{path}test.js ").stdout
end

after(:all) do
  command('sudo rm -rf some-file').stdout
end

it 'serves files in its directory' do
  expect(command('curl -I some-url').stdout).to match '200 OK'
end

it 'does not serve directories in its hosted assets directory' do
  expect(command('curl -I some-url').stdout).to match '403 Forbidden'
end
end

Gemfile not used on first run / fail on subsequent runs.

Noticed that the Gemfile isn't being used on the very first run. We're using chefdk and test_kitchen ec2 driver. On a fresh run of 'kitchen verify', it spins up the instance, converges, then moves to busser and fails, in our case, trying to install the latest serverspec. (afaict).

Subsequent runs attempt to run "bundle install --gemfile ..." but raise "sh: bundle: command not found"

Formal request to take over maintenance

Since this project could use a little love, I would like to formally request to take over maintenance duties. I probably am the last major hold-out on Serverspec in whatever passes for the Kitchen core team, and will remain a such for the foreseeable future as InSpec doesn't offer the RSpec goop I use a lot of.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.