@@ -141,6 +141,11 @@ func TestStackReadUpdateDelete(t *testing.T) {
141
141
oauthClient , cleanup := createOAuthClient (t , client , orgTest , nil )
142
142
t .Cleanup (cleanup )
143
143
144
+ initialPool , err := client .AgentPools .Create (ctx , orgTest .Name , AgentPoolCreateOptions {
145
+ Name : String ("initial-test-pool" ),
146
+ })
147
+ require .NoError (t , err )
148
+
144
149
stack , err := client .Stacks .Create (ctx , StackCreateOptions {
145
150
Name : "test-stack" ,
146
151
VCSRepo : & StackVCSRepoOptions {
@@ -151,6 +156,7 @@ func TestStackReadUpdateDelete(t *testing.T) {
151
156
Project : & Project {
152
157
ID : orgTest .DefaultProject .ID ,
153
158
},
159
+ AgentPool : initialPool ,
154
160
})
155
161
156
162
require .NoError (t , err )
@@ -164,20 +170,27 @@ func TestStackReadUpdateDelete(t *testing.T) {
164
170
require .Equal (t , stack .VCSRepo .Identifier , stackRead .VCSRepo .Identifier )
165
171
require .Equal (t , stack .VCSRepo .OAuthTokenID , stackRead .VCSRepo .OAuthTokenID )
166
172
require .Equal (t , stack .VCSRepo .Branch , stackRead .VCSRepo .Branch )
167
-
173
+ require . Equal ( t , stack . AgentPool . ID , stackRead . AgentPool . ID )
168
174
assert .Equal (t , stack , stackRead )
169
175
176
+ updatedPool , err := client .AgentPools .Create (ctx , orgTest .Name , AgentPoolCreateOptions {
177
+ Name : String ("updated-test-pool" ),
178
+ })
179
+ require .NoError (t , err )
180
+
170
181
stackUpdated , err := client .Stacks .Update (ctx , stack .ID , StackUpdateOptions {
171
182
Description : String ("updated description" ),
172
183
VCSRepo : & StackVCSRepoOptions {
173
184
Identifier : "brandonc/pet-nulls-stack" ,
174
185
OAuthTokenID : oauthClient .OAuthTokens [0 ].ID ,
175
186
Branch : "main" ,
176
187
},
188
+ AgentPool : updatedPool ,
177
189
})
178
190
179
191
require .NoError (t , err )
180
192
require .Equal (t , "updated description" , stackUpdated .Description )
193
+ require .Equal (t , updatedPool .ID , stackUpdated .AgentPool .ID )
181
194
182
195
stackUpdatedConfig , err := client .Stacks .UpdateConfiguration (ctx , stack .ID )
183
196
require .NoError (t , err )
0 commit comments