ChefSpec: ServerRunner vs. SoloRunner


#1

I'm a bit green when it comes to Chef unit testing, but I have a question pertaining to ChefSpec's runners.

When I use the chef generate cookbook command to generate the boilerplate cookbook, I notice that the default spec test that gets created is configured to use the ServerRunner. However when I ran my unit test using the ServerRunner, I was getting a '403' error back. This lead me to investigate trying SoloRunner instead, which actually worked for me.

Although I'm not 100% sure why I got this '403' error, I presume it has to do with the 'Server' part of the runner name, in that, the ServerRunner must be attempting to bind to a server endpoint or something. But my more broader question is:

What is the difference between ServerRunner and SoloRunner? For some reason, I'm struggling to find information on this topic. Any information would be appreciated.


#2

There is information on this on the ChefSpec homepage under "Using a Chef Server".

If you don't need to test "server" features like search or data bags, then SoloRunner is going to be faster.


#3

Thanks. I wasn't aware of that page. Perhaps a link can be provided on the docs.chef.io site that refers to it...just a suggestion.


#4

Please ignore that page. It is incorrect and outdated. I'll try to remember to delete it when I get a chance. The correct answer is to use SoloRunner. ServerRunner is actively deprecated and slated for removal if I manage to care about it long enough to bother :slight_smile: You can find more info in the actual ChefSpec documentation: https://github.com/chefspec/chefspec


#5

Thanks for the clarification.