ã¯ããã«
- test-kitchen ãèµ°ãããå¾ã§ serverspec ã使ã£ã¦ãã¹ãã試ãã¦ããè¨äºãè¦ã¤ããã®ã§è©¦ã
- æµ·å¤ã§ã serverspec ãåºãåãå ¥ãããã¦ãã¦æ¬å½ã«ç´ æ´ãããã¨æã
- test-kitchen ã®ãã©ã¤ãã¨ã㦠kitchen-docker ã使ã
åè
æºå
test-kitchen
ã kitchen-docker
çã¯æ¢ã«ã¤ã³ã¹ãã¼ã«ããã¦ããã¨ããç¶æ
ãã...
serverspec ã®ã¤ã³ã¹ãã¼ã«
sudo gem install serverspec --no-ri --no-rdoc -V
cookbook ã® test ãã£ã¬ã¯ããªã« spec ãã¡ã¤ã«ãç½®ã
ä»åã¯ãã¡ãã® cookbook ã使ã£ã¦ãã¹ãããã
mkdir elasticsearch_cookbook/test/integration/default/serverspec
ä¸è¨ã® spec
ãã¡ã¤ã«ãè¨ç½®ãã serverspec
ãã£ã¬ã¯ããªãä½æã㦠*_spec.rb
ãä½æããã
vim elasticsearch_cookbook/test/integration/default/serverspec/check_spec.rb
check_spec.rb
ã®ä¸èº«ã¯ä»¥ä¸ã®éãã
require 'serverspec' include Serverspec::Helper::Exec include Serverspec::Helper::DetectOS RSpec.configure do |c| c.before :all do c.path = '/sbin:/usr/sbin' end end describe package('elasticsearch') do it { should be_installed } end describe process('java') do it { should be_running } its(:args) { should match /elasticsearch/ } end
ãã¹ããã¦ã¿ã
ã¨ã«ããæµããè¦ã
test-kitchen ã®ä½¿ãæ¹ã¯ãã¡ããåèã«ãã¤ã¤ kitchen verify
ãå®è¡ããã
kitchen verify
ããã¦æ«ãããã¨...
ä¸è¨ã®ããã« cookbook
ããã¹ãç¨ã® docker
ã³ã³ããã«é©ç¨å¾ãserverspec
ãå©ç¨ããæºåã¨ã㦠busser
ã®è¨å®ã¨ busser
ãã©ã°ã¤ã³ã® busser-serverspec ãã¤ã³ã¹ãã¼ã«ãã㦠serverspec
ã«ãããã¹ããéå§ãããã
以ä¸ã¯ãã¾ããkitchen verify
ããå¾ã§ kitchen list
ãã¦ããã« kitchen verify
ãã¦ããåç»ãserverspec
ãåä½ãã¦ãããã¨ããããããªã
ã¤ãã§ã« recipe
ãä¿®æ£ã㦠kitchen converge
ãã¦ããã® kitchen verify
ã®æµãã
åãã¡ã£ã¡ãããã©é°å²æ°ã¯ä¼ããããª...
busser ã¨ã¯
ä»æ´ã§å¤§å¤æ縮ã ã busser ã¨ã¯...
Busser is a test setup and execution framework designed to work on remote nodes whose system dependencies cannot be relied upon, except for an Omnibus installation of Chef. It uses a plugin architecture to add support for different testing strategies such minitest, cucumber, bash, etc.
ä¸è¨ã®éãããã©ã°ã¤ã³ã¢ã¼ããã¯ãã£ãæ¡ç¨ãããªã¢ã¼ããã¹ãã§åä½ããããã«è¨è¨ããããã¹ããã¬ã¼ã ã¯ã¼ã¯ãä»åããã®ãã©ã°ã¤ã³ã®ä¸ã¤ã¨ã㦠busser-serverspec ãå©ç¨ã㦠cookbook
ãé©ç¨ããã³ã³ããã«å¯¾ãã¦ãã¹ããè¡ããã¨ã«ãªãã
æå¾ã«
kitchen-test
ã¨serverspec
ãé£æºããããã¨ã§kitchen
ã³ãã³ãã§serverspec
ã§ã®ãã¹ããè¡ããããã«ãªã£ã¦ãã¹ãããã身è¿ã«æãããã- ä»å¾ã¯
cookbook
ãæ¸ãå ´åã«ã¯test-kitchen
+serverspec
ã§ãã¹ãããããã¨ã«ããã - ãã¯ããã«ãã«ãè¨è¼ããããæµ·å¤ã§ã serverspec ãåºãåãå ¥ãããã¦ãã¦æ¬å½ã«ç´ æ´ãããã¨æã