Skip to content

Commit 5cbdaaa

Browse files
tests(iam): bump go-vcr to v4 for iam package, fix nightly
1 parent 122b030 commit 5cbdaaa

39 files changed

+25145
-39457
lines changed

internal/acctest/acctest.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ type TestTools struct {
3434
var foldersUsingVCRv4 = []string{
3535
"account",
3636
"container",
37+
"iam",
3738
"instance",
3839
"k8s",
3940
"marketplace",

internal/services/iam/api_key_test.go

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"fmt"
66
"testing"
7+
"time"
78

89
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry"
910
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
@@ -141,6 +142,8 @@ func TestAccApiKey_Expires(t *testing.T) {
141142
tt := acctest.NewTestTools(t)
142143
defer tt.Cleanup()
143144

145+
expiresAt := time.Now().UTC().Add(time.Minute * 10).Format(time.RFC3339)
146+
144147
resource.ParallelTest(t, resource.TestCase{
145148
ProtoV6ProviderFactories: tt.ProviderFactories,
146149
CheckDestroy: resource.ComposeTestCheckFunc(
@@ -149,38 +152,24 @@ func TestAccApiKey_Expires(t *testing.T) {
149152
),
150153
Steps: []resource.TestStep{
151154
{
152-
Config: `
155+
Config: fmt.Sprintf(`
153156
resource "scaleway_iam_application" "main" {
154157
name = "tf_tests_app_expires_at"
155158
}
156159
157160
resource "scaleway_iam_api_key" "main" {
158161
application_id = scaleway_iam_application.main.id
159162
description = "tf_tests_expires"
160-
expires_at = "2025-07-06T11:00:00+02:00"
163+
expires_at = "%s"
161164
}
162-
`,
165+
`, expiresAt),
163166
Check: resource.ComposeTestCheckFunc(
164167
testAccCheckIamAPIKeyExists(tt, "scaleway_iam_api_key.main"),
165168
resource.TestCheckResourceAttrPair("scaleway_iam_api_key.main", "application_id", "scaleway_iam_application.main", "id"),
166169
resource.TestCheckResourceAttr("scaleway_iam_api_key.main", "description", "tf_tests_expires"),
167-
resource.TestCheckResourceAttr("scaleway_iam_api_key.main", "expires_at", "2025-07-06T09:00:00Z"),
170+
resource.TestCheckResourceAttr("scaleway_iam_api_key.main", "expires_at", expiresAt),
168171
),
169172
},
170-
{
171-
Config: `
172-
resource "scaleway_iam_application" "main" {
173-
name = "tf_tests_app_expires_at"
174-
}
175-
176-
resource "scaleway_iam_api_key" "main" {
177-
application_id = scaleway_iam_application.main.id
178-
description = "tf_tests_expires"
179-
expires_at = "2025-07-06T09:00:00Z"
180-
}
181-
`,
182-
PlanOnly: true,
183-
},
184173
},
185174
})
186175
}

internal/services/iam/group_membership_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ func TestAccGroupMembership_User(t *testing.T) {
119119
}
120120
121121
data "scaleway_iam_user" "main" {
122-
user_id = "b6360d4f-831c-45a8-889e-0b65ed079e63"
122+
user_id = "ef29ce05-3f2b-4fa0-a259-d76110850d57"
123123
}
124124
125125
resource scaleway_iam_group_membership main {

internal/services/iam/group_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ func TestAccGroup_Users(t *testing.T) {
260260
{
261261
Config: `
262262
data "scaleway_iam_user" "user02" {
263-
user_id = "b6360d4f-831c-45a8-889e-0b65ed079e63"
263+
user_id = "ef29ce05-3f2b-4fa0-a259-d76110850d57"
264264
}
265265
266266
resource "scaleway_iam_group" "main_user" {
@@ -374,7 +374,7 @@ func TestAccGroup_UsersAndApplications(t *testing.T) {
374374
user_id = "ef29ce05-3f2b-4fa0-a259-d76110850d57"
375375
}
376376
data "scaleway_iam_user" "user01" {
377-
user_id = "b6360d4f-831c-45a8-889e-0b65ed079e63"
377+
user_id = "84d20ae1-9650-419a-ab74-7ab09b6262e0"
378378
}
379379
380380
resource "scaleway_iam_group" "main_mix" {
@@ -411,7 +411,7 @@ func TestAccGroup_UsersAndApplications(t *testing.T) {
411411
user_id = "ef29ce05-3f2b-4fa0-a259-d76110850d57"
412412
}
413413
data "scaleway_iam_user" "user03" {
414-
user_id = "b6360d4f-831c-45a8-889e-0b65ed079e63"
414+
user_id = "88b4dde1-f3d4-478a-a281-784d53399a30"
415415
}
416416
data "scaleway_iam_user" "user04" {
417417
user_id = "84d20ae1-9650-419a-ab74-7ab09b6262e0"

0 commit comments

Comments
 (0)