Slide 31
Slide 31 text
© NTT Communications Corporation All Rights Reserved. 31
NTT Communications
CONFIDENTIAL
Step#5: パッケージを利⽤した結合テスト
Go⾔語 でパッケージの結合テストを⾏う仕組みを実装
Pipeline
Package
v1.26
Pipeline/
PipelineRun
func TestDeployK8sCluster(t *testing.T) {
target := "example.com"
cases := []struct{
k8sAPIverson string
host string
} {
{k8sApiVersion: "1.26", host: target},
{k8sApiVersion: "1.27", host: target},
}
pi, _ := generatePipeline()
for i, tc := range cases {
t.Run(i, func(t *testing.T) {
run, _ := runPipeline(t, pi, tc)
assert.True(t, isSuccessful(run))
assert.True(t, isPodRunning(tc.host))
})
}
}
Test 対象
Test 毎に
環境構築
疑似コード
Pipeline/
PipelineRun
v1.27 Testing multiple API
versions
● 並列・定期実⾏
● 複雑な条件設定
● 環境の⾃動構築
Kubernetes clusters
⽣成