Skip to content

Commit 2869a5e

Browse files
committed
tests for deployment runs include option
1 parent 9cbe67a commit 2869a5e

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

stack_deployment_runs_integration_test.go

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,28 @@ func TestStackDeploymentRunsList(t *testing.T) {
7171
require.NoError(t, err)
7272
assert.NotNil(t, runList)
7373
})
74+
75+
t.Run("With include option", func(t *testing.T) {
76+
t.Parallel()
77+
78+
runList, err := client.StackDeploymentRuns.List(ctx, deploymentGroupID, &StackDeploymentRunListOptions{
79+
Include: []SDRIncludeOpt{"stack-deployment-group"},
80+
})
81+
assert.NoError(t, err)
82+
assert.NotNil(t, runList)
83+
for _, run := range runList.Items {
84+
assert.NotNil(t, run.StackDeploymentGroup.ID)
85+
}
86+
})
87+
88+
t.Run("With invalid include option", func(t *testing.T) {
89+
t.Parallel()
90+
91+
_, err := client.StackDeploymentRuns.List(ctx, deploymentGroupID, &StackDeploymentRunListOptions{
92+
Include: []SDRIncludeOpt{"invalid-option"},
93+
})
94+
assert.Error(t, err)
95+
})
7496
}
7597

7698
func TestStackDeploymentRunsRead(t *testing.T) {
@@ -126,6 +148,20 @@ func TestStackDeploymentRunsRead(t *testing.T) {
126148
_, err := client.StackDeploymentRuns.Read(ctx, "")
127149
assert.Error(t, err)
128150
})
151+
t.Run("Read with options", func(t *testing.T) {
152+
run, err := client.StackDeploymentRuns.ReadWithOptions(ctx, sdr.ID, &StackDeploymentRunReadOptions{
153+
Include: []SDRIncludeOpt{"stack-deployment-group"},
154+
})
155+
assert.NoError(t, err)
156+
assert.NotNil(t, run)
157+
assert.NotNil(t, run.StackDeploymentGroup.ID)
158+
})
159+
t.Run("Read with invalid options", func(t *testing.T) {
160+
_, err := client.StackDeploymentRuns.ReadWithOptions(ctx, sdr.ID, &StackDeploymentRunReadOptions{
161+
Include: []SDRIncludeOpt{"invalid-option"},
162+
})
163+
assert.Error(t, err)
164+
})
129165
}
130166

131167
func TestStackDeploymentRunsApproveAllPlans(t *testing.T) {

0 commit comments

Comments
 (0)