Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Devopsdays Vancouver 2013 - Test Kitchen

Devopsdays Vancouver 2013 - Test Kitchen

We've come a long way with infrastructure as code and are getting closer to better test frameworks and facilities. Test Kitchen was originally developed with Chef in mind, but it is now becoming a standard across different configuration management tools.

This talk will focus on how Test Kitchen can help you shorten the feedback cycle during the development of infrastructure code and discover how it plays nice with other existing tools like ChefSpec, RSpec Puppet, and Vagrant.

Learn about unit and smoke testing infrastructure as code in a Test Driven Development (TDD) cycle. Besides the technology we will look into the benefits of this faster feedback cycle and the current/future state of infrastructure as code testing.

9891e8299426fb9b6e361b84b3155a2d?s=128

Fletcher Nichol

October 26, 2013
Tweet

More Decks by Fletcher Nichol

Other Decks in Technology

Transcript

  1. Test Kitchen 1.0 A Config Management-Neutral Integration Testing Tool Fletcher

    Nichol October 26, 2013 DevOpsDays Vancouver 2013
  2. I love big screens!

  3. None
  4. None
  5. None
  6. Ah.

  7. Confidence

  8. Test Kitchen

  9. A test harness tool to execute your configured code on

    one or more platforms in isolation
  10. Currently run Chef converges

  11. Seeking input from other configuration management communities very soon

  12. commit fda10bb71cc45c7eebeb4355f8dafa2b55f00709 Author: Fletcher Nichol <fnichol@nichol.ca> Date: Sat Dec 1

    10:51:52 2012 -0700 Jamie: A Chef Convergence Integration Test Harness. Also, what the heck I am getting into here?
  13. commit c8303426363a50a08137e518e124dad31facb9f1 Author: Fletcher Nichol <fnichol@nichol.ca> Date: Mon Jan 28

    22:22:08 2013 -0700 Thank you Jamie, hello Test Kitchen. This is a first-pass renaming of the Jamie project to test-kitchen. The following are major breaking changes: * all constant references of `Jamie` have been renamed to `Kitchen` * the .jamie.yml file has been renamed to .kitchen.yml * the binary bin/jamie has been renamed to bin/kitchen * the Rake task namespace :jamie is now :kitchen * the Thor task namespace :jamie is now :kitchen * the `kitchen new_plugin` subcommand will create a 'kitchen-*' gem project
  14. None
  15. Happiness!

  16. None
  17. Goals

  18. Simple workflow

  19. Stressing speed

  20. Optimizing for freshness of code & config

  21. Declarative

  22. Static configuration

  23. Dead simple CI integration

  24. $ bundle install $ rake kitchen:all

  25. Testing freedom

  26. Framework agnostic

  27. Concurrent execution

  28. Isolated log files

  29. Virtualization freedom

  30. Decoupled (plugin architecture)

  31. Explicit vs. implicit

  32. Ecosystem Demo Concepts

  33. Ecosystem Demo Concepts

  34. Test Kitchen runs suites on target platforms as instances using

    drivers
  35. Platform

  36. Operating system or target system Platform

  37. Operating system version Platform

  38. Hardware architecture, networking, virtualization, etc. Platform

  39. It has a name Platform

  40. Suite

  41. Suite The Chef configuration

  42. Suite A run list, node attributes

  43. Suite It has a name

  44. Instance

  45. A suite + platform Instance

  46. Name is auto-generated Instance

  47. Has associated actions: create, converge, setup, verify, destroy Instance

  48. Driver

  49. An implementation of instance actions Driver

  50. Packaged as a RubyGem Driver

  51. One driver per instance Driver

  52. Defines its own configuration requirements Driver

  53. Bonus!

  54. Test Kitchen runs suites on target platforms as instances using

    drivers and lets you optionally run tests on them to verify state
  55. How?

  56. Busser

  57. “Your Mars Rover on a converged node” - me

  58. “Your tests, your way!” - also me

  59. Only dependency is Ruby (and thor gem)

  60. Prepares node for test suites

  61. Installs test runner plugins

  62. busser-bash, busser-bats, busser-minitest, busser-shunit2, busser-aruba, busser- serverspec, busser-rspec, busser-shpec, busser-cucumber

  63. No tests? No problem!

  64. Ecosystem Demo Concepts

  65. TK::Demorama.new.start!

  66. Ecosystem Demo Concepts

  67. Linting

  68. Foodcritic

  69. puppet-lint

  70. Unit

  71. ChefSpec

  72. rspec-puppet

  73. Integration

  74. Test Kitchen

  75. More? Tell me! [insert website here]

  76. Infrastructure

  77. Cucumber-Chef

  78. TestLab

  79. Leibniz

  80. Vagabond

  81. Honorable Mention

  82. Berkshelf

  83. Vagrant

  84. Bonus!

  85. Test Kitchen! Guide! Soon! DRAFT

  86. Confidence

  87. Thanks! Fletcher Nichol @fnichol github.com/fnichol hw-ops.com/people#fletcher

  88. Credits! • http://www.flickr.com/photos/michaelschiltz/4993352001/ • http://www.flickr.com/photos/nazly/6867975450/ • http://www.flickr.com/photos/jpdaigle/59942231/ • http://www.flickr.com/photos/absent/2157057475/ •

    http://www.flickr.com/photos/adampenney/2424992539/ • http://www.flickr.com/photos/robboudon/6035265163/ • http://www.flickr.com/photos/waferboard/4659835234/ • http://www.flickr.com/photos/28096801@N05/4916430883/ • http://www.flickr.com/photos/brandonshigeta/4374998947/ • http://www.flickr.com/photos/legin101/5210511841/ • http://www.flickr.com/photos/hoteldelapaixgeneve/ 5592080585/ • http://www.flickr.com/photos/the_eggwhite/8136644446/ • http://www.flickr.com/photos/34667924@N08/3853027446/ • http://www.flickr.com/photos/seattlemunicipalarchives/ 6871310641/ • http://www.flickr.com/photos/nasamarshall/7698035402/ • http://www.flickr.com/photos/pankseelen/6339570829/ • http://www.flickr.com/photos/fnichol/galleries/ 72157636856466494/ • http://www.flickr.com/photos/51342261@N08/5478506479/ • http://www.flickr.com/photos/parkeyparker/4316936774/ • http://www.flickr.com/photos/swfphotos/7498333224/ • http://www.flickr.com/photos/mcdarius/8524417604/ • http://www.flickr.com/photos/bamboo-adventure/ 3530133273/ • http://www.flickr.com/photos/robboudon/6035816980/