Test-Kitchen running cookbook features


#1

Hi Chefs,

I have been trying out test-kitchen and was able to get everything to work
except the cucumber features. It seems like test-kitchen ignores these files. I
do see the full build as well as mini-test results but nothing about the
cucumber features.

I even tried testing the mysql cookbook, which once tweaked to run properly,
only seemed to showed mini-test results.

Could I be doing something wrong or is there something I am missing?


#2

Just so anyone else attempting this won’t go crazy.

First thing is that in order to run feature/cucumber tests you must specify
the ‘runtimes’ property. It would be nice if this was documented along side
the doc for adding these tests, or this was an example showing this.
Currently it is only documented alongside the runtimes property in text I
would love to have bolded ‘The default for cookbook projects is [], which
effectively disables spec/feature tests.’ I managed to glance over this for
quite sometime because I didn’t think runtimes applied to me.

Next issue is the mysql/apache2 cookbooks which the doc mentions as
examples, don’t specify the runtimes property in their Kitchenfile even
though they have many cucumber tests written. Although this is very
confusing there is actually a good reason for this. The boxes provided by
opscode do not have rvm installed on them which is required in order to use
the runtimes property. So if you want to use feature/cucumber tests with
your cookbooks you will have to roll your own vagrant box(es). It should
also be noted that there are issues at the time of writing this with the
mysql cookbook and its tests (had to turn off lint testing and add
attributes to the ‘test’ cookbook to get it all to run).

The next issue I had was this bug[1] I found. If you specify your runtimes
below your configuration like this,

cookbook “my-cookbook” do
configuration "default"
runtimes [“ruby-1.9.3-p286”]
end

the feature/cucumber tests will not be run. You currently must specify your
runtimes above any configuration.

On a side note I also ran into an issue when setting up my box. I had first
installed Chef via omnibus installer[2]. I then installed rvm using the
single user installation. This then caused my chef-solo/chef-client
binaries to fail as they could not find the chef gem any longer. Not sure
if this is an issue with the omnibus installation or something I did. I got
around this by just installing chef into my rvm ruby as well.

[1] - http://tickets.opscode.com/browse/KITCHEN-47
[2] - http://www.opscode.com/chef/install/

On Mon, Nov 5, 2012 at 4:55 PM, bjbq4d@gmail.com wrote:

Hi Chefs,

I have been trying out test-kitchen and was able to get everything to work
except the cucumber features. It seems like test-kitchen ignores these
files. I
do see the full build as well as mini-test results but nothing about the
cucumber features.

I even tried testing the mysql cookbook, which once tweaked to run
properly,
only seemed to showed mini-test results.

Could I be doing something wrong or is there something I am missing?


-Bryan