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
2
870
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
190
研究開発と実装OSSと プロダクトの好循環 / A virtuous cycle of research and development implementation OSS and products
linyows
1
800
コードジェネレーターで 効率的な開発をする / Efficient development with code generators
linyows
0
410
研究を支える拡張性の高い ワークフローツールの提案 / Proposal of highly expandable workflow tools to support research
linyows
0
590
非コンテナ環境において宣言的Deploymentを手軽に実現する / Declarative deployment in non-container environments
linyows
1
470
メール送信サーバの集約における透過型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
590
研究の再現性を高める 仕組みをGoでつくる / Creating a system to improve the reproducibility of research using go
linyows
1
320
奥が深いメールのシステム / The depth of Email system
linyows
4
750
Other Decks in Programming
See All in Programming
Unicodeどうしてる? PHPから見たUnicode対応と他言語での対応についてのお伺い
youkidearitai
PRO
1
1.1k
組織で育むオブザーバビリティ
ryota_hnk
0
170
Oxlint JS plugins
kazupon
1
770
humanlayerのブログから学ぶ、良いCLAUDE.mdの書き方
tsukamoto1783
0
180
Spinner 軸ズレ現象を調べたらレンダリング深淵に飲まれた #レバテックMeetup
bengo4com
1
230
CSC307 Lecture 05
javiergs
PRO
0
500
登壇資料を作る時に意識していること #登壇資料_findy
konifar
4
980
0→1 フロントエンド開発 Tips🚀 #レバテックMeetup
bengo4com
0
540
高速開発のためのコード整理術
sutetotanuki
1
390
Basic Architectures
denyspoltorak
0
660
16年目のピクシブ百科事典を支える最新の技術基盤 / The Modern Tech Stack Powering Pixiv Encyclopedia in its 16th Year
ahuglajbclajep
5
990
React 19でつくる「気持ちいいUI」- 楽観的UIのすすめ
himorishige
11
6k
Featured
See All Featured
Building Applications with DynamoDB
mza
96
6.9k
What does AI have to do with Human Rights?
axbom
PRO
0
2k
A designer walks into a library…
pauljervisheath
210
24k
The untapped power of vector embeddings
frankvandijk
1
1.6k
Everyday Curiosity
cassininazir
0
130
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.1k
Marketing to machines
jonoalderson
1
4.6k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
79
Music & Morning Musume
bryan
47
7.1k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
320
Imperfection Machines: The Place of Print at Facebook
scottboms
269
14k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
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で良いのかもし れない 🙅