Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Ruby tools for Infrastructure Engineer (hbstyle...
Search
rrreeeyyy
June 13, 2014
Technology
550
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Ruby tools for Infrastructure Engineer (hbstyle-2014-0612)
rrreeeyyy
June 13, 2014
More Decks by rrreeeyyy
See All by rrreeeyyy
Reliability in the Age of AI: Engineering for AI Velocity
rrreeeyyy
0
160
Rethinking Incident Response: Context-Aware AI in Practice - Incident Buddy Edition -
rrreeeyyy
0
250
Rethinking Incident Response: Context-Aware AI in Practice
rrreeeyyy
3
2.5k
Incident Response Practices: Waroom's Features and Future Challenges
rrreeeyyy
0
310
An Efficient Incident Response Training with AI / SRE NEXT 2024 Sponsor Session
rrreeeyyy
1
6.2k
カンファレンスから見る SRE トレンド 2024 / SRE Trends from Conferences in 2024 #SRE_Findy
rrreeeyyy
4
2.6k
信頼性の育て方 / mackerel-meetup-15
rrreeeyyy
10
3k
SRE の歩き方・進め方 / sre-walk-through-procedure
rrreeeyyy
0
9k
「信頼性」を保ちつつ大規模サービスをリニューアルする / cookpad-tech-kitchen-service-embedded-sres
rrreeeyyy
11
13k
Other Decks in Technology
See All in Technology
デジタル・デザイン:次の50年を描く「進化する青写真」
y150saya
0
820
ループエンジニアリングでE2Eテストを実践
noriyukitakei
0
310
インフラ寄りSREでも 開発に踏み出せる〜境界を越えてユーザー体験に向き合いたい〜
sansantech
PRO
0
2.4k
Foxgloveについて 実際にExtensionを開発して公開するまでの話 / About Foxglove: The Story of Developing and Releasing an Extension
ry0_ka
0
180
脱金融のフューチャー・デザイン / Future Design Beyond Finance
ks91
PRO
0
140
FinOps X 2026 Recap from Engineer Side #JapanFinOps
chacco38
0
270
AI時代のエンジニアキャリアについて今一度考える
sakamoto_582
2
1.3k
記録をかんたんに、提案をパーソナルに ── AIであすけんが目指すもの
oprstchn
0
170
デジタル・デザイン構想 by Sayaka Ishizuka
y150saya
0
200
AIペネトレーションテスト・ セキュリティ検証「AgenticSec」紹介資料
laysakura
2
8.1k
Compose 新機能総まとめ / What's New in Jetpack Compose
yanzm
0
150
End-to-Endで考える信頼性 —LINEアプリにおけるクライアント開発×SRE連携の実践
maruloop
3
2.9k
Featured
See All Featured
Color Theory Basics | Prateek | Gurzu
gurzu
0
380
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.9k
We Are The Robots
honzajavorek
0
270
Documentation Writing (for coders)
carmenintech
77
5.4k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.3k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.8k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
The Spectacular Lies of Maps
axbom
PRO
1
850
Darren the Foodie - Storyboard
khoart
PRO
3
3.4k
The Curse of the Amulet
leimatthew05
2
13k
Utilizing Notion as your number one productivity tool
mfonobong
4
340
Odyssey Design
rkendrick25
PRO
2
730
Transcript
Ruby tools for Infrastructure Engineer
RSpec
RSpec 4 RSpec is testing tool for the Ruby programming
language. 4 Ruby ͷςεςΟϯάϑϨʔϜϫʔΫɻ 4 Serverspec Infrataster ͷ࠷ۙͷ Infrastructure testing framework ͰΘΕ͍ͯΔɻ ࠷ۙ 3.0rc1 ͕ग़ͨɻ
Serverspec
Serverspec Infrastructure testing framework cat spec/target.example.jp/http_spec.rb require 'spec_helper' describe package('httpd')
do it { should be_installed } end 4 rspec 4 describe, it, its ... ͰςετΛॻ͍͍ͯ͘ 4 http://serverspec.org/resource_types.html
Serverspec Run test $ rake spec /usr/bin/ruby -S rspec spec/www.example.jp/httpd_spec.rb
...... : 4 rake?
Rake 4 Ruby Ϗϧυπʔϧ 4 Make ͱΑ͘ࣅͨػೳ͕͔ͭ͑Δ 4 "λεΫ" ͱ͍͏جຊ୯ҐͰԿ͔Λ࣮ߦ͢Δ
Rakefile require 'rake' require 'rspec/core/rake_task' RSpec::Core::RakeTask.new(:spec) do |t| t.pattern =
'spec/*/*_spec.rb' end task :default => :spec 4 spec ͱ͍͏໊લͷλεΫ͕ఆٛ͞Ε͍ͯΔ 4 λεΫҰཡ rake -T ͰݟΕΔ
spec_helper.rb 4 ςετͰ͏ڞ௨ͷઃఆΛॻ͘ 4 serverspec Ͱɺserverspec Ͱ͏ sudo password
ssh ઌ host ͷఆ͕ٛॻ͔Ε͍ͯΔ 4 host = File.basename(Pathname.new(file).dirname) 4 σϑΥϧτͩͱσΟϨΫτϦͷ໊લ͕ϗετ໊ʹͳΔ 8 -rw-r--r-- 1 staff 848 6 12 18:32 spec_helper.rb 0 drwxr-xr-x 3 staff 102 6 12 18:32 target.example.com ← ͜Ε
Tips
Tips Rake ӽ͠ʹ Rspec ͷҾΛ͢ rake spec SPEC_OPTS="--format documentation" ৗʹಉ͡Φϓγϣϯ͕͍͍ͨ
echo "--color" >> .rspec # ৭͕ͭ͘ 4 ੲ spec.opts ͩͬͨ
ग़ྗϑΥʔϚοτ 4 --format 4 documentation 4 progress 4 html
ςετͷϑΟϧλϦϯά 4 ৭ʑͳঢ়ଶʹΑ͍ͬͯͨ͠/ͨ͘͠ͳ͍ςετ͕͋Δ 4 --tag ΦϓγϣϯΛ͏ 4 --tag <tag_name> 4
<tag_name> ͷ͍͍ͭͯΔςετͷΈ࣮ߦ͢Δ 4 --tag ~<tag_name> 4 <tag_name> ͷ͍͍ͭͯΔςετΛআ֎͢Δ 4 ଞʹ৭ʑग़དྷΔ
Usage rake spec SPEC_OPTS="--format documentation --tag ~web" 4 ͜Μͳײ͡Ͱ͏ ࣮ࡍʹҊ݅Ͱ͍ͬͯΔ༷ࢠΛ͝հ
Enjoy test! and reduce mistakes!