@@ -13,12 +13,10 @@ func TestAgentPoolsList(t *testing.T) {
1313 client := testClient (t )
1414 ctx := context .Background ()
1515
16- agentPoolTest1 , agentPoolTest1Cleanup := createAgentPool (t , client , false )
16+ agentPoolTest1 , agentPoolTest1Cleanup := createAgentPool (t , client )
1717 defer agentPoolTest1Cleanup ()
18- agentPoolTest2 , agentPoolTest2Cleanup := createAgentPool (t , client , true )
18+ agentPoolTest2 , agentPoolTest2Cleanup := createAgentPool (t , client )
1919 defer agentPoolTest2Cleanup ()
20- agentPoolTest3 , agentPoolTest3Cleanup := createAgentPool (t , client , true )
21- defer agentPoolTest3Cleanup ()
2220
2321 t .Run ("without options" , func (t * testing.T ) {
2422 apList , err := client .AgentPools .List (ctx , AgentPoolListOptions {})
@@ -29,7 +27,6 @@ func TestAgentPoolsList(t *testing.T) {
2927 }
3028 assert .Contains (t , apListIDs , agentPoolTest1 .ID )
3129 assert .Contains (t , apListIDs , agentPoolTest2 .ID )
32- assert .Contains (t , apListIDs , agentPoolTest3 .ID )
3330 })
3431 t .Run ("with account filter" , func (t * testing.T ) {
3532 apList , err := client .AgentPools .List (ctx , AgentPoolListOptions {Account : String (defaultAccountID )})
@@ -40,7 +37,6 @@ func TestAgentPoolsList(t *testing.T) {
4037 }
4138 assert .Contains (t , apListIDs , agentPoolTest1 .ID )
4239 assert .Contains (t , apListIDs , agentPoolTest2 .ID )
43- assert .Contains (t , apListIDs , agentPoolTest3 .ID )
4440 })
4541 t .Run ("with account and name filter" , func (t * testing.T ) {
4642 apList , err := client .AgentPools .List (ctx , AgentPoolListOptions {Account : String (defaultAccountID ), Name : agentPoolTest1 .Name })
@@ -54,52 +50,13 @@ func TestAgentPoolsList(t *testing.T) {
5450 assert .Len (t , apList .Items , 1 )
5551 assert .Equal (t , apList .Items [0 ].ID , agentPoolTest2 .ID )
5652 })
57- t .Run ("with vcs-enabled filter" , func (t * testing.T ) {
58- var vcsEnabledFiler = true
59- apList , err := client .AgentPools .List (ctx , AgentPoolListOptions {VcsEnabled : & vcsEnabledFiler })
60- require .NoError (t , err )
61- apListIDs := make ([]string , 0 )
62- for _ , agentPool := range apList .Items {
63- apListIDs = append (apListIDs , agentPool .ID )
64- }
65- assert .Len (t , apListIDs , 2 )
66- assert .Contains (t , apListIDs , agentPoolTest2 .ID )
67- assert .Contains (t , apListIDs , agentPoolTest3 .ID )
68- })
6953}
7054
7155func TestAgentPoolsCreate (t * testing.T ) {
7256 client := testClient (t )
7357 ctx := context .Background ()
7458
7559 t .Run ("when account and name are provided" , func (t * testing.T ) {
76- options := AgentPoolCreateOptions {
77- Account : & Account {ID : defaultAccountID },
78- Name : String ("test-provider-pool-" + randomString (t )),
79- VcsEnabled : Bool (true ),
80- }
81-
82- agentPool , err := client .AgentPools .Create (ctx , options )
83- require .NoError (t , err )
84-
85- // Get a refreshed view from the API.
86- refreshed , err := client .AgentPools .Read (ctx , agentPool .ID )
87- require .NoError (t , err )
88-
89- for _ , item := range []* AgentPool {
90- agentPool ,
91- refreshed ,
92- } {
93- assert .NotEmpty (t , item .ID )
94- assert .Equal (t , * options .Name , item .Name )
95- assert .Equal (t , options .Account , item .Account )
96- assert .Equal (t , * options .VcsEnabled , item .VcsEnabled )
97- }
98- err = client .AgentPools .Delete (ctx , agentPool .ID )
99- require .NoError (t , err )
100- })
101-
102- t .Run ("when create without vcs_enabled" , func (t * testing.T ) {
10360 options := AgentPoolCreateOptions {
10461 Account : & Account {ID : defaultAccountID },
10562 Name : String ("test-provider-pool-" + randomString (t )),
@@ -117,7 +74,8 @@ func TestAgentPoolsCreate(t *testing.T) {
11774 refreshed ,
11875 } {
11976 assert .NotEmpty (t , item .ID )
120- assert .Equal (t , item .VcsEnabled , false )
77+ assert .Equal (t , * options .Name , item .Name )
78+ assert .Equal (t , options .Account , item .Account )
12179 }
12280 err = client .AgentPools .Delete (ctx , agentPool .ID )
12381 require .NoError (t , err )
@@ -132,7 +90,6 @@ func TestAgentPoolsCreate(t *testing.T) {
13290 Account : & Account {ID : defaultAccountID },
13391 Environment : & Environment {ID : env .ID },
13492 Name : String ("test-provider-pool-" + randomString (t )),
135- VcsEnabled : Bool (false ),
13693 }
13794
13895 agentPool , err := client .AgentPools .Create (ctx , options )
@@ -166,7 +123,6 @@ func TestAgentPoolsCreate(t *testing.T) {
166123 Environment : & Environment {ID : env .ID },
167124 Workspaces : []* Workspace {{ID : ws .ID }},
168125 Name : String ("test-provider-pool-" + randomString (t )),
169- VcsEnabled : Bool (false ),
170126 }
171127
172128 agentPool , err := client .AgentPools .Create (ctx , options )
@@ -285,7 +241,7 @@ func TestAgentPoolsRead(t *testing.T) {
285241 client := testClient (t )
286242 ctx := context .Background ()
287243
288- agentPoolTest , agentPoolTestCleanup := createAgentPool (t , client , false )
244+ agentPoolTest , agentPoolTestCleanup := createAgentPool (t , client )
289245 defer agentPoolTestCleanup ()
290246
291247 t .Run ("when the agentPool exists" , func (t * testing.T ) {
@@ -322,7 +278,7 @@ func TestAgentPoolsUpdate(t *testing.T) {
322278 client := testClient (t )
323279 ctx := context .Background ()
324280
325- agentPoolTest , agentPoolTestCleanup := createAgentPool (t , client , false )
281+ agentPoolTest , agentPoolTestCleanup := createAgentPool (t , client )
326282 defer agentPoolTestCleanup ()
327283
328284 t .Run ("when updating a name" , func (t * testing.T ) {
@@ -381,7 +337,7 @@ func TestAgentPoolsDelete(t *testing.T) {
381337 client := testClient (t )
382338 ctx := context .Background ()
383339
384- pool , _ := createAgentPool (t , client , false )
340+ pool , _ := createAgentPool (t , client )
385341
386342 t .Run ("with valid agent pool id" , func (t * testing.T ) {
387343 err := client .AgentPools .Delete (ctx , pool .ID )
0 commit comments