SlideShare une entreprise Scribd logo
1  sur  88
Télécharger pour lire hors ligne
Chef Cookbook Testing and
Continuous Integration
Julian C. Dunn
Senior Consultant, Opscode, Inc.
<jdunn@opscode.com>
Friday, June 14, 13
Why Write Cookbook Tests?
• Catch development errors
• Catch regressions
• Code to requirements (TDD, BDD)
• Smaller batch sizes == lower blast radius
• Continuous delivery of cookbooks!
• Build confidence that your infrastructure is
working correctly
Friday, June 14, 13
Software Development
Lifecycle for
Sysadmins
Friday, June 14, 13
Devops Is A Two-Way Street
• It’s great when
developers care
about
• uptime!
• scaling!
• deployment!
• Put them on call!
etc. etc. etc.
Friday, June 14, 13
Devops Is A Two-Way Street
• Systems Administrators
also have as much or more to
learn from developers as well!
Friday, June 14, 13
Source
Code
Compiler
Artifact
Test
Typical Development Workflow
• Typical Software Development Workflow:
• Write Source
• Compile Source
• Deploy Artifacts
• Write Tests
• Run Tests
Friday, June 14, 13
Source
Code
Compiler
Artifact
Test
Typical Development Workflow
• Source Code
• The recipe for a computer program
• Edited directly
• Managed via Source Control Software
Friday, June 14, 13
Source
Code
Compiler
Artifact
Test
Typical Development Workflow
• Compiler
• Takes source code and converts it into
executable programs
Friday, June 14, 13
Source
Code
Compiler
Artifact
Test
Typical Development Workflow
• Artifact
• Artifacts are executable programs
created by compilers.
• Compiled artifacts cannot be edited
directly. Source code must be changed
and re-compiled to produce a new build
artifact.
Friday, June 14, 13
Source
Code
Compiler
Artifact
Test
Typical Development Workflow
• Testing
• Write tests to verify that code works as
intended
• Run tests at different stages of the code
lifecycle to ensure correctness
Friday, June 14, 13
Source
Code
Compiler
Artifact
Test
Typical Development Workflow
• When developing software, most time
isn’t actually spent coding
• 10-second changes to source code can
take minutes to vet
• Compiling code
• Deploying code
• Writing & Running tests
Friday, June 14, 13
Friday, June 14, 13
Source
Code
Compiler
Artifact
Test
Typical Development Workflow
Fun!
Boring!
• Things that are fun:
• Designing programs!
• Writing source code!
• Things that are boring:
• Compiling code
• Deploying artifacts
• Running tests
Friday, June 14, 13
Look familiar to any Chefs?Friday, June 14, 13
Worksta(on:+
Knife+cookbook+
create+
Worksta(on:+
Edit+cookbook+
Worksta(on:+
Knife+cookbook+
upload+
Provision+target+
Bootstrap+
target+
Worksta(on:+
Edit+target+run+
list+
ssh+target+
Target:+Run+
chef>client+
Traditional Cookbook Development: First Chef Run
Friday, June 14, 13
Worksta(on:+
edit+cookbook+
Worksta(on:+
knife+cookbook+
upload+
Target:+Run+
chef9client+
Traditional Cookbook Development: Subsequent Runs
Friday, June 14, 13
Source'Code'
Compiler'
Ar/fact'
Test'
Boooooooring
• Too much time doing
“paperwork”
• vi recipes/something.rb
• knife cookbook upload
• sudo pkill -USR1 chef-
client
• #%$#%$ something
broke, let me do that all
again
• Not enough time doing fun
stuff!
• Writing recipes
Less Fun!
More Boring!
X
Friday, June 14, 13
Source'Code'
Compiler'
Ar/fact'
Test'
Boooooooring
• Too much time doing
“paperwork”
• vi recipes/something.rb
• knife cookbook upload
• sudo pkill -USR1 chef-
client
• #%$#%$ something
broke, let me do that all
again
• Not enough time doing fun
stuff!
• Writing recipes
Less Fun!
More Boring!
XTH
IS
SUCKS!
Friday, June 14, 13
Chefs on a Plane
What if...
Friday, June 14, 13
Chefs on a Plane
What if...Worksta(on:+
Knife+cookbook+
create+
Worksta(on:+
Edit+cookbook+
Worksta(on:+
Knife+cookbook+
upload+
Provision+target+
Bootstrap+
target+
Worksta(on:+
Edit+target+run+
list+
ssh+target+
Target:+Run+
chef>client+
Target:(Run(
chef/client(
Worksta6on:(
edit(cookbook(
Worksta6on:(
knife(cookbook(
upload(
...we could
automate all
of this...
Friday, June 14, 13
Chefs on a Plane
What if...Worksta(on:+
Knife+cookbook+
create+
Worksta(on:+
Edit+cookbook+
Worksta(on:+
Knife+cookbook+
upload+
Provision+target+
Bootstrap+
target+
Worksta(on:+
Edit+target+run+
list+
ssh+target+
Target:+Run+
chef>client+
Target:(Run(
chef/client(
Worksta6on:(
edit(cookbook(
Worksta6on:(
knife(cookbook(
upload(
...we could
automate all
of this...
...to run entirely on this...
Friday, June 14, 13
Chefs on a Plane
What if...
...even while
aboard this?
Worksta(on:+
Knife+cookbook+
create+
Worksta(on:+
Edit+cookbook+
Worksta(on:+
Knife+cookbook+
upload+
Provision+target+
Bootstrap+
target+
Worksta(on:+
Edit+target+run+
list+
ssh+target+
Target:+Run+
chef>client+
Target:(Run(
chef/client(
Worksta6on:(
edit(cookbook(
Worksta6on:(
knife(cookbook(
upload(
...we could
automate all
of this...
...to run entirely on this...
Friday, June 14, 13
Source'Code'
Compiler'
Ar/fact'
Test'
Developing for Chef: Rapid Iteration
• Less time waiting around
for cookbook deploys and
Chef runs
• More frequent testing
• Better code
• Business needs met
more quickly
More Fun!
Less Boring!
X
Friday, June 14, 13
Code Can (Help)
Friday, June 14, 13
The Toolchain
Friday, June 14, 13
The Toolchain
• You’re becoming a developer!
• Reasonably powerful computer
• Good editor
Friday, June 14, 13
Have a Good Computer
• Virtualization is used to run
acceptance tests
• Running on a real virtualized
“node”
• Lots of memory (4GB+, 8GB
recommended)
• Fast disk (SSD)
• Good processor (Intel i5+)
• Modern OS
X
Friday, June 14, 13
Tools
• Chef (obviously)
• Virtualization provider
• Virtualization automation
(Vagrant)
• Cookbook dependency
manager (Berkshelf,
Librarian)
• Unit and acceptance testing
frameworks
Friday, June 14, 13
Software Testing
Terminology and Chef
Friday, June 14, 13
Different Types of Testing
• There are formal
Software Engineering
definitions for testing
Friday, June 14, 13
Different Types of Testing
• There are formal
Software Engineering
definitions for testing
• Unit test
Friday, June 14, 13
Different Types of Testing
• There are formal
Software Engineering
definitions for testing
• Unit test
• Integration test
Friday, June 14, 13
Different Types of Testing
• There are formal
Software Engineering
definitions for testing
• Unit test
• Integration test
• Acceptance test
Friday, June 14, 13
Different Types of Testing
• There are formal
Software Engineering
definitions for testing
• Unit test
• Integration test
• Acceptance test
• An easy explanation for
SAs is ...
Friday, June 14, 13
• Unit Test: Signal Input
What and When To Test
Flickr user: Rain Rabbit
Friday, June 14, 13
• Unit Test: Signal Input
• Did I send Chef the correct
command?
What and When To Test
Flickr user: Rain Rabbit
Friday, June 14, 13
• Unit Test: Signal Input
• Did I send Chef the correct
command?
• Signal Processing
What and When To Test
Flickr user: Rain Rabbit
Friday, June 14, 13
• Unit Test: Signal Input
• Did I send Chef the correct
command?
• Signal Processing
• Did Chef interpret my command
correctly?
What and When To Test
Flickr user: Rain Rabbit
Friday, June 14, 13
• Unit Test: Signal Input
• Did I send Chef the correct
command?
• Signal Processing
• Did Chef interpret my command
correctly?
• Acceptance Test: Signal Output
What and When To Test
Flickr user: Rain Rabbit
Friday, June 14, 13
• Unit Test: Signal Input
• Did I send Chef the correct
command?
• Signal Processing
• Did Chef interpret my command
correctly?
• Acceptance Test: Signal Output
• Did my expressed intent, executed
by Chef, achieve the desired
result?
What and When To Test
Flickr user: Rain Rabbit
Friday, June 14, 13
Chef Testing Tools
Friday, June 14, 13
Chef Testing Tools
• Signal Input
• ChefSpec
Friday, June 14, 13
Chef Testing Tools
• Signal Input
• ChefSpec
• Signal out
• Chef Minitests & Minitest Handler
Friday, June 14, 13
Chef Testing Tools
• Signal Input
• ChefSpec
• Signal out
• Chef Minitests & Minitest Handler
• Signal processing
• Who cares; that’s what Opscode’s own tests for
Chef are for!
Friday, June 14, 13
General Philosophy for Chef Testing
Friday, June 14, 13
General Philosophy for Chef Testing
• Unit tests
• ChefSpec assertion for every resource of interest
• Each recipe should get its own test file
Friday, June 14, 13
General Philosophy for Chef Testing
• Unit tests
• ChefSpec assertion for every resource of interest
• Each recipe should get its own test file
• Acceptance tests
• Anything that you couldn’t test in a unit test
Friday, June 14, 13
General Philosophy for Chef Testing
• Unit tests
• ChefSpec assertion for every resource of interest
• Each recipe should get its own test file
• Acceptance tests
• Anything that you couldn’t test in a unit test
• Don’t repeat yourself!
Friday, June 14, 13
Unit Testing: ChefSpec
Friday, June 14, 13
ChefSpec Overview
• Built on top of RSpec
• Converge a Chef run in memory
• Overrides all providers to take no action
• Make assertions about the in-memory Chef run
• Mock Ohai data (automatic attributes) with Fauxhai
Friday, June 14, 13
Example Recipe Part One
include_recipe “java”
user node['sauceproxy']['server']['user'] do
  comment "SauceLabs Proxy User"
  system true
  action :create
end
directory node['sauceproxy']['server']['install_dir'] do
  owner node['sauceproxy']['server']['user']
  mode 00755
  action :create
end
# Can't assume we have unzip
package "unzip" do
  action :install
end
execute "unzip-saucelabs-proxy" do
  cwd node['sauceproxy']['server']['install_dir']
  command "unzip -o #{Chef::Config[:file_cache_path]}/#{node['sauceproxy']['server']['zipfile']}"
  action :nothing
  notifies :restart, "service[sauceproxy]"
end
https://github.com/juliandunn/sauceproxy/blob/master/recipes/server.rb
Friday, June 14, 13
Example Recipe Part Two
remote_file "#{Chef::Config[:file_cache_path]}/#{node['sauceproxy']['server']['zipfile']}" do
source "#{node['sauceproxy']['server']['download_url']}/#{node['sauceproxy']['server']['zipfile']}"
  action :create_if_missing
  notifies :run, "execute[unzip-saucelabs-proxy]", :immediately
end
template "/etc/init.d/sauceproxy" do
  source "sauceproxy.init.erb"
  mode 00755
  owner "root"
  group "root"
  action :create
end
template "/etc/sysconfig/sauceproxy" do
  source "sauceproxy.sysconfig.erb"
  mode 00644
  owner "root"
  group "root"
  action :create
end
service "sauceproxy" do
  supports :restart => true
  action [:enable, :start]
end
Friday, June 14, 13
Example ChefSpec Test: Setup
describe 'sauceproxy::server' do
let (:chef_run) do
runner = ChefSpec::ChefRunner.new(
platform: 'centos',
version: '6.3'
)
runner.node.set['sauceproxy']['server']['user'] = 'fake'
runner.node.set['sauceproxy']['server']['install_dir'] =
'/tmp/fake'
runner.node.set['sauceproxy']['server']['version'] = '3.14159'
runner.converge('sauceproxy::server')
end
Friday, June 14, 13
Example ChefSpec Test: Expectations
it 'should create a sauceproxy directory with the right
ownership' do
expect(chef_run).to create_directory('/tmp/fake')
expect(chef_run.directory('/tmp/fake')).to
be_owned_by('fake')
end
it 'should start a service called sauceproxy' do
expect(chef_run).to start_service('sauceproxy')
expect(chef_run).to
set_service_to_start_on_boot('sauceproxy')
end
end
Friday, June 14, 13
ChefSpec In Action
Friday, June 14, 13
ChefSpec: Expectations
• Many expectations (assertions) possible
• https://github.com/acrmp/chefspec#making-
assertions
• Don’t (just) restate static resources
• Mock out data
• Static resource assertions: good for regressions
• Whoops, I deleted the service resource
Friday, June 14, 13
Acceptance Testing:
MiniTest
Friday, June 14, 13
Chef Client Run
Friday, June 14, 13
Chef Client Run
Friday, June 14, 13
Acceptance Tests as Report Handler
• Acceptance testing as a Chef Report Handler
• Many tools (serverspec, bats, minitest)
• I’ll demo Chef-MiniTest-Handler; most widely used
Friday, June 14, 13
MiniTest Handler Cookbook
• http://community.opscode.com/cookbooks/minitest-
handler
• Installs Minitest Gems
• Installs Chef Minitest Gems
• Installs the Chef-Minitest-Handler Notification
Handler for Chef-Client
• Places test files from cookbooks on the target node
as part of a Chef-client run
Friday, June 14, 13
MiniTest Files
• Each recipe gets an individual test file.
• recipes/server.rb
• files/default/test/server_test.rb
• Tests for each recipe are automatically loaded by the
handler
Friday, June 14, 13
Example MiniTest
require 'minitest/spec'
describe_recipe 'sauceproxy::server' do
it 'runs as a daemon' do
service('sauceproxy').must_be_running
end
end
http://tinyurl.com/minitest-examples
for many more example tests
Friday, June 14, 13
Make this go on a
with virtualization!
Friday, June 14, 13
Using Vagrant & Berkshelf to Iterate
• Vagrant is virtualization middleware
• Driven from Vagrantfile
• Defines VM images, customization parameters,
provisioners (Chef in our case)
• Berkshelf is a cookbook dependency manager
• Get dependent cookbooks from community API
• Feed them to Vagrant Chef provisioner
Friday, June 14, 13
Example Vagrantfile
Vagrant.configure("2") do |config|
config.vm.hostname = "sauceproxy-berkshelf"
config.vm.box = "opscode-centos-6.4"
config.vm.box_url = "https://opscode-vm.s3.amazonaws.com/vagrant/
opscode_centos-6.4_chef-11.4.4.box"
config.ssh.max_tries = 40
config.ssh.timeout = 120
config.vm.provision :chef_solo do |chef|
chef.json = {}
chef.run_list = [
"recipe[minitest-handler]",
"recipe[sauceproxy::server]"
]
end
end
Friday, June 14, 13
% vagrant up
Bringing Up Vagrant
borkbork:~/Dropbox/devel/github/juliandunn/sauceproxy (master)$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
[default] Importing base box 'centos-6.4'...
[default] Matching MAC address for NAT networking...
[default] Setting the name of the VM...
[default] Clearing any previously set forwarded ports...
[Berkshelf] Updating Vagrant's berkshelf: '/Users/juliandunn/.berkshelf/vagrant/
berkshelf-20130611-20810-rt7k01'
[Berkshelf] Using sauceproxy (0.1.8) at path: '/Users/juliandunn/Dropbox/devel/github/juliandunn/
sauceproxy'
[Berkshelf] Using minitest-handler (0.2.1)
[Berkshelf] Using java (1.11.4)
[Berkshelf] Using windows (1.8.10)
[Berkshelf] Using chef_handler (1.1.4)
[default] Creating shared folders metadata...
[default] Clearing any previously set network interfaces...
[default] Preparing network interfaces based on configuration...
[default] Forwarding ports...
[default] -- 22 => 2222 (adapter 1)
[default] Booting VM...
[default] Waiting for VM to boot. This can take a few minutes.
Friday, June 14, 13
% vagrant up
Bringing Up Vagrant
borkbork:~/Dropbox/devel/github/juliandunn/sauceproxy (master)$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
[default] Importing base box 'centos-6.4'...
[default] Matching MAC address for NAT networking...
[default] Setting the name of the VM...
[default] Clearing any previously set forwarded ports...
[Berkshelf] Updating Vagrant's berkshelf: '/Users/juliandunn/.berkshelf/vagrant/
berkshelf-20130611-20810-rt7k01'
[Berkshelf] Using sauceproxy (0.1.8) at path: '/Users/juliandunn/Dropbox/devel/github/juliandunn/
sauceproxy'
[Berkshelf] Using minitest-handler (0.2.1)
[Berkshelf] Using java (1.11.4)
[Berkshelf] Using windows (1.8.10)
[Berkshelf] Using chef_handler (1.1.4)
[default] Creating shared folders metadata...
[default] Clearing any previously set network interfaces...
[default] Preparing network interfaces based on configuration...
[default] Forwarding ports...
[default] -- 22 => 2222 (adapter 1)
[default] Booting VM...
[default] Waiting for VM to boot. This can take a few minutes.
Friday, June 14, 13
Vagrant Run Continued
[default] Waiting for VM to boot. This can take a few minutes.
[default] VM booted and ready for use!
GuestAdditions 4.2.12 running --- OK.
[default] Setting hostname...
[default] Configuring and enabling network interfaces...
[default] Mounting shared folders...
[default] -- /vagrant
[default] -- /tmp/vagrant-chef-1/chef-solo-1/cookbooks
[default] Running provisioner: chef_solo...
Generating chef JSON and uploading...
Running chef-solo...
[2013-06-12T02:52:26+00:00] INFO: *** Chef 11.4.4 ***
[2013-06-12T02:52:26+00:00] INFO: Setting the run_list to ["recipe[minitest-
handler]", "recipe[sauceproxy::server]"] from JSON
[2013-06-12T02:52:26+00:00] INFO: Run List is [recipe[minitest-handler],
recipe[sauceproxy::server]]
[2013-06-12T02:52:26+00:00] INFO: Run List expands to [minitest-handler,
sauceproxy::server]
[2013-06-12T02:52:26+00:00] INFO: Starting Chef Run for sauceproxy-berkshelf
Friday, June 14, 13
Vagrant Run Continued
[2013-06-12T02:55:22+00:00] INFO: Chef Run complete in 175.788656866 seconds
[2013-06-12T02:55:22+00:00] INFO: Running report handlers
Run options: -v --seed 31883
# Running tests:
recipe::java::openjdk#test_0001_installs the correct version of the jdk =
0.11 s = .
recipe::java::openjdk#test_0002_properly sets JAVA_HOME environment variable =
0.04 s = .
recipe::sauceproxy::server#test_0001_runs as a daemon =
0.09 s = .
Finished tests in 0.244690s, 12.2604 tests/s, 12.2604 assertions/s.
3 tests, 3 assertions, 0 failures, 0 errors, 0 skips
[2013-06-12T02:55:22+00:00] INFO: Report handlers complete
Friday, June 14, 13
Vagrant Run Continued
[2013-06-12T02:55:22+00:00] INFO: Chef Run complete in 175.788656866 seconds
[2013-06-12T02:55:22+00:00] INFO: Running report handlers
Run options: -v --seed 31883
# Running tests:
recipe::java::openjdk#test_0001_installs the correct version of the jdk =
0.11 s = .
recipe::java::openjdk#test_0002_properly sets JAVA_HOME environment variable =
0.04 s = .
recipe::sauceproxy::server#test_0001_runs as a daemon =
0.09 s = .
Finished tests in 0.244690s, 12.2604 tests/s, 12.2604 assertions/s.
3 tests, 3 assertions, 0 failures, 0 errors, 0 skips
[2013-06-12T02:55:22+00:00] INFO: Report handlers complete
Friday, June 14, 13
Minitests from Java cookbook ran too!
[2013-06-12T02:55:22+00:00] INFO: Chef Run complete in 175.788656866 seconds
[2013-06-12T02:55:22+00:00] INFO: Running report handlers
Run options: -v --seed 31883
# Running tests:
recipe::java::openjdk#test_0001_installs the correct version of the jdk =
0.11 s = .
recipe::java::openjdk#test_0002_properly sets JAVA_HOME environment variable =
0.04 s = .
recipe::sauceproxy::server#test_0001_runs as a daemon =
0.09 s = .
Finished tests in 0.244690s, 12.2604 tests/s, 12.2604 assertions/s.
3 tests, 3 assertions, 0 failures, 0 errors, 0 skips
[2013-06-12T02:55:22+00:00] INFO: Report handlers complete
Friday, June 14, 13
Minitests from Java cookbook ran too!
[2013-06-12T02:55:22+00:00] INFO: Chef Run complete in 175.788656866 seconds
[2013-06-12T02:55:22+00:00] INFO: Running report handlers
Run options: -v --seed 31883
# Running tests:
recipe::java::openjdk#test_0001_installs the correct version of the jdk =
0.11 s = .
recipe::java::openjdk#test_0002_properly sets JAVA_HOME environment variable =
0.04 s = .
recipe::sauceproxy::server#test_0001_runs as a daemon =
0.09 s = .
Finished tests in 0.244690s, 12.2604 tests/s, 12.2604 assertions/s.
3 tests, 3 assertions, 0 failures, 0 errors, 0 skips
[2013-06-12T02:55:22+00:00] INFO: Report handlers complete
Friday, June 14, 13
New Test/Dev Cycle
Write Unit Tests
Worked?
Run ChefSpec
No
Write Recipe
Code
Write Acceptance
Tests
Yes
Worked?
Run Vagrant + Minitest Handler
No
vagrant destroy
Yes Commit/Tag Code,
etc.
Friday, June 14, 13
CI Pipeline Integration
Friday, June 14, 13
Continuous Integration Pipeline
• Run unit tests in your pipeline
• Run acceptance tests in your
pipeline
• Drive cookbook uploads as the
output!
Friday, June 14, 13
Travis-CI Example for SauceProxy
language: ruby
gemfile:
  - gemfiles/travis.gemfile
rvm:
  - "1.9.2"
  - "1.9.3"
script: bundle exec rake test:syntax test:lint test:spec
notifications:
  email:
    - jdunn@opscode.com
Friday, June 14, 13
Rakefile Example
• Too long to post here
• Rake tasks for Foodcritic
and ChefSpec
• https://github.com/
juliandunn/sauceproxy/
blob/master/Rakefile
Friday, June 14, 13
Travis-CI Example Dashboard
Friday, June 14, 13
^#$%(#$ I broke the build
Friday, June 14, 13
Test Kitchen (alpha)
• Run acceptance test suite on
multiple OSes
• Different fixtures for each, if desired
• Different drivers (vagrant, ec2, lxc,
etc.)
• Hook up to Jenkins or other CI
system if desired
Friday, June 14, 13
Test Kitchen Config File
---
driver_plugin: vagrant
platforms:
- name: centos-6.4
driver_config:
box: opscode-centos-6.4
box_url: https://opscode-vm.s3.amazonaws.com/vagrant/opscode_centos-6.4_provisionerless.box
require_chef_omnibus: true
- name: centos-5.9
driver_config:
box: opscode-centos-5.9
box_url: https://opscode-vm.s3.amazonaws.com/vagrant/opscode_centos-5.9_provisionerless.box
require_chef_omnibus: true
suites:
- name: default
run_list: ["recipe[minitest-handler]", "recipe[sauceproxy::server]"]
attributes: {}
Friday, June 14, 13
Test Kitchen Demo
Friday, June 14, 13
Resources
Friday, June 14, 13
Resources
• ChefSpec: https://github.com/acrmp/chefspec
• Chef Minitest Handler: https://github.com/calavera/
minitest-chef-handler
• Berkshelf: http://berkshelf.com/
• Vagrant: http://vagrantup.com/
• Test Kitchen: https://github.com/opscode/test-kitchen
• Bento: https://github.com/opscode/bento
• SauceProxy Sample Cookbook: https://github.com/
juliandunn/sauceproxy
Friday, June 14, 13
More on Testing
• Chef-NYC: The Hows and Whys
of Cookbook Testing
• Seth Vargo (Author of ChefSpec,
Fauxhai, many others)
• http://www.meetup.com/Chef-
NYC/events/122219772/
• June 25th in Manhattan
Friday, June 14, 13
Chef Fundamentals Training
• Boston, July 11-12
(CompuWorks, 263
Summer St.)
• eventbrite.com/event/
6652057483
• Use code BOSTON-
MEETUP to save 25%!
Friday, June 14, 13
Questions and Prizes
Also, we’re hiring! Automate all the things for fun and profit!
http://www.opscode.com/blog/careers/
(and/or see me after)
Friday, June 14, 13

Contenu connexe

En vedette

Introduction to Chef: Automate Your Infrastructure by Modeling It In Code
Introduction to Chef: Automate Your Infrastructure by Modeling It In CodeIntroduction to Chef: Automate Your Infrastructure by Modeling It In Code
Introduction to Chef: Automate Your Infrastructure by Modeling It In CodeJosh Padnick
 
Chef Fundamentals Training Series Module 1: Overview of Chef
Chef Fundamentals Training Series Module 1: Overview of ChefChef Fundamentals Training Series Module 1: Overview of Chef
Chef Fundamentals Training Series Module 1: Overview of ChefChef Software, Inc.
 
Chef for DevOps - an Introduction
Chef for DevOps - an IntroductionChef for DevOps - an Introduction
Chef for DevOps - an IntroductionSanjeev Sharma
 
Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...
Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...
Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...Chef Software, Inc.
 
Overview of Chef - Fundamentals Webinar Series Part 1
Overview of Chef - Fundamentals Webinar Series Part 1Overview of Chef - Fundamentals Webinar Series Part 1
Overview of Chef - Fundamentals Webinar Series Part 1Chef
 
Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...
Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...
Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...Chef Software, Inc.
 
Continuous Development with Jenkins - Stephen Connolly at PuppetCamp Dublin '12
Continuous Development with Jenkins - Stephen Connolly at PuppetCamp Dublin '12Continuous Development with Jenkins - Stephen Connolly at PuppetCamp Dublin '12
Continuous Development with Jenkins - Stephen Connolly at PuppetCamp Dublin '12Puppet
 
Chef for beginners module 5
Chef for beginners   module 5Chef for beginners   module 5
Chef for beginners module 5Chef
 
Testing of javacript
Testing of javacriptTesting of javacript
Testing of javacriptLei Kang
 
ICSE 2011 Research Paper on Modularity Violations
ICSE 2011 Research Paper on Modularity ViolationsICSE 2011 Research Paper on Modularity Violations
ICSE 2011 Research Paper on Modularity Violationsmiryung
 
Ansible, Idempotency, and Jenkins
Ansible, Idempotency, and JenkinsAnsible, Idempotency, and Jenkins
Ansible, Idempotency, and Jenkinstylerturk
 
What Makes a Good Chef Cookbook? (May 2014 Edition)
What Makes a Good Chef Cookbook? (May 2014 Edition)What Makes a Good Chef Cookbook? (May 2014 Edition)
What Makes a Good Chef Cookbook? (May 2014 Edition)Julian Dunn
 
How To Introduce Cloud Based Load Testing to Your Jenkins Continuous Delivery...
How To Introduce Cloud Based Load Testing to Your Jenkins Continuous Delivery...How To Introduce Cloud Based Load Testing to Your Jenkins Continuous Delivery...
How To Introduce Cloud Based Load Testing to Your Jenkins Continuous Delivery...Jennifer Finney
 
Velocity2011 chef-workshop
Velocity2011 chef-workshopVelocity2011 chef-workshop
Velocity2011 chef-workshopjtimberman
 
Introduction to Ansible - Jan 28 - Austin MeetUp
Introduction to Ansible - Jan 28 - Austin MeetUpIntroduction to Ansible - Jan 28 - Austin MeetUp
Introduction to Ansible - Jan 28 - Austin MeetUptylerturk
 
Introduction to Chef
Introduction to ChefIntroduction to Chef
Introduction to Chefkevsmith
 

En vedette (20)

Introduction to Chef: Automate Your Infrastructure by Modeling It In Code
Introduction to Chef: Automate Your Infrastructure by Modeling It In CodeIntroduction to Chef: Automate Your Infrastructure by Modeling It In Code
Introduction to Chef: Automate Your Infrastructure by Modeling It In Code
 
Chef Fundamentals Training Series Module 1: Overview of Chef
Chef Fundamentals Training Series Module 1: Overview of ChefChef Fundamentals Training Series Module 1: Overview of Chef
Chef Fundamentals Training Series Module 1: Overview of Chef
 
Chef for DevOps - an Introduction
Chef for DevOps - an IntroductionChef for DevOps - an Introduction
Chef for DevOps - an Introduction
 
Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...
Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...
Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...
 
Overview of Chef - Fundamentals Webinar Series Part 1
Overview of Chef - Fundamentals Webinar Series Part 1Overview of Chef - Fundamentals Webinar Series Part 1
Overview of Chef - Fundamentals Webinar Series Part 1
 
Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...
Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...
Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...
 
Introduction to chef
Introduction to chefIntroduction to chef
Introduction to chef
 
Continuous Development with Jenkins - Stephen Connolly at PuppetCamp Dublin '12
Continuous Development with Jenkins - Stephen Connolly at PuppetCamp Dublin '12Continuous Development with Jenkins - Stephen Connolly at PuppetCamp Dublin '12
Continuous Development with Jenkins - Stephen Connolly at PuppetCamp Dublin '12
 
Chef for beginners module 5
Chef for beginners   module 5Chef for beginners   module 5
Chef for beginners module 5
 
Ansible API
Ansible APIAnsible API
Ansible API
 
Testing of javacript
Testing of javacriptTesting of javacript
Testing of javacript
 
Chef: Smart infrastructure automation
Chef: Smart infrastructure automationChef: Smart infrastructure automation
Chef: Smart infrastructure automation
 
ICSE 2011 Research Paper on Modularity Violations
ICSE 2011 Research Paper on Modularity ViolationsICSE 2011 Research Paper on Modularity Violations
ICSE 2011 Research Paper on Modularity Violations
 
Ansible, Idempotency, and Jenkins
Ansible, Idempotency, and JenkinsAnsible, Idempotency, and Jenkins
Ansible, Idempotency, and Jenkins
 
What Makes a Good Chef Cookbook? (May 2014 Edition)
What Makes a Good Chef Cookbook? (May 2014 Edition)What Makes a Good Chef Cookbook? (May 2014 Edition)
What Makes a Good Chef Cookbook? (May 2014 Edition)
 
How To Introduce Cloud Based Load Testing to Your Jenkins Continuous Delivery...
How To Introduce Cloud Based Load Testing to Your Jenkins Continuous Delivery...How To Introduce Cloud Based Load Testing to Your Jenkins Continuous Delivery...
How To Introduce Cloud Based Load Testing to Your Jenkins Continuous Delivery...
 
Velocity2011 chef-workshop
Velocity2011 chef-workshopVelocity2011 chef-workshop
Velocity2011 chef-workshop
 
Introduction to Ansible - Jan 28 - Austin MeetUp
Introduction to Ansible - Jan 28 - Austin MeetUpIntroduction to Ansible - Jan 28 - Austin MeetUp
Introduction to Ansible - Jan 28 - Austin MeetUp
 
Introduction to Chef
Introduction to ChefIntroduction to Chef
Introduction to Chef
 
IT Automation with Chef
IT Automation with ChefIT Automation with Chef
IT Automation with Chef
 

Similaire à Chef Cookbook Testing and Continuous Integration

ChefConf2014 - Chef TDD
ChefConf2014 - Chef TDD ChefConf2014 - Chef TDD
ChefConf2014 - Chef TDD Daniel Tracy
 
Dev opsdays scriptcode
Dev opsdays scriptcodeDev opsdays scriptcode
Dev opsdays scriptcodeDevopsdays
 
Hacker News Meetup April 2014
Hacker News Meetup April 2014Hacker News Meetup April 2014
Hacker News Meetup April 2014Dan Quine
 
DevOps: Getting Started with Puppet on Windows
DevOps: Getting Started with Puppet on WindowsDevOps: Getting Started with Puppet on Windows
DevOps: Getting Started with Puppet on WindowsRob Reynolds
 
Behaviour driven development present
Behaviour driven development presentBehaviour driven development present
Behaviour driven development presentRaul Panjiyar
 
Morph your mindset for Continuous Delivery, Agile Roots 2014
Morph your mindset for Continuous Delivery,  Agile Roots 2014Morph your mindset for Continuous Delivery,  Agile Roots 2014
Morph your mindset for Continuous Delivery, Agile Roots 2014lisacrispin
 
Performance and Beyond - Leandro Melendez
Performance and Beyond - Leandro MelendezPerformance and Beyond - Leandro Melendez
Performance and Beyond - Leandro MelendezQA or the Highway
 
14 Habits of Great SQL Developers
14 Habits of Great SQL Developers14 Habits of Great SQL Developers
14 Habits of Great SQL DevelopersIke Ellis
 
Move test planning before implementation
Move test planning before implementationMove test planning before implementation
Move test planning before implementationTed Cheng
 
Moving to Continuous Delivery Without Breaking Your Code
Moving to Continuous Delivery Without Breaking Your CodeMoving to Continuous Delivery Without Breaking Your Code
Moving to Continuous Delivery Without Breaking Your CodeXebiaLabs
 
Just Enough for Innovation
Just Enough for InnovationJust Enough for Innovation
Just Enough for InnovationJosie Scott
 
The Five Stages of Chef Grief: My First 6 months with Chef, and Getting Aroun...
The Five Stages of Chef Grief: My First 6 months with Chef, and Getting Aroun...The Five Stages of Chef Grief: My First 6 months with Chef, and Getting Aroun...
The Five Stages of Chef Grief: My First 6 months with Chef, and Getting Aroun...DevOpsDays Austin 2014
 
Continuous Development: Supporting a Release Model
Continuous Development: Supporting a Release ModelContinuous Development: Supporting a Release Model
Continuous Development: Supporting a Release ModelPerforce
 
Getting By Without "QA"
Getting By Without "QA"Getting By Without "QA"
Getting By Without "QA"Dave King
 
Devops what it means to me
Devops what it means to meDevops what it means to me
Devops what it means to meG. Ryan Fawcett
 
Show an Open Source Project Some Love and Start Using Travis-CI
Show an Open Source Project Some Love and Start Using Travis-CIShow an Open Source Project Some Love and Start Using Travis-CI
Show an Open Source Project Some Love and Start Using Travis-CIJoel Byler
 
Moving to Continuous Delivery without breaking everything
Moving to Continuous Delivery without breaking everythingMoving to Continuous Delivery without breaking everything
Moving to Continuous Delivery without breaking everythingXebiaLabs
 

Similaire à Chef Cookbook Testing and Continuous Integration (20)

ChefConf2014 - Chef TDD
ChefConf2014 - Chef TDD ChefConf2014 - Chef TDD
ChefConf2014 - Chef TDD
 
Dev opsdays scriptcode
Dev opsdays scriptcodeDev opsdays scriptcode
Dev opsdays scriptcode
 
Hacker News Meetup April 2014
Hacker News Meetup April 2014Hacker News Meetup April 2014
Hacker News Meetup April 2014
 
DevOps: Getting Started with Puppet on Windows
DevOps: Getting Started with Puppet on WindowsDevOps: Getting Started with Puppet on Windows
DevOps: Getting Started with Puppet on Windows
 
Behaviour driven development present
Behaviour driven development presentBehaviour driven development present
Behaviour driven development present
 
Morph your mindset for Continuous Delivery, Agile Roots 2014
Morph your mindset for Continuous Delivery,  Agile Roots 2014Morph your mindset for Continuous Delivery,  Agile Roots 2014
Morph your mindset for Continuous Delivery, Agile Roots 2014
 
PropErty based testing
PropErty based testingPropErty based testing
PropErty based testing
 
Performance and Beyond - Leandro Melendez
Performance and Beyond - Leandro MelendezPerformance and Beyond - Leandro Melendez
Performance and Beyond - Leandro Melendez
 
14 Habits of Great SQL Developers
14 Habits of Great SQL Developers14 Habits of Great SQL Developers
14 Habits of Great SQL Developers
 
Move test planning before implementation
Move test planning before implementationMove test planning before implementation
Move test planning before implementation
 
Moving to Continuous Delivery Without Breaking Your Code
Moving to Continuous Delivery Without Breaking Your CodeMoving to Continuous Delivery Without Breaking Your Code
Moving to Continuous Delivery Without Breaking Your Code
 
Just Enough for Innovation
Just Enough for InnovationJust Enough for Innovation
Just Enough for Innovation
 
The Five Stages of Chef Grief: My First 6 months with Chef, and Getting Aroun...
The Five Stages of Chef Grief: My First 6 months with Chef, and Getting Aroun...The Five Stages of Chef Grief: My First 6 months with Chef, and Getting Aroun...
The Five Stages of Chef Grief: My First 6 months with Chef, and Getting Aroun...
 
Continuous Development: Supporting a Release Model
Continuous Development: Supporting a Release ModelContinuous Development: Supporting a Release Model
Continuous Development: Supporting a Release Model
 
Getting By Without "QA"
Getting By Without "QA"Getting By Without "QA"
Getting By Without "QA"
 
Devops what it means to me
Devops what it means to meDevops what it means to me
Devops what it means to me
 
Show an Open Source Project Some Love and Start Using Travis-CI
Show an Open Source Project Some Love and Start Using Travis-CIShow an Open Source Project Some Love and Start Using Travis-CI
Show an Open Source Project Some Love and Start Using Travis-CI
 
Moving to Continuous Delivery without breaking everything
Moving to Continuous Delivery without breaking everythingMoving to Continuous Delivery without breaking everything
Moving to Continuous Delivery without breaking everything
 
GeeksLoveSand
GeeksLoveSandGeeksLoveSand
GeeksLoveSand
 
Quality Spy Overview
Quality Spy OverviewQuality Spy Overview
Quality Spy Overview
 

Plus de Julian Dunn

Technical Careers Beyond DevOps
Technical Careers Beyond DevOpsTechnical Careers Beyond DevOps
Technical Careers Beyond DevOpsJulian Dunn
 
Pull, Don't Push! Sensu Summit 2018 Talk
Pull, Don't Push! Sensu Summit 2018 TalkPull, Don't Push! Sensu Summit 2018 Talk
Pull, Don't Push! Sensu Summit 2018 TalkJulian Dunn
 
Now That I Have Choreography, What Do I Do With It?
Now That I Have Choreography, What Do I Do With It?Now That I Have Choreography, What Do I Do With It?
Now That I Have Choreography, What Do I Do With It?Julian Dunn
 
Distributed systems are hard; distributed systems of people are harder
Distributed systems are hard; distributed systems of people are harderDistributed systems are hard; distributed systems of people are harder
Distributed systems are hard; distributed systems of people are harderJulian Dunn
 
Orchestration? You Don't Need Orchestration. What You Want is Choreography.
Orchestration? You Don't Need Orchestration. What You Want is Choreography.Orchestration? You Don't Need Orchestration. What You Want is Choreography.
Orchestration? You Don't Need Orchestration. What You Want is Choreography.Julian Dunn
 
Configuration Management in a Containerized World
Configuration Management in a Containerized WorldConfiguration Management in a Containerized World
Configuration Management in a Containerized WorldJulian Dunn
 
Cooking with Chef on Windows: 2015 Edition
Cooking with Chef on Windows: 2015 EditionCooking with Chef on Windows: 2015 Edition
Cooking with Chef on Windows: 2015 EditionJulian Dunn
 
Automating That "Other" OS
Automating That "Other" OSAutomating That "Other" OS
Automating That "Other" OSJulian Dunn
 
Chef-NYC Announcements July 2014
Chef-NYC Announcements July 2014Chef-NYC Announcements July 2014
Chef-NYC Announcements July 2014Julian Dunn
 
Chef NYC Users' Group - Announcements for June 2014
Chef NYC Users' Group - Announcements for June 2014Chef NYC Users' Group - Announcements for June 2014
Chef NYC Users' Group - Announcements for June 2014Julian Dunn
 
Improving Your Mac Productivity
Improving Your Mac ProductivityImproving Your Mac Productivity
Improving Your Mac ProductivityJulian Dunn
 
Chef Cookbook Governance BoF at ChefConf
Chef Cookbook Governance BoF at ChefConfChef Cookbook Governance BoF at ChefConf
Chef Cookbook Governance BoF at ChefConfJulian Dunn
 
Chef and PowerShell Desired State Configuration
Chef and PowerShell Desired State ConfigurationChef and PowerShell Desired State Configuration
Chef and PowerShell Desired State ConfigurationJulian Dunn
 
What Makes a Good Cookbook?
What Makes a Good Cookbook?What Makes a Good Cookbook?
What Makes a Good Cookbook?Julian Dunn
 
Configuration Management Isn't Everything
Configuration Management Isn't EverythingConfiguration Management Isn't Everything
Configuration Management Isn't EverythingJulian Dunn
 
Cooking with Chef on Windows
Cooking with Chef on WindowsCooking with Chef on Windows
Cooking with Chef on WindowsJulian Dunn
 
An Introduction to DevOps with Chef
An Introduction to DevOps with ChefAn Introduction to DevOps with Chef
An Introduction to DevOps with ChefJulian Dunn
 
Chef Workflow Strategies at SecondMarket
Chef Workflow Strategies at SecondMarketChef Workflow Strategies at SecondMarket
Chef Workflow Strategies at SecondMarketJulian Dunn
 
What Your CDN Won't Tell You: Optimizing a News Website for Speed and Stability
What Your CDN Won't Tell You: Optimizing a News Website for Speed and StabilityWhat Your CDN Won't Tell You: Optimizing a News Website for Speed and Stability
What Your CDN Won't Tell You: Optimizing a News Website for Speed and StabilityJulian Dunn
 

Plus de Julian Dunn (20)

Technical Careers Beyond DevOps
Technical Careers Beyond DevOpsTechnical Careers Beyond DevOps
Technical Careers Beyond DevOps
 
Pull, Don't Push! Sensu Summit 2018 Talk
Pull, Don't Push! Sensu Summit 2018 TalkPull, Don't Push! Sensu Summit 2018 Talk
Pull, Don't Push! Sensu Summit 2018 Talk
 
Now That I Have Choreography, What Do I Do With It?
Now That I Have Choreography, What Do I Do With It?Now That I Have Choreography, What Do I Do With It?
Now That I Have Choreography, What Do I Do With It?
 
Distributed systems are hard; distributed systems of people are harder
Distributed systems are hard; distributed systems of people are harderDistributed systems are hard; distributed systems of people are harder
Distributed systems are hard; distributed systems of people are harder
 
Orchestration? You Don't Need Orchestration. What You Want is Choreography.
Orchestration? You Don't Need Orchestration. What You Want is Choreography.Orchestration? You Don't Need Orchestration. What You Want is Choreography.
Orchestration? You Don't Need Orchestration. What You Want is Choreography.
 
Chef on AIX
Chef on AIXChef on AIX
Chef on AIX
 
Configuration Management in a Containerized World
Configuration Management in a Containerized WorldConfiguration Management in a Containerized World
Configuration Management in a Containerized World
 
Cooking with Chef on Windows: 2015 Edition
Cooking with Chef on Windows: 2015 EditionCooking with Chef on Windows: 2015 Edition
Cooking with Chef on Windows: 2015 Edition
 
Automating That "Other" OS
Automating That "Other" OSAutomating That "Other" OS
Automating That "Other" OS
 
Chef-NYC Announcements July 2014
Chef-NYC Announcements July 2014Chef-NYC Announcements July 2014
Chef-NYC Announcements July 2014
 
Chef NYC Users' Group - Announcements for June 2014
Chef NYC Users' Group - Announcements for June 2014Chef NYC Users' Group - Announcements for June 2014
Chef NYC Users' Group - Announcements for June 2014
 
Improving Your Mac Productivity
Improving Your Mac ProductivityImproving Your Mac Productivity
Improving Your Mac Productivity
 
Chef Cookbook Governance BoF at ChefConf
Chef Cookbook Governance BoF at ChefConfChef Cookbook Governance BoF at ChefConf
Chef Cookbook Governance BoF at ChefConf
 
Chef and PowerShell Desired State Configuration
Chef and PowerShell Desired State ConfigurationChef and PowerShell Desired State Configuration
Chef and PowerShell Desired State Configuration
 
What Makes a Good Cookbook?
What Makes a Good Cookbook?What Makes a Good Cookbook?
What Makes a Good Cookbook?
 
Configuration Management Isn't Everything
Configuration Management Isn't EverythingConfiguration Management Isn't Everything
Configuration Management Isn't Everything
 
Cooking with Chef on Windows
Cooking with Chef on WindowsCooking with Chef on Windows
Cooking with Chef on Windows
 
An Introduction to DevOps with Chef
An Introduction to DevOps with ChefAn Introduction to DevOps with Chef
An Introduction to DevOps with Chef
 
Chef Workflow Strategies at SecondMarket
Chef Workflow Strategies at SecondMarketChef Workflow Strategies at SecondMarket
Chef Workflow Strategies at SecondMarket
 
What Your CDN Won't Tell You: Optimizing a News Website for Speed and Stability
What Your CDN Won't Tell You: Optimizing a News Website for Speed and StabilityWhat Your CDN Won't Tell You: Optimizing a News Website for Speed and Stability
What Your CDN Won't Tell You: Optimizing a News Website for Speed and Stability
 

Dernier

"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 

Dernier (20)

"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 

Chef Cookbook Testing and Continuous Integration

  • 1. Chef Cookbook Testing and Continuous Integration Julian C. Dunn Senior Consultant, Opscode, Inc. <jdunn@opscode.com> Friday, June 14, 13
  • 2. Why Write Cookbook Tests? • Catch development errors • Catch regressions • Code to requirements (TDD, BDD) • Smaller batch sizes == lower blast radius • Continuous delivery of cookbooks! • Build confidence that your infrastructure is working correctly Friday, June 14, 13
  • 4. Devops Is A Two-Way Street • It’s great when developers care about • uptime! • scaling! • deployment! • Put them on call! etc. etc. etc. Friday, June 14, 13
  • 5. Devops Is A Two-Way Street • Systems Administrators also have as much or more to learn from developers as well! Friday, June 14, 13
  • 6. Source Code Compiler Artifact Test Typical Development Workflow • Typical Software Development Workflow: • Write Source • Compile Source • Deploy Artifacts • Write Tests • Run Tests Friday, June 14, 13
  • 7. Source Code Compiler Artifact Test Typical Development Workflow • Source Code • The recipe for a computer program • Edited directly • Managed via Source Control Software Friday, June 14, 13
  • 8. Source Code Compiler Artifact Test Typical Development Workflow • Compiler • Takes source code and converts it into executable programs Friday, June 14, 13
  • 9. Source Code Compiler Artifact Test Typical Development Workflow • Artifact • Artifacts are executable programs created by compilers. • Compiled artifacts cannot be edited directly. Source code must be changed and re-compiled to produce a new build artifact. Friday, June 14, 13
  • 10. Source Code Compiler Artifact Test Typical Development Workflow • Testing • Write tests to verify that code works as intended • Run tests at different stages of the code lifecycle to ensure correctness Friday, June 14, 13
  • 11. Source Code Compiler Artifact Test Typical Development Workflow • When developing software, most time isn’t actually spent coding • 10-second changes to source code can take minutes to vet • Compiling code • Deploying code • Writing & Running tests Friday, June 14, 13
  • 13. Source Code Compiler Artifact Test Typical Development Workflow Fun! Boring! • Things that are fun: • Designing programs! • Writing source code! • Things that are boring: • Compiling code • Deploying artifacts • Running tests Friday, June 14, 13
  • 14. Look familiar to any Chefs?Friday, June 14, 13
  • 17. Source'Code' Compiler' Ar/fact' Test' Boooooooring • Too much time doing “paperwork” • vi recipes/something.rb • knife cookbook upload • sudo pkill -USR1 chef- client • #%$#%$ something broke, let me do that all again • Not enough time doing fun stuff! • Writing recipes Less Fun! More Boring! X Friday, June 14, 13
  • 18. Source'Code' Compiler' Ar/fact' Test' Boooooooring • Too much time doing “paperwork” • vi recipes/something.rb • knife cookbook upload • sudo pkill -USR1 chef- client • #%$#%$ something broke, let me do that all again • Not enough time doing fun stuff! • Writing recipes Less Fun! More Boring! XTH IS SUCKS! Friday, June 14, 13
  • 19. Chefs on a Plane What if... Friday, June 14, 13
  • 20. Chefs on a Plane What if...Worksta(on:+ Knife+cookbook+ create+ Worksta(on:+ Edit+cookbook+ Worksta(on:+ Knife+cookbook+ upload+ Provision+target+ Bootstrap+ target+ Worksta(on:+ Edit+target+run+ list+ ssh+target+ Target:+Run+ chef>client+ Target:(Run( chef/client( Worksta6on:( edit(cookbook( Worksta6on:( knife(cookbook( upload( ...we could automate all of this... Friday, June 14, 13
  • 21. Chefs on a Plane What if...Worksta(on:+ Knife+cookbook+ create+ Worksta(on:+ Edit+cookbook+ Worksta(on:+ Knife+cookbook+ upload+ Provision+target+ Bootstrap+ target+ Worksta(on:+ Edit+target+run+ list+ ssh+target+ Target:+Run+ chef>client+ Target:(Run( chef/client( Worksta6on:( edit(cookbook( Worksta6on:( knife(cookbook( upload( ...we could automate all of this... ...to run entirely on this... Friday, June 14, 13
  • 22. Chefs on a Plane What if... ...even while aboard this? Worksta(on:+ Knife+cookbook+ create+ Worksta(on:+ Edit+cookbook+ Worksta(on:+ Knife+cookbook+ upload+ Provision+target+ Bootstrap+ target+ Worksta(on:+ Edit+target+run+ list+ ssh+target+ Target:+Run+ chef>client+ Target:(Run( chef/client( Worksta6on:( edit(cookbook( Worksta6on:( knife(cookbook( upload( ...we could automate all of this... ...to run entirely on this... Friday, June 14, 13
  • 23. Source'Code' Compiler' Ar/fact' Test' Developing for Chef: Rapid Iteration • Less time waiting around for cookbook deploys and Chef runs • More frequent testing • Better code • Business needs met more quickly More Fun! Less Boring! X Friday, June 14, 13
  • 24. Code Can (Help) Friday, June 14, 13
  • 26. The Toolchain • You’re becoming a developer! • Reasonably powerful computer • Good editor Friday, June 14, 13
  • 27. Have a Good Computer • Virtualization is used to run acceptance tests • Running on a real virtualized “node” • Lots of memory (4GB+, 8GB recommended) • Fast disk (SSD) • Good processor (Intel i5+) • Modern OS X Friday, June 14, 13
  • 28. Tools • Chef (obviously) • Virtualization provider • Virtualization automation (Vagrant) • Cookbook dependency manager (Berkshelf, Librarian) • Unit and acceptance testing frameworks Friday, June 14, 13
  • 29. Software Testing Terminology and Chef Friday, June 14, 13
  • 30. Different Types of Testing • There are formal Software Engineering definitions for testing Friday, June 14, 13
  • 31. Different Types of Testing • There are formal Software Engineering definitions for testing • Unit test Friday, June 14, 13
  • 32. Different Types of Testing • There are formal Software Engineering definitions for testing • Unit test • Integration test Friday, June 14, 13
  • 33. Different Types of Testing • There are formal Software Engineering definitions for testing • Unit test • Integration test • Acceptance test Friday, June 14, 13
  • 34. Different Types of Testing • There are formal Software Engineering definitions for testing • Unit test • Integration test • Acceptance test • An easy explanation for SAs is ... Friday, June 14, 13
  • 35. • Unit Test: Signal Input What and When To Test Flickr user: Rain Rabbit Friday, June 14, 13
  • 36. • Unit Test: Signal Input • Did I send Chef the correct command? What and When To Test Flickr user: Rain Rabbit Friday, June 14, 13
  • 37. • Unit Test: Signal Input • Did I send Chef the correct command? • Signal Processing What and When To Test Flickr user: Rain Rabbit Friday, June 14, 13
  • 38. • Unit Test: Signal Input • Did I send Chef the correct command? • Signal Processing • Did Chef interpret my command correctly? What and When To Test Flickr user: Rain Rabbit Friday, June 14, 13
  • 39. • Unit Test: Signal Input • Did I send Chef the correct command? • Signal Processing • Did Chef interpret my command correctly? • Acceptance Test: Signal Output What and When To Test Flickr user: Rain Rabbit Friday, June 14, 13
  • 40. • Unit Test: Signal Input • Did I send Chef the correct command? • Signal Processing • Did Chef interpret my command correctly? • Acceptance Test: Signal Output • Did my expressed intent, executed by Chef, achieve the desired result? What and When To Test Flickr user: Rain Rabbit Friday, June 14, 13
  • 42. Chef Testing Tools • Signal Input • ChefSpec Friday, June 14, 13
  • 43. Chef Testing Tools • Signal Input • ChefSpec • Signal out • Chef Minitests & Minitest Handler Friday, June 14, 13
  • 44. Chef Testing Tools • Signal Input • ChefSpec • Signal out • Chef Minitests & Minitest Handler • Signal processing • Who cares; that’s what Opscode’s own tests for Chef are for! Friday, June 14, 13
  • 45. General Philosophy for Chef Testing Friday, June 14, 13
  • 46. General Philosophy for Chef Testing • Unit tests • ChefSpec assertion for every resource of interest • Each recipe should get its own test file Friday, June 14, 13
  • 47. General Philosophy for Chef Testing • Unit tests • ChefSpec assertion for every resource of interest • Each recipe should get its own test file • Acceptance tests • Anything that you couldn’t test in a unit test Friday, June 14, 13
  • 48. General Philosophy for Chef Testing • Unit tests • ChefSpec assertion for every resource of interest • Each recipe should get its own test file • Acceptance tests • Anything that you couldn’t test in a unit test • Don’t repeat yourself! Friday, June 14, 13
  • 50. ChefSpec Overview • Built on top of RSpec • Converge a Chef run in memory • Overrides all providers to take no action • Make assertions about the in-memory Chef run • Mock Ohai data (automatic attributes) with Fauxhai Friday, June 14, 13
  • 51. Example Recipe Part One include_recipe “java” user node['sauceproxy']['server']['user'] do   comment "SauceLabs Proxy User"   system true   action :create end directory node['sauceproxy']['server']['install_dir'] do   owner node['sauceproxy']['server']['user']   mode 00755   action :create end # Can't assume we have unzip package "unzip" do   action :install end execute "unzip-saucelabs-proxy" do   cwd node['sauceproxy']['server']['install_dir']   command "unzip -o #{Chef::Config[:file_cache_path]}/#{node['sauceproxy']['server']['zipfile']}"   action :nothing   notifies :restart, "service[sauceproxy]" end https://github.com/juliandunn/sauceproxy/blob/master/recipes/server.rb Friday, June 14, 13
  • 52. Example Recipe Part Two remote_file "#{Chef::Config[:file_cache_path]}/#{node['sauceproxy']['server']['zipfile']}" do source "#{node['sauceproxy']['server']['download_url']}/#{node['sauceproxy']['server']['zipfile']}"   action :create_if_missing   notifies :run, "execute[unzip-saucelabs-proxy]", :immediately end template "/etc/init.d/sauceproxy" do   source "sauceproxy.init.erb"   mode 00755   owner "root"   group "root"   action :create end template "/etc/sysconfig/sauceproxy" do   source "sauceproxy.sysconfig.erb"   mode 00644   owner "root"   group "root"   action :create end service "sauceproxy" do   supports :restart => true   action [:enable, :start] end Friday, June 14, 13
  • 53. Example ChefSpec Test: Setup describe 'sauceproxy::server' do let (:chef_run) do runner = ChefSpec::ChefRunner.new( platform: 'centos', version: '6.3' ) runner.node.set['sauceproxy']['server']['user'] = 'fake' runner.node.set['sauceproxy']['server']['install_dir'] = '/tmp/fake' runner.node.set['sauceproxy']['server']['version'] = '3.14159' runner.converge('sauceproxy::server') end Friday, June 14, 13
  • 54. Example ChefSpec Test: Expectations it 'should create a sauceproxy directory with the right ownership' do expect(chef_run).to create_directory('/tmp/fake') expect(chef_run.directory('/tmp/fake')).to be_owned_by('fake') end it 'should start a service called sauceproxy' do expect(chef_run).to start_service('sauceproxy') expect(chef_run).to set_service_to_start_on_boot('sauceproxy') end end Friday, June 14, 13
  • 56. ChefSpec: Expectations • Many expectations (assertions) possible • https://github.com/acrmp/chefspec#making- assertions • Don’t (just) restate static resources • Mock out data • Static resource assertions: good for regressions • Whoops, I deleted the service resource Friday, June 14, 13
  • 58. Chef Client Run Friday, June 14, 13
  • 59. Chef Client Run Friday, June 14, 13
  • 60. Acceptance Tests as Report Handler • Acceptance testing as a Chef Report Handler • Many tools (serverspec, bats, minitest) • I’ll demo Chef-MiniTest-Handler; most widely used Friday, June 14, 13
  • 61. MiniTest Handler Cookbook • http://community.opscode.com/cookbooks/minitest- handler • Installs Minitest Gems • Installs Chef Minitest Gems • Installs the Chef-Minitest-Handler Notification Handler for Chef-Client • Places test files from cookbooks on the target node as part of a Chef-client run Friday, June 14, 13
  • 62. MiniTest Files • Each recipe gets an individual test file. • recipes/server.rb • files/default/test/server_test.rb • Tests for each recipe are automatically loaded by the handler Friday, June 14, 13
  • 63. Example MiniTest require 'minitest/spec' describe_recipe 'sauceproxy::server' do it 'runs as a daemon' do service('sauceproxy').must_be_running end end http://tinyurl.com/minitest-examples for many more example tests Friday, June 14, 13
  • 64. Make this go on a with virtualization! Friday, June 14, 13
  • 65. Using Vagrant & Berkshelf to Iterate • Vagrant is virtualization middleware • Driven from Vagrantfile • Defines VM images, customization parameters, provisioners (Chef in our case) • Berkshelf is a cookbook dependency manager • Get dependent cookbooks from community API • Feed them to Vagrant Chef provisioner Friday, June 14, 13
  • 66. Example Vagrantfile Vagrant.configure("2") do |config| config.vm.hostname = "sauceproxy-berkshelf" config.vm.box = "opscode-centos-6.4" config.vm.box_url = "https://opscode-vm.s3.amazonaws.com/vagrant/ opscode_centos-6.4_chef-11.4.4.box" config.ssh.max_tries = 40 config.ssh.timeout = 120 config.vm.provision :chef_solo do |chef| chef.json = {} chef.run_list = [ "recipe[minitest-handler]", "recipe[sauceproxy::server]" ] end end Friday, June 14, 13
  • 67. % vagrant up Bringing Up Vagrant borkbork:~/Dropbox/devel/github/juliandunn/sauceproxy (master)$ vagrant up Bringing machine 'default' up with 'virtualbox' provider... [default] Importing base box 'centos-6.4'... [default] Matching MAC address for NAT networking... [default] Setting the name of the VM... [default] Clearing any previously set forwarded ports... [Berkshelf] Updating Vagrant's berkshelf: '/Users/juliandunn/.berkshelf/vagrant/ berkshelf-20130611-20810-rt7k01' [Berkshelf] Using sauceproxy (0.1.8) at path: '/Users/juliandunn/Dropbox/devel/github/juliandunn/ sauceproxy' [Berkshelf] Using minitest-handler (0.2.1) [Berkshelf] Using java (1.11.4) [Berkshelf] Using windows (1.8.10) [Berkshelf] Using chef_handler (1.1.4) [default] Creating shared folders metadata... [default] Clearing any previously set network interfaces... [default] Preparing network interfaces based on configuration... [default] Forwarding ports... [default] -- 22 => 2222 (adapter 1) [default] Booting VM... [default] Waiting for VM to boot. This can take a few minutes. Friday, June 14, 13
  • 68. % vagrant up Bringing Up Vagrant borkbork:~/Dropbox/devel/github/juliandunn/sauceproxy (master)$ vagrant up Bringing machine 'default' up with 'virtualbox' provider... [default] Importing base box 'centos-6.4'... [default] Matching MAC address for NAT networking... [default] Setting the name of the VM... [default] Clearing any previously set forwarded ports... [Berkshelf] Updating Vagrant's berkshelf: '/Users/juliandunn/.berkshelf/vagrant/ berkshelf-20130611-20810-rt7k01' [Berkshelf] Using sauceproxy (0.1.8) at path: '/Users/juliandunn/Dropbox/devel/github/juliandunn/ sauceproxy' [Berkshelf] Using minitest-handler (0.2.1) [Berkshelf] Using java (1.11.4) [Berkshelf] Using windows (1.8.10) [Berkshelf] Using chef_handler (1.1.4) [default] Creating shared folders metadata... [default] Clearing any previously set network interfaces... [default] Preparing network interfaces based on configuration... [default] Forwarding ports... [default] -- 22 => 2222 (adapter 1) [default] Booting VM... [default] Waiting for VM to boot. This can take a few minutes. Friday, June 14, 13
  • 69. Vagrant Run Continued [default] Waiting for VM to boot. This can take a few minutes. [default] VM booted and ready for use! GuestAdditions 4.2.12 running --- OK. [default] Setting hostname... [default] Configuring and enabling network interfaces... [default] Mounting shared folders... [default] -- /vagrant [default] -- /tmp/vagrant-chef-1/chef-solo-1/cookbooks [default] Running provisioner: chef_solo... Generating chef JSON and uploading... Running chef-solo... [2013-06-12T02:52:26+00:00] INFO: *** Chef 11.4.4 *** [2013-06-12T02:52:26+00:00] INFO: Setting the run_list to ["recipe[minitest- handler]", "recipe[sauceproxy::server]"] from JSON [2013-06-12T02:52:26+00:00] INFO: Run List is [recipe[minitest-handler], recipe[sauceproxy::server]] [2013-06-12T02:52:26+00:00] INFO: Run List expands to [minitest-handler, sauceproxy::server] [2013-06-12T02:52:26+00:00] INFO: Starting Chef Run for sauceproxy-berkshelf Friday, June 14, 13
  • 70. Vagrant Run Continued [2013-06-12T02:55:22+00:00] INFO: Chef Run complete in 175.788656866 seconds [2013-06-12T02:55:22+00:00] INFO: Running report handlers Run options: -v --seed 31883 # Running tests: recipe::java::openjdk#test_0001_installs the correct version of the jdk = 0.11 s = . recipe::java::openjdk#test_0002_properly sets JAVA_HOME environment variable = 0.04 s = . recipe::sauceproxy::server#test_0001_runs as a daemon = 0.09 s = . Finished tests in 0.244690s, 12.2604 tests/s, 12.2604 assertions/s. 3 tests, 3 assertions, 0 failures, 0 errors, 0 skips [2013-06-12T02:55:22+00:00] INFO: Report handlers complete Friday, June 14, 13
  • 71. Vagrant Run Continued [2013-06-12T02:55:22+00:00] INFO: Chef Run complete in 175.788656866 seconds [2013-06-12T02:55:22+00:00] INFO: Running report handlers Run options: -v --seed 31883 # Running tests: recipe::java::openjdk#test_0001_installs the correct version of the jdk = 0.11 s = . recipe::java::openjdk#test_0002_properly sets JAVA_HOME environment variable = 0.04 s = . recipe::sauceproxy::server#test_0001_runs as a daemon = 0.09 s = . Finished tests in 0.244690s, 12.2604 tests/s, 12.2604 assertions/s. 3 tests, 3 assertions, 0 failures, 0 errors, 0 skips [2013-06-12T02:55:22+00:00] INFO: Report handlers complete Friday, June 14, 13
  • 72. Minitests from Java cookbook ran too! [2013-06-12T02:55:22+00:00] INFO: Chef Run complete in 175.788656866 seconds [2013-06-12T02:55:22+00:00] INFO: Running report handlers Run options: -v --seed 31883 # Running tests: recipe::java::openjdk#test_0001_installs the correct version of the jdk = 0.11 s = . recipe::java::openjdk#test_0002_properly sets JAVA_HOME environment variable = 0.04 s = . recipe::sauceproxy::server#test_0001_runs as a daemon = 0.09 s = . Finished tests in 0.244690s, 12.2604 tests/s, 12.2604 assertions/s. 3 tests, 3 assertions, 0 failures, 0 errors, 0 skips [2013-06-12T02:55:22+00:00] INFO: Report handlers complete Friday, June 14, 13
  • 73. Minitests from Java cookbook ran too! [2013-06-12T02:55:22+00:00] INFO: Chef Run complete in 175.788656866 seconds [2013-06-12T02:55:22+00:00] INFO: Running report handlers Run options: -v --seed 31883 # Running tests: recipe::java::openjdk#test_0001_installs the correct version of the jdk = 0.11 s = . recipe::java::openjdk#test_0002_properly sets JAVA_HOME environment variable = 0.04 s = . recipe::sauceproxy::server#test_0001_runs as a daemon = 0.09 s = . Finished tests in 0.244690s, 12.2604 tests/s, 12.2604 assertions/s. 3 tests, 3 assertions, 0 failures, 0 errors, 0 skips [2013-06-12T02:55:22+00:00] INFO: Report handlers complete Friday, June 14, 13
  • 74. New Test/Dev Cycle Write Unit Tests Worked? Run ChefSpec No Write Recipe Code Write Acceptance Tests Yes Worked? Run Vagrant + Minitest Handler No vagrant destroy Yes Commit/Tag Code, etc. Friday, June 14, 13
  • 76. Continuous Integration Pipeline • Run unit tests in your pipeline • Run acceptance tests in your pipeline • Drive cookbook uploads as the output! Friday, June 14, 13
  • 77. Travis-CI Example for SauceProxy language: ruby gemfile:   - gemfiles/travis.gemfile rvm:   - "1.9.2"   - "1.9.3" script: bundle exec rake test:syntax test:lint test:spec notifications:   email:     - jdunn@opscode.com Friday, June 14, 13
  • 78. Rakefile Example • Too long to post here • Rake tasks for Foodcritic and ChefSpec • https://github.com/ juliandunn/sauceproxy/ blob/master/Rakefile Friday, June 14, 13
  • 80. ^#$%(#$ I broke the build Friday, June 14, 13
  • 81. Test Kitchen (alpha) • Run acceptance test suite on multiple OSes • Different fixtures for each, if desired • Different drivers (vagrant, ec2, lxc, etc.) • Hook up to Jenkins or other CI system if desired Friday, June 14, 13
  • 82. Test Kitchen Config File --- driver_plugin: vagrant platforms: - name: centos-6.4 driver_config: box: opscode-centos-6.4 box_url: https://opscode-vm.s3.amazonaws.com/vagrant/opscode_centos-6.4_provisionerless.box require_chef_omnibus: true - name: centos-5.9 driver_config: box: opscode-centos-5.9 box_url: https://opscode-vm.s3.amazonaws.com/vagrant/opscode_centos-5.9_provisionerless.box require_chef_omnibus: true suites: - name: default run_list: ["recipe[minitest-handler]", "recipe[sauceproxy::server]"] attributes: {} Friday, June 14, 13
  • 85. Resources • ChefSpec: https://github.com/acrmp/chefspec • Chef Minitest Handler: https://github.com/calavera/ minitest-chef-handler • Berkshelf: http://berkshelf.com/ • Vagrant: http://vagrantup.com/ • Test Kitchen: https://github.com/opscode/test-kitchen • Bento: https://github.com/opscode/bento • SauceProxy Sample Cookbook: https://github.com/ juliandunn/sauceproxy Friday, June 14, 13
  • 86. More on Testing • Chef-NYC: The Hows and Whys of Cookbook Testing • Seth Vargo (Author of ChefSpec, Fauxhai, many others) • http://www.meetup.com/Chef- NYC/events/122219772/ • June 25th in Manhattan Friday, June 14, 13
  • 87. Chef Fundamentals Training • Boston, July 11-12 (CompuWorks, 263 Summer St.) • eventbrite.com/event/ 6652057483 • Use code BOSTON- MEETUP to save 25%! Friday, June 14, 13
  • 88. Questions and Prizes Also, we’re hiring! Automate all the things for fun and profit! http://www.opscode.com/blog/careers/ (and/or see me after) Friday, June 14, 13