New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add test-kitchen #74
Add test-kitchen #74
Conversation
This initial configuration uses kitchen-vagrant to test the tools cookbook.
Oh, I should note that the "testing" of the tools cookbook only goes as far as the recipe converging successfully, it doesn't yet have any serverspec-based verification. |
Hmm, so this seems to want to use virtualbox which is something that is not getting anywhere near my machine... Not sure if it is explicitly requesting that somehow or not, as I thought I had vagrant using libvirt... |
Ah you need to set |
It's possible to override configuration using a .kitchen.local.yml file, if that's useful. That should allow setting the driver provider, and will hopefully allow you to choose a different image. |
Yes I've managed to get it working now with the peru/ubuntu-16.04-server-amd64 box. It's pretty slow mind - abut 3 minutes to run that one test on my machine. |
Just for the record this ---
driver:
provider: libvirt
platforms:
- name: ubuntu-16.04
driver:
box: peru/ubuntu-16.04-server-amd64 |
I really wondered how you test all those cookbooks and stumbled across this old pull request. Running anything non-trivial seems to be quite challenging due to lots and lots of dependencies (hardware, networking, hostnames, ... just to name a few).
I've changed my .kitchen.yml to run with docker and Ubuntu 18.04 running on a Ubuntu 18.04 host (which wasn't that good an idea, because of a missing postgres 9.5 on 18.04). This seems to be quite ok for the purpose of testing easy recipes, and performance isn't as bad as with virtualbox.
systemd causes some serious screw up with Docker on Ubuntu 18.04, which could be resolved by adjusting the following line in /etc/default/grub and reboot (new systemd parameter added):
|
This initial configuration uses kitchen-vagrant to test the tools cookbook.
I tried, and failed^Whaven't yet succeeded in getting more complex cookbooks to run, so I fell back on a pretty simple cookbook. Even then, there were challenges getting it to work with kitchen-docker, so I stuck with kitchen-vagrant for now.
The choice of a global test-kitchen setup vs a per-cookbook setup is not my first preference. Unfortunately there's no straightforward way to implement anything else, given our mono-repo and not using any cookbook publication systems. Using a global test-kitchen config is also the result that @zerebubuth came up with independently during work in June.