SlideShare une entreprise Scribd logo
1  sur  34
@nathenharvey
Introduction to Test Kitchen
@nathenharvey
Hello!
Nathen Harvey
VP, Community
Development
Chef
@nathenharvey
@nathenharvey
Why Testing?
• Move fast with a safety net
• Decrease feedback cycles
• Increase confidence
• Prevent regressions
• Scale
@nathenharvey
Developing Infrastructure Automation
• Write the automation
• Static analysis
• Unit testing
• Local integration testing
Create an infrastructure that matches production
Run automation
Validate results
Destroy
• Commit to version control
• Submit to pipeline
@nathenharvey
Zoom-in on Integration Testing
• Create infrastructure that matches production
• Run the automation
• Verify the results
• Destroy the infrastructure
@nathenharvey
Test Kitchen
Test harness to execute
infrastructure code on one or
more platforms in isolation.
@nathenharvey
The Test Kitchen
platforms:
- name: ubuntu-16.04
- name: centos-7
platforms
@nathenharvey
The Test Kitchen
driver:
name: vagrant
platforms:
- name: ubuntu-16.04
- name: centos-7
kitchen create driver
platforms
@nathenharvey
Zoom-in on Integration Testing
Create infrastructure that matches production
• Run the automation
• Verify the results
• Destroy the infrastructure
@nathenharvey
The Test Kitchen
driver:
name: vagrant
platforms:
- name: ubuntu-16.04
- name: centos-7
provisioner:
name: chef_zero
kitchen create driver
platforms
kitchen converge provisioner
@nathenharvey
Chef Recipe
package 'git' do
action :install
end
@nathenharvey
Zoom-in on Integration Testing
Create infrastructure that matches production
Run the automation
• Verify the results
• Destroy the infrastructure
@nathenharvey
InSpec
• Open-source framework
• Infrastructure testing
• Make assertions about state of resources in the infrastructure
@nathenharvey
Sample InSpec code
describe service('apache2') do
it { should be_running }
end
describe port(80) do
it { should be_listening }
end
describe http('http://localhost', enable_remote_worker: true) do
its('status') { should cmp 200 }
its('body') { should match /Welcome to / }
end
@nathenharvey
The Test Kitchen
driver:
name: vagrant
platforms:
- name: ubuntu-16.04
- name: centos-7
provisioner:
name: chef_zero
verifier:
name: inspec
kitchen create driver
platforms
kitchen converge provisioner
kitchen verify verifier
@nathenharvey
Verify the results with InSpec
describe package('git') do
it { should be_installed }
end
describe command('git') do
it { should exist }
end
describe command('which git') do
its('exit_status') { should eq 0 }
end
@nathenharvey
Zoom-in on Integration Testing
Create infrastructure that matches production
Run the automation
Verify the results
• Destroy the infrastructure
@nathenharvey
The Test Kitchen
driver:
name: vagrant
platforms:
- name: ubuntu-16.04
- name: centos-7
provisioner:
name: chef_zero
verifier:
name: inspec
kitchen create driver
platforms
kitchen converge provisioner
kitchen verify verifier
kitchen destroy
@nathenharvey
Zoom-in on Integration Testing
Create infrastructure that matches production
Run the automation
Verify the results
Destroy the infrastructure
@nathenharvey
The Test Kitchen
kitchen create driver
platforms
kitchen converge provisioner
kitchen verify verifier
kitchen destroy
kitchen test
@nathenharvey
The Test Kitchen
kitchen create driver
platforms
kitchen converge provisioner
kitchen verify verifier
kitchen destroy
kitchen test
kitchen destroy
@nathenharvey
The Test Kitchen
kitchen create driver
platforms
kitchen converge provisioner
kitchen verify verifier
kitchen destroy
kitchen test
kitchen destroy
kitchen create
@nathenharvey
The Test Kitchen
kitchen create driver
platforms
kitchen converge provisioner
kitchen verify verifier
kitchen destroy
kitchen test
kitchen destroy
kitchen create
kitchen converge
@nathenharvey
The Test Kitchen
kitchen create driver
platforms
kitchen converge provisioner
kitchen verify verifier
kitchen destroy
kitchen test
kitchen destroy
kitchen create
kitchen converge
kitchen verify
@nathenharvey
The Test Kitchen
kitchen create driver
platforms
kitchen converge provisioner
kitchen verify verifier
kitchen destroy
kitchen test
kitchen destroy
kitchen create
kitchen converge
kitchen verify
kitchen destroy
@nathenharvey
More Test Kitchen <3
@nathenharvey
The Test Kitchen
driver:
name: kitchen create driver
@nathenharvey
The Test Kitchen
provisioner:
name:
kitchen converge provisioner
@nathenharvey
The Test Kitchen
verifier:
name:
kitchen verify verifier
@nathenharvey
Get Started with Test Kitchen
• Install Chef Development Kit - https://downloads.chef.io/chefdk
Test Kitchen
InSpec
• Install Driver Requirements
Vagrant – VirtualBox & Vagrant
Docker – Docker
GCE – None, but best to Google Cloud SDK installed
EC2 – None, but you need an AWS account
@nathenharvey
Use, Share, Contribute!
• Test Kitchen
https://kitchen.ci/
https://github.com/test-kitchen
• InSpec
https://www.inspec.io/
https://github.com/chef/inspec
• Code from this presentation - https://github.com/nathenharvey/intro-to-test-
kitchen
@nathenharvey
Join us on Slack
• http://community-slack.chef.io
• #general (for Chef stuff)
• #test-kitchen
• #inspec
The Chef community
believes that diversity is one
of our biggest strengths!
YOU are welcome here!
@nathenharvey
What questions can I answer for you?
Nathen Harvey
VP, Community
Development
Chef
@nathenharvey

Contenu connexe

Tendances

Dennis Benkert - The Dog Ate My Deployment - Symfony Usergroup Berlin March ...
Dennis Benkert -  The Dog Ate My Deployment - Symfony Usergroup Berlin March ...Dennis Benkert -  The Dog Ate My Deployment - Symfony Usergroup Berlin March ...
Dennis Benkert - The Dog Ate My Deployment - Symfony Usergroup Berlin March ...
D
 
The Dog Ate My Deployment - Symfony Usergroup Cologne July 2013
The Dog Ate My Deployment - Symfony Usergroup Cologne July 2013The Dog Ate My Deployment - Symfony Usergroup Cologne July 2013
The Dog Ate My Deployment - Symfony Usergroup Cologne July 2013
D
 
The Dog Ate My Deployment - PHP Uncoference September 2013
The Dog Ate My Deployment - PHP Uncoference September 2013The Dog Ate My Deployment - PHP Uncoference September 2013
The Dog Ate My Deployment - PHP Uncoference September 2013
D
 

Tendances (20)

Continuous Testing
Continuous TestingContinuous Testing
Continuous Testing
 
Using CI for continuous delivery Part 1
Using CI for continuous delivery Part 1Using CI for continuous delivery Part 1
Using CI for continuous delivery Part 1
 
DevOp with Me!
DevOp with Me!DevOp with Me!
DevOp with Me!
 
Introduction to Go
Introduction to GoIntroduction to Go
Introduction to Go
 
At Your Service: Using Jenkins in Operations
At Your Service: Using Jenkins in OperationsAt Your Service: Using Jenkins in Operations
At Your Service: Using Jenkins in Operations
 
Dennis Benkert - The Dog Ate My Deployment - Symfony Usergroup Berlin March ...
Dennis Benkert -  The Dog Ate My Deployment - Symfony Usergroup Berlin March ...Dennis Benkert -  The Dog Ate My Deployment - Symfony Usergroup Berlin March ...
Dennis Benkert - The Dog Ate My Deployment - Symfony Usergroup Berlin March ...
 
The Dog Ate My Deployment - Symfony Usergroup Cologne July 2013
The Dog Ate My Deployment - Symfony Usergroup Cologne July 2013The Dog Ate My Deployment - Symfony Usergroup Cologne July 2013
The Dog Ate My Deployment - Symfony Usergroup Cologne July 2013
 
The Dog Ate My Deployment - PHP Uncoference September 2013
The Dog Ate My Deployment - PHP Uncoference September 2013The Dog Ate My Deployment - PHP Uncoference September 2013
The Dog Ate My Deployment - PHP Uncoference September 2013
 
Intermediate/Compliance training Guide
Intermediate/Compliance training GuideIntermediate/Compliance training Guide
Intermediate/Compliance training Guide
 
Automating Perl deployments with Hudson
Automating Perl deployments with HudsonAutomating Perl deployments with Hudson
Automating Perl deployments with Hudson
 
How Atlassian's Build Engineering Team Has Scaled to 150k Builds Per Month an...
How Atlassian's Build Engineering Team Has Scaled to 150k Builds Per Month an...How Atlassian's Build Engineering Team Has Scaled to 150k Builds Per Month an...
How Atlassian's Build Engineering Team Has Scaled to 150k Builds Per Month an...
 
Octopus Deploy @Erie Day of Code
Octopus Deploy @Erie Day of CodeOctopus Deploy @Erie Day of Code
Octopus Deploy @Erie Day of Code
 
Jenkins introduction
Jenkins introductionJenkins introduction
Jenkins introduction
 
Let’s start Continuous Integration with jenkins
Let’s start Continuous Integration with jenkinsLet’s start Continuous Integration with jenkins
Let’s start Continuous Integration with jenkins
 
Continuous delivery with open source tools
Continuous delivery with open source toolsContinuous delivery with open source tools
Continuous delivery with open source tools
 
Anatomy of a Continuous Integration and Delivery (CICD) Pipeline
Anatomy of a Continuous Integration and Delivery (CICD) PipelineAnatomy of a Continuous Integration and Delivery (CICD) Pipeline
Anatomy of a Continuous Integration and Delivery (CICD) Pipeline
 
Continuous testing and deployment in Perl (London.pm Technical Meeting Octobe...
Continuous testing and deployment in Perl (London.pm Technical Meeting Octobe...Continuous testing and deployment in Perl (London.pm Technical Meeting Octobe...
Continuous testing and deployment in Perl (London.pm Technical Meeting Octobe...
 
Getting started with Octopus Deploy
Getting started with Octopus DeployGetting started with Octopus Deploy
Getting started with Octopus Deploy
 
Rise of the Machines - Automate your Development
Rise of the Machines - Automate your DevelopmentRise of the Machines - Automate your Development
Rise of the Machines - Automate your Development
 
Legacy Dependency Killer - Utah Code Camp 2014
Legacy Dependency Killer - Utah Code Camp 2014Legacy Dependency Killer - Utah Code Camp 2014
Legacy Dependency Killer - Utah Code Camp 2014
 

Similaire à Introduction to Test Kitchen

Stages of a pipeline
Stages of a pipelineStages of a pipeline
Stages of a pipeline
Tapu Saha
 
Sample for approval
Sample for approvalSample for approval
Sample for approval
Tapu Saha
 
Test kitchen 1.0 - Fletcher Nichol
Test kitchen 1.0 - Fletcher NicholTest kitchen 1.0 - Fletcher Nichol
Test kitchen 1.0 - Fletcher Nichol
Devopsdays
 
Automated testing DrupalCamp in Asheville
Automated testing DrupalCamp in AshevilleAutomated testing DrupalCamp in Asheville
Automated testing DrupalCamp in Asheville
Promet Source
 
Continuous deployment steve povilaitis
Continuous deployment   steve povilaitisContinuous deployment   steve povilaitis
Continuous deployment steve povilaitis
Steve Povilaitis
 

Similaire à Introduction to Test Kitchen (20)

Effective Testing with Ansible and InSpec
Effective Testing with Ansible and InSpecEffective Testing with Ansible and InSpec
Effective Testing with Ansible and InSpec
 
What is Test Kitchen
What is Test KitchenWhat is Test Kitchen
What is Test Kitchen
 
Stages of a pipeline
Stages of a pipelineStages of a pipeline
Stages of a pipeline
 
Sample for approval
Sample for approvalSample for approval
Sample for approval
 
Test kitchen 1.0 - Fletcher Nichol
Test kitchen 1.0 - Fletcher NicholTest kitchen 1.0 - Fletcher Nichol
Test kitchen 1.0 - Fletcher Nichol
 
Sistemas operacionais 12
Sistemas operacionais 12Sistemas operacionais 12
Sistemas operacionais 12
 
Automated testing DrupalCamp in Asheville
Automated testing DrupalCamp in AshevilleAutomated testing DrupalCamp in Asheville
Automated testing DrupalCamp in Asheville
 
Enabling Agile Testing Through Continuous Integration Agile2009
Enabling Agile Testing Through Continuous Integration Agile2009Enabling Agile Testing Through Continuous Integration Agile2009
Enabling Agile Testing Through Continuous Integration Agile2009
 
Terraform Testing with InSpec Demo
Terraform Testing with InSpec DemoTerraform Testing with InSpec Demo
Terraform Testing with InSpec Demo
 
Continuous deployment steve povilaitis
Continuous deployment   steve povilaitisContinuous deployment   steve povilaitis
Continuous deployment steve povilaitis
 
Test Design for Fully Automated Build Architectures
Test Design for Fully Automated Build ArchitecturesTest Design for Fully Automated Build Architectures
Test Design for Fully Automated Build Architectures
 
Automation for Anyone at Nutanix NEXT 2017 US
Automation for Anyone at Nutanix NEXT 2017 USAutomation for Anyone at Nutanix NEXT 2017 US
Automation for Anyone at Nutanix NEXT 2017 US
 
Automated Web Testing using JavaScript
Automated Web Testing using JavaScriptAutomated Web Testing using JavaScript
Automated Web Testing using JavaScript
 
Continuous Testing in the Cloud
Continuous Testing in the CloudContinuous Testing in the Cloud
Continuous Testing in the Cloud
 
Continuous Integration as a Way of Life
Continuous Integration as a Way of LifeContinuous Integration as a Way of Life
Continuous Integration as a Way of Life
 
Test-Driven Infrastructure with Puppet, Test Kitchen, Serverspec and RSpec
Test-Driven Infrastructure with Puppet, Test Kitchen, Serverspec and RSpecTest-Driven Infrastructure with Puppet, Test Kitchen, Serverspec and RSpec
Test-Driven Infrastructure with Puppet, Test Kitchen, Serverspec and RSpec
 
WordPress Acceptance Testing, Solved!
WordPress Acceptance Testing, Solved!WordPress Acceptance Testing, Solved!
WordPress Acceptance Testing, Solved!
 
Continuous Deployment of your Application @jSession#5
Continuous Deployment of your Application @jSession#5Continuous Deployment of your Application @jSession#5
Continuous Deployment of your Application @jSession#5
 
Automated Database Deployment at SQL Rally
Automated Database Deployment at SQL RallyAutomated Database Deployment at SQL Rally
Automated Database Deployment at SQL Rally
 
FV04_MostoviczT_RAD
FV04_MostoviczT_RADFV04_MostoviczT_RAD
FV04_MostoviczT_RAD
 

Plus de Nathen Harvey

Plus de Nathen Harvey (9)

Accelerate Your DevOps Journey
Accelerate Your DevOps JourneyAccelerate Your DevOps Journey
Accelerate Your DevOps Journey
 
Continuous Delivery - GDG Cloud Baltimore
Continuous Delivery - GDG Cloud BaltimoreContinuous Delivery - GDG Cloud Baltimore
Continuous Delivery - GDG Cloud Baltimore
 
Using Error Budgets to Prioritize Work
Using Error Budgets to Prioritize WorkUsing Error Budgets to Prioritize Work
Using Error Budgets to Prioritize Work
 
Testing Terraform
Testing TerraformTesting Terraform
Testing Terraform
 
DevOps Days India Keynote
DevOps Days India KeynoteDevOps Days India Keynote
DevOps Days India Keynote
 
Introduction to Infrastructure as Code & Automation / Introduction to Chef
Introduction to Infrastructure as Code & Automation / Introduction to ChefIntroduction to Infrastructure as Code & Automation / Introduction to Chef
Introduction to Infrastructure as Code & Automation / Introduction to Chef
 
Step AFK: Practical Advice for Career Adavancement
Step AFK: Practical Advice for Career AdavancementStep AFK: Practical Advice for Career Adavancement
Step AFK: Practical Advice for Career Adavancement
 
Walk This Way - An Introduction to DevOps
Walk This Way - An Introduction to DevOpsWalk This Way - An Introduction to DevOps
Walk This Way - An Introduction to DevOps
 
Mongo db at_customink
Mongo db at_custominkMongo db at_customink
Mongo db at_customink
 

Dernier

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Dernier (20)

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 

Introduction to Test Kitchen