Skip to content

Commit 4f6d52c

Browse files
committed
test
1 parent a36148b commit 4f6d52c

File tree

3 files changed

+42
-43
lines changed

3 files changed

+42
-43
lines changed

internal/services/vpc/testdata/vpc-import-by-identity.cassette.yaml

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ interactions:
2929
trailer: {}
3030
content_length: 402
3131
uncompressed: false
32-
body: '{"created_at":"2025-09-04T15:54:42.724544Z","custom_routes_propagation_enabled":true,"id":"763750ef-3ae5-41b9-afb2-bad95edc099f","is_default":false,"name":"test-vpc-import","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_count":0,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","routing_enabled":true,"tags":[],"updated_at":"2025-09-04T15:54:42.724544Z"}'
32+
body: '{"created_at":"2025-09-08T19:34:16.635250Z","custom_routes_propagation_enabled":true,"id":"090d68b4-0cb0-48b0-9d9f-235b5f337746","is_default":false,"name":"test-vpc-import","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_count":0,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","routing_enabled":true,"tags":[],"updated_at":"2025-09-08T19:34:16.635250Z"}'
3333
headers:
3434
Content-Length:
3535
- "402"
@@ -38,20 +38,20 @@ interactions:
3838
Content-Type:
3939
- application/json
4040
Date:
41-
- Thu, 04 Sep 2025 15:54:42 GMT
41+
- Mon, 08 Sep 2025 19:34:16 GMT
4242
Server:
43-
- Scaleway API Gateway (fr-par-3;edge01)
43+
- Scaleway API Gateway (fr-par-3;edge02)
4444
Strict-Transport-Security:
4545
- max-age=63072000
4646
X-Content-Type-Options:
4747
- nosniff
4848
X-Frame-Options:
4949
- DENY
5050
X-Request-Id:
51-
- ce046cc7-faa0-423a-91f1-a3341098ab6d
51+
- a8cb8ed2-8e2b-4845-b25d-e54d98bab213
5252
status: 200 OK
5353
code: 200
54-
duration: 411.7155ms
54+
duration: 239.305042ms
5555
- id: 1
5656
request:
5757
proto: HTTP/1.1
@@ -68,7 +68,7 @@ interactions:
6868
headers:
6969
User-Agent:
7070
- scaleway-sdk-go/v1.0.0-beta.7+dev (go1.24.4; darwin; arm64) terraform-provider/develop terraform/terraform-tests
71-
url: https://api.scaleway.com/vpc/v2/regions/fr-par/vpcs/763750ef-3ae5-41b9-afb2-bad95edc099f
71+
url: https://api.scaleway.com/vpc/v2/regions/fr-par/vpcs/090d68b4-0cb0-48b0-9d9f-235b5f337746
7272
method: GET
7373
response:
7474
proto: HTTP/2.0
@@ -78,7 +78,7 @@ interactions:
7878
trailer: {}
7979
content_length: 402
8080
uncompressed: false
81-
body: '{"created_at":"2025-09-04T15:54:42.724544Z","custom_routes_propagation_enabled":true,"id":"763750ef-3ae5-41b9-afb2-bad95edc099f","is_default":false,"name":"test-vpc-import","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_count":0,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","routing_enabled":true,"tags":[],"updated_at":"2025-09-04T15:54:42.724544Z"}'
81+
body: '{"created_at":"2025-09-08T19:34:16.635250Z","custom_routes_propagation_enabled":true,"id":"090d68b4-0cb0-48b0-9d9f-235b5f337746","is_default":false,"name":"test-vpc-import","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_count":0,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","routing_enabled":true,"tags":[],"updated_at":"2025-09-08T19:34:16.635250Z"}'
8282
headers:
8383
Content-Length:
8484
- "402"
@@ -87,20 +87,20 @@ interactions:
8787
Content-Type:
8888
- application/json
8989
Date:
90-
- Thu, 04 Sep 2025 15:54:42 GMT
90+
- Mon, 08 Sep 2025 19:34:16 GMT
9191
Server:
92-
- Scaleway API Gateway (fr-par-3;edge01)
92+
- Scaleway API Gateway (fr-par-3;edge02)
9393
Strict-Transport-Security:
9494
- max-age=63072000
9595
X-Content-Type-Options:
9696
- nosniff
9797
X-Frame-Options:
9898
- DENY
9999
X-Request-Id:
100-
- 50f4867c-2926-4947-97ea-9a756fcf82ff
100+
- 91eed587-90d0-4b15-95fb-1d3562c937c6
101101
status: 200 OK
102102
code: 200
103-
duration: 96.659959ms
103+
duration: 67.381584ms
104104
- id: 2
105105
request:
106106
proto: HTTP/1.1
@@ -117,7 +117,7 @@ interactions:
117117
headers:
118118
User-Agent:
119119
- scaleway-sdk-go/v1.0.0-beta.7+dev (go1.24.4; darwin; arm64) terraform-provider/develop terraform/terraform-tests
120-
url: https://api.scaleway.com/vpc/v2/regions/fr-par/vpcs/763750ef-3ae5-41b9-afb2-bad95edc099f
120+
url: https://api.scaleway.com/vpc/v2/regions/fr-par/vpcs/090d68b4-0cb0-48b0-9d9f-235b5f337746
121121
method: GET
122122
response:
123123
proto: HTTP/2.0
@@ -127,7 +127,7 @@ interactions:
127127
trailer: {}
128128
content_length: 402
129129
uncompressed: false
130-
body: '{"created_at":"2025-09-04T15:54:42.724544Z","custom_routes_propagation_enabled":true,"id":"763750ef-3ae5-41b9-afb2-bad95edc099f","is_default":false,"name":"test-vpc-import","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_count":0,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","routing_enabled":true,"tags":[],"updated_at":"2025-09-04T15:54:42.724544Z"}'
130+
body: '{"created_at":"2025-09-08T19:34:16.635250Z","custom_routes_propagation_enabled":true,"id":"090d68b4-0cb0-48b0-9d9f-235b5f337746","is_default":false,"name":"test-vpc-import","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_count":0,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","routing_enabled":true,"tags":[],"updated_at":"2025-09-08T19:34:16.635250Z"}'
131131
headers:
132132
Content-Length:
133133
- "402"
@@ -136,20 +136,20 @@ interactions:
136136
Content-Type:
137137
- application/json
138138
Date:
139-
- Thu, 04 Sep 2025 15:54:43 GMT
139+
- Mon, 08 Sep 2025 19:34:16 GMT
140140
Server:
141-
- Scaleway API Gateway (fr-par-3;edge01)
141+
- Scaleway API Gateway (fr-par-3;edge02)
142142
Strict-Transport-Security:
143143
- max-age=63072000
144144
X-Content-Type-Options:
145145
- nosniff
146146
X-Frame-Options:
147147
- DENY
148148
X-Request-Id:
149-
- 1f194652-7bc9-4103-9f3b-90a1e2ff88cb
149+
- 18052567-b9a1-4f6f-9d33-2c67a8fd7bbe
150150
status: 200 OK
151151
code: 200
152-
duration: 95.664625ms
152+
duration: 59.546792ms
153153
- id: 3
154154
request:
155155
proto: HTTP/1.1
@@ -166,7 +166,7 @@ interactions:
166166
headers:
167167
User-Agent:
168168
- scaleway-sdk-go/v1.0.0-beta.7+dev (go1.24.4; darwin; arm64) terraform-provider/develop terraform/terraform-tests
169-
url: https://api.scaleway.com/vpc/v2/regions/fr-par/vpcs/763750ef-3ae5-41b9-afb2-bad95edc099f
169+
url: https://api.scaleway.com/vpc/v2/regions/fr-par/vpcs/090d68b4-0cb0-48b0-9d9f-235b5f337746
170170
method: GET
171171
response:
172172
proto: HTTP/2.0
@@ -176,7 +176,7 @@ interactions:
176176
trailer: {}
177177
content_length: 402
178178
uncompressed: false
179-
body: '{"created_at":"2025-09-04T15:54:42.724544Z","custom_routes_propagation_enabled":true,"id":"763750ef-3ae5-41b9-afb2-bad95edc099f","is_default":false,"name":"test-vpc-import","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_count":0,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","routing_enabled":true,"tags":[],"updated_at":"2025-09-04T15:54:42.724544Z"}'
179+
body: '{"created_at":"2025-09-08T19:34:16.635250Z","custom_routes_propagation_enabled":true,"id":"090d68b4-0cb0-48b0-9d9f-235b5f337746","is_default":false,"name":"test-vpc-import","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_count":0,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","routing_enabled":true,"tags":[],"updated_at":"2025-09-08T19:34:16.635250Z"}'
180180
headers:
181181
Content-Length:
182182
- "402"
@@ -185,20 +185,20 @@ interactions:
185185
Content-Type:
186186
- application/json
187187
Date:
188-
- Thu, 04 Sep 2025 15:54:43 GMT
188+
- Mon, 08 Sep 2025 19:34:17 GMT
189189
Server:
190-
- Scaleway API Gateway (fr-par-3;edge01)
190+
- Scaleway API Gateway (fr-par-3;edge02)
191191
Strict-Transport-Security:
192192
- max-age=63072000
193193
X-Content-Type-Options:
194194
- nosniff
195195
X-Frame-Options:
196196
- DENY
197197
X-Request-Id:
198-
- 86e4378c-faf3-4648-83c2-47f06c2ff03c
198+
- 312f0c6a-ca13-45cf-a551-9050fa2b7b71
199199
status: 200 OK
200200
code: 200
201-
duration: 88.346375ms
201+
duration: 27.413833ms
202202
- id: 4
203203
request:
204204
proto: HTTP/1.1
@@ -215,7 +215,7 @@ interactions:
215215
headers:
216216
User-Agent:
217217
- scaleway-sdk-go/v1.0.0-beta.7+dev (go1.24.4; darwin; arm64) terraform-provider/develop terraform/terraform-tests
218-
url: https://api.scaleway.com/vpc/v2/regions/fr-par/vpcs/763750ef-3ae5-41b9-afb2-bad95edc099f
218+
url: https://api.scaleway.com/vpc/v2/regions/fr-par/vpcs/090d68b4-0cb0-48b0-9d9f-235b5f337746
219219
method: GET
220220
response:
221221
proto: HTTP/2.0
@@ -225,7 +225,7 @@ interactions:
225225
trailer: {}
226226
content_length: 402
227227
uncompressed: false
228-
body: '{"created_at":"2025-09-04T15:54:42.724544Z","custom_routes_propagation_enabled":true,"id":"763750ef-3ae5-41b9-afb2-bad95edc099f","is_default":false,"name":"test-vpc-import","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_count":0,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","routing_enabled":true,"tags":[],"updated_at":"2025-09-04T15:54:42.724544Z"}'
228+
body: '{"created_at":"2025-09-08T19:34:16.635250Z","custom_routes_propagation_enabled":true,"id":"090d68b4-0cb0-48b0-9d9f-235b5f337746","is_default":false,"name":"test-vpc-import","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_count":0,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","routing_enabled":true,"tags":[],"updated_at":"2025-09-08T19:34:16.635250Z"}'
229229
headers:
230230
Content-Length:
231231
- "402"
@@ -234,20 +234,20 @@ interactions:
234234
Content-Type:
235235
- application/json
236236
Date:
237-
- Thu, 04 Sep 2025 15:54:43 GMT
237+
- Mon, 08 Sep 2025 19:34:17 GMT
238238
Server:
239-
- Scaleway API Gateway (fr-par-3;edge01)
239+
- Scaleway API Gateway (fr-par-3;edge02)
240240
Strict-Transport-Security:
241241
- max-age=63072000
242242
X-Content-Type-Options:
243243
- nosniff
244244
X-Frame-Options:
245245
- DENY
246246
X-Request-Id:
247-
- 6406b553-a9a6-49ef-81cf-a47a0aa402f3
247+
- 4ab4acca-9106-4ebf-8b3e-ebb94570f657
248248
status: 200 OK
249249
code: 200
250-
duration: 89.445041ms
250+
duration: 28.409666ms
251251
- id: 5
252252
request:
253253
proto: HTTP/1.1
@@ -264,7 +264,7 @@ interactions:
264264
headers:
265265
User-Agent:
266266
- scaleway-sdk-go/v1.0.0-beta.7+dev (go1.24.4; darwin; arm64) terraform-provider/develop terraform/terraform-tests
267-
url: https://api.scaleway.com/vpc/v2/regions/fr-par/vpcs/763750ef-3ae5-41b9-afb2-bad95edc099f
267+
url: https://api.scaleway.com/vpc/v2/regions/fr-par/vpcs/090d68b4-0cb0-48b0-9d9f-235b5f337746
268268
method: DELETE
269269
response:
270270
proto: HTTP/2.0
@@ -281,20 +281,20 @@ interactions:
281281
Content-Type:
282282
- application/json
283283
Date:
284-
- Thu, 04 Sep 2025 15:54:44 GMT
284+
- Mon, 08 Sep 2025 19:34:17 GMT
285285
Server:
286-
- Scaleway API Gateway (fr-par-3;edge01)
286+
- Scaleway API Gateway (fr-par-3;edge02)
287287
Strict-Transport-Security:
288288
- max-age=63072000
289289
X-Content-Type-Options:
290290
- nosniff
291291
X-Frame-Options:
292292
- DENY
293293
X-Request-Id:
294-
- 0c21bf21-7d82-4c77-b48a-00d258a0f33b
294+
- 10bf3c2b-582d-443c-88a1-473510ed9d7b
295295
status: 204 No Content
296296
code: 204
297-
duration: 133.842917ms
297+
duration: 150.545ms
298298
- id: 6
299299
request:
300300
proto: HTTP/1.1
@@ -311,7 +311,7 @@ interactions:
311311
headers:
312312
User-Agent:
313313
- scaleway-sdk-go/v1.0.0-beta.7+dev (go1.24.4; darwin; arm64) terraform-provider/develop terraform/terraform-tests
314-
url: https://api.scaleway.com/vpc/v2/regions/fr-par/vpcs/763750ef-3ae5-41b9-afb2-bad95edc099f
314+
url: https://api.scaleway.com/vpc/v2/regions/fr-par/vpcs/090d68b4-0cb0-48b0-9d9f-235b5f337746
315315
method: GET
316316
response:
317317
proto: HTTP/2.0
@@ -321,7 +321,7 @@ interactions:
321321
trailer: {}
322322
content_length: 124
323323
uncompressed: false
324-
body: '{"message":"resource is not found","resource":"vpc","resource_id":"763750ef-3ae5-41b9-afb2-bad95edc099f","type":"not_found"}'
324+
body: '{"message":"resource is not found","resource":"vpc","resource_id":"090d68b4-0cb0-48b0-9d9f-235b5f337746","type":"not_found"}'
325325
headers:
326326
Content-Length:
327327
- "124"
@@ -330,17 +330,17 @@ interactions:
330330
Content-Type:
331331
- application/json
332332
Date:
333-
- Thu, 04 Sep 2025 15:54:44 GMT
333+
- Mon, 08 Sep 2025 19:34:17 GMT
334334
Server:
335-
- Scaleway API Gateway (fr-par-3;edge01)
335+
- Scaleway API Gateway (fr-par-3;edge02)
336336
Strict-Transport-Security:
337337
- max-age=63072000
338338
X-Content-Type-Options:
339339
- nosniff
340340
X-Frame-Options:
341341
- DENY
342342
X-Request-Id:
343-
- d5bc78e8-6d28-413c-9554-9672f1b28258
343+
- 201b719b-e8a8-48a2-ba73-cc6f5056494f
344344
status: 404 Not Found
345345
code: 404
346-
duration: 59.052875ms
346+
duration: 24.397375ms

internal/services/vpc/testfuncs/checks.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func CheckPrivateNetworkDestroy(tt *acctest.TestTools) resource.TestCheckFunc {
3535
Region: region,
3636
PrivateNetworkID: id,
3737
})
38-
38+
3939
switch {
4040
case err == nil:
4141
return retry.RetryableError(fmt.Errorf("VPC private network (%s) still exists", rs.Primary.ID))

internal/services/vpc/vpc_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"fmt"
66
"regexp"
77
"testing"
8-
"time"
98

109
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry"
1110
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
@@ -224,7 +223,7 @@ func testAccCheckVPCExists(tt *acctest.TestTools, n string) resource.TestCheckFu
224223
func testAccCheckVPCDestroy(tt *acctest.TestTools) resource.TestCheckFunc {
225224
return func(state *terraform.State) error {
226225
ctx := context.Background()
227-
226+
228227
return retry.RetryContext(ctx, vpctestfuncs.DestroyWaitTimeout, func() *retry.RetryError {
229228
for _, rs := range state.RootModule().Resources {
230229
if rs.Type != "scaleway_vpc" {

0 commit comments

Comments
 (0)