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
linyows
June 24, 2024
Programming
980
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
IaCにおけるテスト考察 / Tests in IaC
@2024-06-24 さくらインターネット IaC 社内勉強会 LT
linyows
June 24, 2024
More Decks by linyows
See All by linyows
GoとClickhouseで作るRAGアプリ / Building RAG Application with Go and Clickhouse
linyows
1
57
Kubernetesを使わない環境にもCloud Nativeなデプロイを実現する / Enabling Cloud Native deployments without the complexity of Kubernetes
linyows
3
720
Protocol Buffersの型を超えて拡張性を得る / Beyond Protocol Buffers Types Achieving Extensibility
linyows
0
290
研究開発と実装OSSと プロダクトの好循環 / A virtuous cycle of research and development implementation OSS and products
linyows
1
950
コードジェネレーターで 効率的な開発をする / Efficient development with code generators
linyows
0
500
研究を支える拡張性の高い ワークフローツールの提案 / Proposal of highly expandable workflow tools to support research
linyows
0
700
非コンテナ環境において宣言的Deploymentを手軽に実現する / Declarative deployment in non-container environments
linyows
1
620
メール送信サーバの集約における透過型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
680
Other Decks in Programming
See All in Programming
全PRの83%がAIレビューだけでマージできるようになった開発組織はその後どうなったか
athug
1
1.3k
Embedded SREと共に達成した会員管理システムのAWS移行 - SRE NEXT 2026 ランチスポンサーセッション
niftycorp
PRO
1
3.4k
Welcome to the "Parametricity" 🏙️ − Generic だけど Specific な世界 −
guvalif
PRO
1
200
Claude CodeとAgentCore Gatewayを繋ぐ際の認証認可 / Authentication and authorization when connecting Claude Code with AgentCore Gateway
har1101
0
120
属人化した知識を、 AIが辿れる地図にする
pkshadeck
PRO
1
140
【やさしく解説 設計編・中級 #1】一つの車に、運転手は一人 ~ある倉庫システムの事例から~
panda728
PRO
0
200
仕様駆動開発の消費期限
watany
2
540
Laravelで学ぶ Webアプリケーションチューニング入門/web_application_tuning_101
hanhan1978
4
1.6k
ここ半年くらいでAIに作らせたR用ツール
eitsupi
0
360
2年かけて Deno に DOMMatrix を実装した話 / How I implemented DOMMatrix in Deno over two years
petamoriken
0
200
アルゴリズムは何を圧縮しているのか ─ Haskell から育った「圧縮代数」というメンタルモデル
naoya
16
3.8k
Android CLI
fornewid
0
210
Featured
See All Featured
Code Reviewing Like a Champion
maltzj
528
40k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
290
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
11k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
240
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
330
Faster Mobile Websites
deanohume
310
32k
The Cult of Friendly URLs
andyhume
79
7k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
450
How to Talk to Developers About Accessibility
jct
2
480
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
1.1k
ラッコキーワード サービス紹介資料
rakko
1
4.2M
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で良いのかもし れない 🙅