It looks like you're attempting to test on your own machine - this will be a problem. We generally use Vagrant virtual machines to test our cookbooks.
The reason your cookbook is not found is because the cookbook_path attribute in your machines Knife config does not contain the path to the cookbook you are testing.
Berkshelf will automatically make the cookbooks acailable to your Vagrant VM so you could run your specs within the Vagrant VM.
There is also the Test-Kitchen approach which I would recommend you looking into!
You're correct, I am trying to run it on my own machine.
I'm definitely going to have a look into Test Kitchen (it's in my to-learn list), but I was trying to start small to learn incrementally. I can write simple cookbooks, LWRPs, etc, and TDD is my current step.
What's the best approach to running chefspec inside the Vagrant VM?
I'm guessing:
vagrant ssh
cd /vagrant
rspec
But that's not very CI-friendly. Is there some less manual way?
Thanks!
Cassiano
--
Cassiano Leal
On Monday, November 19, 2012 at 12:21, Jamie Winsor wrote:
Hey Cassiano,
It looks like you're attempting to test on your own machine - this will be a problem. We generally use Vagrant virtual machines to test our cookbooks.
The reason your cookbook is not found is because the cookbook_path attribute in your machines Knife config does not contain the path to the cookbook you are testing.
Berkshelf will automatically make the cookbooks acailable to your Vagrant VM so you could run your specs within the Vagrant VM.
There is also the Test-Kitchen approach which I would recommend you looking into!
You're correct, I am trying to run it on my own machine.
I'm definitely going to have a look into Test Kitchen (it's in my to-learn list), but I was trying to start small to learn incrementally. I can write simple cookbooks, LWRPs, etc, and TDD is my current step.
What's the best approach to running chefspec inside the Vagrant VM?
I'm guessing:
vagrant ssh
cd /vagrant
rspec
But that's not very CI-friendly. Is there some less manual way?
Thanks!
Cassiano
--
Cassiano Leal
On Monday, November 19, 2012 at 12:21, Jamie Winsor wrote:
Hey Cassiano,
It looks like you're attempting to test on your own machine - this will be a problem. We generally use Vagrant virtual machines to test our cookbooks.
The reason your cookbook is not found is because the cookbook_path attribute in your machines Knife config does not contain the path to the cookbook you are testing.
Berkshelf will automatically make the cookbooks acailable to your Vagrant VM so you could run your specs within the Vagrant VM.
There is also the Test-Kitchen approach which I would recommend you looking into!