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
IaCにおけるテスト考察 / Tests in IaC
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
linyows
June 24, 2024
Programming
2
860
IaCにおけるテスト考察 / Tests in IaC
@2024-06-24 さくらインターネット IaC 社内勉強会 LT
linyows
June 24, 2024
Tweet
Share
More Decks by linyows
See All by linyows
Protocol Buffersの型を超えて拡張性を得る / Beyond Protocol Buffers Types Achieving Extensibility
linyows
0
180
研究開発と実装OSSと プロダクトの好循環 / A virtuous cycle of research and development implementation OSS and products
linyows
1
790
コードジェネレーターで 効率的な開発をする / Efficient development with code generators
linyows
0
400
研究を支える拡張性の高い ワークフローツールの提案 / Proposal of highly expandable workflow tools to support research
linyows
0
580
非コンテナ環境において宣言的Deploymentを手軽に実現する / Declarative deployment in non-container environments
linyows
1
460
メール送信サーバの集約における透過型SMTP プロキシの定量評価 / Quantitative Evaluation of Transparent SMTP Proxy in Email Sending Server Aggregation
linyows
0
1.1k
透過型SMTPプロキシによる送信メールの可観測性向上: Update Edition / Improved observability of outgoing emails with transparent smtp proxy: Update edition
linyows
2
580
研究の再現性を高める 仕組みをGoでつくる / Creating a system to improve the reproducibility of research using go
linyows
1
320
奥が深いメールのシステム / The depth of Email system
linyows
4
740
Other Decks in Programming
See All in Programming
GISエンジニアから見たLINKSデータ
nokonoko1203
0
190
HTTPプロトコル正しく理解していますか? 〜かわいい猫と共に学ぼう。ฅ^•ω•^ฅ ニャ〜
hekuchan
2
660
AI によるインシデント初動調査の自動化を行う AI インシデントコマンダーを作った話
azukiazusa1
1
550
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
190
AtCoder Conference 2025
shindannin
0
990
Deno Tunnel を使ってみた話
kamekyame
0
350
ゆくKotlin くるRust
exoego
1
210
Automatic Grammar Agreementと Markdown Extended Attributes について
kishikawakatsumi
0
140
Honoを使ったリモートMCPサーバでAIツールとの連携を加速させる!
tosuri13
1
160
ELYZA_Findy AI Engineering Summit登壇資料_AIコーディング時代に「ちゃんと」やること_toB LLMプロダクト開発舞台裏_20251216
elyza
2
1.2k
Oxlintはいいぞ
yug1224
5
1.1k
Spinner 軸ズレ現象を調べたらレンダリング深淵に飲まれた #レバテックMeetup
bengo4com
1
220
Featured
See All Featured
Designing for Performance
lara
610
70k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
50
Tell your own story through comics
letsgokoyo
1
790
Stop Working from a Prison Cell
hatefulcrawdad
273
21k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
230
Designing for Timeless Needs
cassininazir
0
120
4 Signs Your Business is Dying
shpigford
187
22k
Exploring anti-patterns in Rails
aemeredith
2
230
Claude Code のすすめ
schroneko
67
210k
Designing Powerful Visuals for Engaging Learning
tmiket
0
210
Measuring & Analyzing Core Web Vitals
bluesmoon
9
740
Mobile First: as difficult as doing things right
swwweet
225
10k
Transcript
@2024-06-24 さくらインターネット IaC 社内勉強会 LT IaCにおけるテスト考察
小 田 知央 / Tomohisa Oda @linyows • 福岡市在住 •
Fukuoka.go 主催 • 趣味は筋トレとテニス • OSS: Octopass, Dewy, Rotion, Warp… • https://tomohisaoda.com • https://x.com/linyows
インフラ変更のテストはどうしていますか? •テストはない、そもそも不要 !? •もちろん 人力 によるテスト •テストはあるがテストの実 行 時間が 長
い
IaCのためのツールはほぼ宣 言 的なコード • IaCのツール、Terraform, Ansible, Chef, Puppet は宣 言
的なインフラリソー スを定義する • 宣 言 的コードの実 行 保証はツール側であり、使う側があえてする必要はない • 利便性のために命令的なモジュールは存在するが宣 言 的になるようモジュール を作るのが好ましい • モジュール開発ではしっかりテストが必要
5 Ansible incorporates declarative and imperative means. This mix offers
you the fl exibility to focus on what you need to do, rather than strictly adhere to one paradigm. l l
それでもテストを書きたい • テスト時間を短くするにはテストサイズの 小 さいUnitテストを書くことにな る • Terraform: terraform test
• Ansible: molecule • Chef: chefspec, test-kitchen
IaCのUnitテストはコストと 見 合っているか • 経験としてはUnitテストを書く時間と得ら れる安全は 見 合っていない感覚がある • IaC
本では、Application Codeのテストピ ラミッドとは異なり Declaration Codeの テストは ダイヤモンドモデルになるだろう と書いてある
Online Stack testを書くには? • Online Stack testは、例えば、ネットワーク、コンピュート、データベー ス、ストレージが連携して期待する動作を確認する • そんなツールありますか?
• 例えば、特定のapache moduleが有効になっていること(設定でなく実際使 える)、メールがを送信するとDKIMヘッダーがついていること • テストするには複雑なことが多い
ユーザーがコマンドを作るのはどうだろうか • テストフレームワークはassetionの成功失敗だけを管理するだけ テストフレームワーク ユーザが書くテストコマンド ユーザが書くテストコマンド ユーザが書くテストコマンド 🤔
ユーザーがコマンドを作るのはどうだろうか • テストフレームワークはassetionの成功失敗だけを管理するだけ テストフレームワーク ユーザが書くテストコマンド ユーザが書くテストコマンド ユーザが書くテストコマンド テストのテストが必 要になるのでダメな ことに気づいた
runnで良いのかもし れない 🙅