sous-chefs / confluence

Development repository for the confluence cookbook
https://supermarket.chef.io/cookbooks/confluence
Other
43 stars 46 forks source link

Add test-kitchen integration tests to travis #5

Closed esciara closed 8 years ago

esciara commented 10 years ago

Hi there,

Newbie question: I saw that Travis is used, but looking at the current .travis.yml it looks like only foodcritic and rubo tests are run.

Being a newbie I have no idea what the limits to Travis are... And a wild CI dream would be that the cookbook could be tested running a test-kitchen instance, at least to see whether it installs correctly on at least on flavor of linux, even runs Integration tests with serverspec and/or ATDD tests with Cucumber. Even wilder (unreasonable?) dream would be that it does this on all supported flavors of linux when pushed to master.

Possible?

bflad commented 10 years ago

Definitely possible and doable from what I've seen with other cookbooks. I just haven't had time to play. Only possible limitation for test kitchen might be that I'd have to pay for test instances to spin up.

esciara commented 10 years ago

Do you have some links so I can have a look? On travis fair use policy too if you have (could not find much info on the subject).

esciara commented 10 years ago

Ok, I looked into it... I don't think it can work as installation of vagrant + VM images would pass the build timeout of 50 minutes.

So I had a look around and saw what is done on https://github.com/opscode-cookbooks/tomcat for instance. They are using test-kitchen drivers to start servers on the cloud. More details in https://github.com/opscode-cookbooks/tomcat/blob/master/TESTING.md .

Had a try on Digital Ocean with a cookbook of mine. Turns out each test on each machine costs $0.01 .

patcon commented 8 years ago

I can work on this. I've got a good template for running test-kitchen tests via travis, using a quarantined digital ocean account specifically for testing

legal90 commented 8 years ago

@patcon Currently I'm experimenting with Travis+Docker. I think, it will be more convenient. And it's free :) https://github.com/legal90/confluence/tree/travis-docker https://travis-ci.org/legal90/confluence/builds/91621505

P.s. I was inspired by Chef's "database" cookbook: https://github.com/chef-cookbooks/database/blob/master/.travis.yml

patcon commented 8 years ago

Nice! fwiw I had some issues that I had to work around when I was trying to test with docker before. Seems like the others have been addressed, but I think the init_package still acts in a misleading way when you run in docker, as it will show bash or something like that instead of a init system. So might be to figure out another way to determine systemd usage

Anyhow, just a heads up. and testing costs on IaaS are essentially negligible, so no need to count that as a strike against aws or DO if we think they might be more robust :)

EDIT: possibly helpful link about init_package: https://github.com/hw-cookbooks/postgresql/pull/247#issuecomment-115749540

patcon commented 8 years ago

If we really want, could even create a library cookbook codifying the detection from pleaserun, or this cookbook: https://github.com/lusis/chef-logstash/pull/354

patcon commented 8 years ago

@legal90 mind converting that branch into a PR so we could talk about what's working and what's not so far? Wondering whether I'm hitting the same issues as you on that branch :)

legal90 commented 8 years ago

@patcon OK. I'll do it tomorrow

gsreynolds commented 8 years ago

@patcon also worth considering poise-service as an alternative to chef-pleaserun. I've not personally used either but heard good things about poise-service.

lock[bot] commented 6 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.