Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
TDI with ChefDK 0.0.1
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
someara
August 12, 2014
Technology
2
870
TDI with ChefDK 0.0.1
Work in progress. Not done yet!
someara
August 12, 2014
Tweet
Share
More Decks by someara
See All by someara
Docker Docker Docker Chef
someara
0
480
Hand Crafted Artisinal Chef Resources
someara
0
590
Configuration Management Camp 2015
someara
1
560
Cookbook Reusability
someara
0
790
Configuration Management 101 @ Scale12x
someara
2
880
Configuration Management 101
someara
3
770
Introduction to Chef - Scale 10x
someara
2
450
Introduction to Chef - NYLUG Jan 2012
someara
2
300
Introduction to Chef - LISA11
someara
10
6.2k
Other Decks in Technology
See All in Technology
みんなだいすきALB、NLBの 仕組みから最新機能まで総おさらい / Mastering ALB & NLB: Internal Mechanics and Latest Innovations
kaminashi
0
160
Azure SRE Agent x PagerDutyによる近未来インシデント対応への期待 / The Future of Incident Response: Azure SRE Agent x PagerDuty
aeonpeople
0
250
What happened to RubyGems and what can we learn?
mikemcquaid
0
140
GCASアップデート(202510-202601)
techniczna
0
210
新規事業における「一部だけどコア」な AI精度改善の優先順位づけ
zerebom
0
440
DEVCON 14 Report at AAMSX RU65: V9968, MSX0tab5, MSXDIY etc
mcd500
0
240
今日から始めるAmazon Bedrock AgentCore
har1101
4
270
日本語テキストと音楽の対照学習の技術とその応用
lycorptech_jp
PRO
1
390
Deno・Bunの標準機能やElysiaJSを使ったWebSocketサーバー実装 / ラーメン屋を貸し切ってLT会! IoTLT 2026新年会
you
PRO
0
190
Mosaic AI Gatewayでコーディングエージェントを配るための運用Tips / JEDAI 2026 新春 Meetup! AIコーディング特集
genda
0
130
SREが向き合う大規模リアーキテクチャ 〜信頼性とアジリティの両立〜
zepprix
0
230
Digitization部 紹介資料
sansan33
PRO
1
6.7k
Featured
See All Featured
Design in an AI World
tapps
0
140
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.3k
BBQ
matthewcrist
89
10k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
66
It's Worth the Effort
3n
188
29k
Between Models and Reality
mayunak
1
180
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
0
260
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.6k
Mobile First: as difficult as doing things right
swwweet
225
10k
What's in a price? How to price your products and services
michaelherold
247
13k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
170
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
Transcript
Testing Cookbooks
Sean OMeara!
[email protected]
! @someara
whoami
Writing Cookbooks
None
None
None
Are we done?
Testing Cookbooks
Slightly more involved.
The Basics http://www.flickr.com/photos/jronaldlee/5295169486/
Run the recipe See what happens
Manual techniques Automated techniques
None
None
CLI IS BETTER
ChefDK
Our toolchain is in Ruby
Standard Ruby dev setups are tricky to install
System Ruby! RVM! chruby
cd project ; bundle install
None
None
Put the code in the can.
OMNIBUS ChefDK! ! Stable toolchain in an Omnibus installer
None
None
Ruby! Chef! Test Kitchen! kitchen-vagrant! Berkshelf! Foodcritic! Rubocop! ChefSpec
None
Converge Testing
None
CaaP! vs! IaaP
Cookbook as a Project! vs! Infrastructure as a Project
no chef-repo
battery not included
kitchen-vagrant! kitchen-docker! kitchen-ec2! kitchen-rackspace! kitchen-gce! kitchen-digitalocean! kitchen-openstack! kitchen-bluebox! kitchen-joyent! kitchen-lxc
also available
None
None
None
None
None
None
None
None
None
None
Integration Testing ttps://www.flickr.com/photos/kitsa_sakurako/439652830
Test that a set of resources have achieved their combined
goal
{ testable intent
None
None
Test Kitchen runs integration tests out of band of Chef
It does this with bussers
Bats! Serverspec! Minitest! Cucumber
None
suite busser
None
None
kitchen test! ! kitchen converge! kitchen verify! kitchen destroy
test tear down
Style Testing
None
Ruby level style enforcement
None
None
None
None
None
None
single quotes space after comma no trailing whitespace
None
None
Chef level style enforcement
None
None
None
None
None
http://www.flickr.com/photos/40389360@N00/2428706650/ Regression Testing
ChefSpec makes assertions about compiled resource collections
None
None
None
None
None
REFERENCE SLIDE
None
None
None
https://github.com/opscode-cookbooks/yum https://github.com/opscode-cookbooks/mysql Reference Cookbooks https://github.com/opscode-cookbooks/jenkins https://github.com/opscode-cookbooks/yum-epel
Cookbook Dependencies
Often, a cookbook will depend on another
include_recipe ‘another_cookbook::recipe’! ! OR! ! consume a resource shipped in
another_cookbook
For example
None
None
not in core Chef
ships in mysql cookbook
None
None
Dependencies suck and you don’t want to manage them manually.
None
Berkshelf is bundler for Chef cookbooks
None
your chef-server here
None
Bundler installs dependencies into your local gem cache
Berkshelf installs dependencies into your local cookbook cache
None
None
None
None
None
None
needs moar ServerSpec
Continuous Integration
This is all driven from the command line
Which makes it super easy to wire into CI systems
CI should watch version control for commits
Polling! vs! Notifications
I ran out of slides!