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
910
2
Share
IaCにおけるテスト考察 / Tests in IaC
@2024-06-24 さくらインターネット IaC 社内勉強会 LT
linyows
June 24, 2024
More Decks by linyows
See All by linyows
Protocol Buffersの型を超えて拡張性を得る / Beyond Protocol Buffers Types Achieving Extensibility
linyows
0
210
研究開発と実装OSSと プロダクトの好循環 / A virtuous cycle of research and development implementation OSS and products
linyows
1
840
コードジェネレーターで 効率的な開発をする / Efficient development with code generators
linyows
0
440
研究を支える拡張性の高い ワークフローツールの提案 / Proposal of highly expandable workflow tools to support research
linyows
0
620
非コンテナ環境において宣言的Deploymentを手軽に実現する / Declarative deployment in non-container environments
linyows
1
520
メール送信サーバの集約における透過型SMTP プロキシの定量評価 / Quantitative Evaluation of Transparent SMTP Proxy in Email Sending Server Aggregation
linyows
0
1.2k
透過型SMTPプロキシによる送信メールの可観測性向上: Update Edition / Improved observability of outgoing emails with transparent smtp proxy: Update edition
linyows
2
610
研究の再現性を高める 仕組みをGoでつくる / Creating a system to improve the reproducibility of research using go
linyows
1
350
奥が深いメールのシステム / The depth of Email system
linyows
4
770
Other Decks in Programming
See All in Programming
Laravel Nightwatchの裏側 - Laravel公式Observabilityツールを支える設計と実装
avosalmon
1
270
へんな働き方
yusukebe
6
2.9k
車輪の再発明をしよう!PHP で実装して学ぶ、Web サーバーの仕組みと HTTP の正体
h1r0
2
460
AIと共にエンジニアとPMの “二刀流”を実現する
naruogram
0
110
Coding as Prompting Since 2025
ragingwind
0
550
ロボットのための工場に灯りは要らない
watany
12
3.2k
PHPで TLSのプロトコルを実装してみる
higaki_program
0
600
Understanding Apache Lucene - More than just full-text search
spinscale
0
150
Claude Codeログ基盤の構築
giginet
PRO
7
3.8k
我々はなぜ「層」を分けるのか〜「関心の分離」と「抽象化」で手に入れる変更に強いシンプルな設計〜 #phperkaigi / PHPerKaigi 2026
shogogg
2
720
LM Linkで(非力な!)ノートPCでローカルLLM
seosoft
0
280
AWS×クラウドネイティブソフトウェア設計 / AWS x Cloud-Native Software Design
nrslib
16
3.5k
Featured
See All Featured
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
Raft: Consensus for Rubyists
vanstee
141
7.4k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
700
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
190
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.4k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
How to Ace a Technical Interview
jacobian
281
24k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
94
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.5k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
920
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
310
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で良いのかもし れない 🙅