- From: Bryan Baugher <
>
- To:
- Subject: [chef] Re: Test-Kitchen running cookbook features
- Date: Mon, 12 Nov 2012 11:08:17 -0600
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.
Archive powered by MHonArc 2.6.16.