Casualにインフラテストへ入門した話

188abc8954f5a349f8df86c8586a9b1d?s=47 yudoufu
May 25, 2015

 Casualにインフラテストへ入門した話

Testing Casual Talk #2 LT

188abc8954f5a349f8df86c8586a9b1d?s=128

yudoufu

May 25, 2015
Tweet

Transcript

  1. 2.

    About me… Daichi Kamemoto (@yudoufu) • DevOps • Go! Go!

    Go! ʕ◔ϖ◔ʔ • PHP / iOS (Obj-C/Swift)
  2. 10.

    खݩͰςετ͠Α͏ • Test-kitchen • Chef Cookbook༻ͷςετϋʔωε • VMͷىಈɺ൓өɺςετ࣮ߦͳͲ • Serverspec

    • mizzy͞Μ࡞αʔόςετπʔϧ • RSpecͰαʔό಺෦ͷঢ়ଶςετΛهड़ ओʹͬͪ͜
  3. 11.

    ςετ؀ڥߏங • ྆ํChef DK(Development Kit)ʹؚ·ΕͯΔ • chefίϚϯυͰcookbook࡞ͬͯΈΔͱɻɻɻ % brew cask

    install virtualbox % brew cask install vagrant % brew cask install chafdk % chef generate cookbook test-cookbook
  4. 12.

    test-cookbook !"" .gitignore !"" .kitchen.yml !"" Berksfile !"" README.md !""

    chefignore !"" metadata.rb !"" recipes # %"" default.rb !"" spec # !"" spec_helper.rb # %"" unit # %"" recipes # %"" default_spec.rb %"" test %"" integration !"" default # %"" serverspec # %"" default_spec.rb %"" helpers %"" serverspec %"" spec_helper.rb ࠷ॳ͔Β ͋Δʂ ࠷ॳ͔Β ͋Δʂ
  5. 23.

    test-kitchenରԠํ๏ • Gemfileͷ௥Ճͱɺspec_helperͰͷLoad test %"" integration !"" default # %""

    serverspec # !"" Gemfile # %"" default_spec.rb %"" helpers %"" serverspec %"" spec_helper.rb
  6. 25.

    spec_helperͰLoad • spec_helperͷ಺༰Λमਖ਼ % ${EDITOR} test/integration/helpers/ serverspec/spec_helper.rb ``` require 'serverspec'

    require 'infrataster/rspec' set :backend, :exec Infrataster::Server.define(:app, ‘127.0.0.1') ``` ର৅αʔόΛ ϩʔΧϧʹ