-
Notifications
You must be signed in to change notification settings - Fork 13
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
run kitchen tests on travis #38
base: master
Are you sure you want to change the base?
run kitchen tests on travis #38
Conversation
Doesn't have |
Travis has 3 run environments:
The docker Travis mode is very limited and you can't do a lot of things. Travis page on using docker said use "sudo: required" Basically the penalty is in startup time for the instance and I think you get a bit of a different node spec to run on. |
- source <(curl -sL https://raw.githubusercontent.com/zuazo/kitchen-in-travis/0.5.0/scripts/start_docker.sh) | ||
|
||
script: | ||
- bundle exec $TASK |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if you rewrote this like so:
env:
matrix:
- SUITE='generic-agent-default-centos-72'
- SUITE='php-agent-default-centos-72'
- SUITE='php-external-default-centos-72'
script:
- rake rubocop
- rake foodcritic .
- bundle exec kitchen test $SUITE
DRY things up a bit.
Also as I mentioned you can just install ChefDK using APT, and then your script
could be:
script:
- cookstyle
- foodcritic .
- kitchen test $SUITE
Best part of cookstyle
is that it uses a slower-moving, Chef-centric set of Rubocop rules, so your tests won’t break just because Rubocop was updated & has new rules to follow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am inclined to avoid coupling different test types inside the same CI task as it makes them harder to use IMHO.
If you want to slow down package updates, you can be more strict with versions inside the Gemfile and/or include the .lock file into the repo.
http://bundler.io/
If your concerned about the starting prefix of TASK, we can probably introduce some Rakfile magic..
http://stackoverflow.com/questions/9539324/generate-rake-test-tasks-dynamically-based-on-existing-test-files-in-a-rakefil
I know you prefer to move away from it...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ofir-petrushka ahh, I see. Yeah, makes total sense to have the RuboCop & Foodcritic linting run as their own sub-builds. Worth the lack of DRY-ness.
As for “slow down package updates”, it’s not about that. The whole point of ChefDK is to provide a sensible, compatible environment as a package appropriate for developing using Chef. If you take a look at ChefCo’s own cookbooks, this is how they test, which I take as a strong recommendation: sous-chefs/mysql@b59be78
The third run environment is the Trusty beta (i.e., Ubuntu 14.04). Using the non-containerized environment has a startup penalty, but does let you use Docker, which does let you do the Kitchen runs in Travis without needing to use a cloud provider. |
Going through old issues & PRs, and this is an absolutely ancient PR, and probably should simply be closed at this point. |
This will make all current kitchen test run in travis in parallel (while still running rubocop and foodcritic)
@chr4 I know you mentioned wanting to see a way for this to work.
This will be red in travis as there are things to fix for some of the suites and/or platforms and/or combo of which. (So merging red in hopes to fix or differing merge until can fix all issues is up to you..)
I will not currently have the time to continue hacking on this in the short term, but I hope this will be useful even if just to trigger @jeffbyrnes to do it in a better way ;).
What we would have wanted to see is a more dynamic way for travis to do the platform X kitchen suite, but it seems this isn't currently supported.
The only way to keep the list dynamically is not to use Travis parallel execution which would result in much longer run times. (current ones are quite long as well for the free usage tier which seems to run a max of 5 jobs at the time of test).
@jeffbyrnes I'd admit a lot of the code, including this, uses Gems and Rakefile because that's what I found to re-use ;). (path of least resistance)
This is based on zuazo/kitchen-in-travis as you can easily see in the travis file.