Skip to content

Commit 1f90892

Browse files
committed
fix(tem): resolve golangci-lint issues in tests
1 parent 6a6e2c5 commit 1f90892

File tree

3 files changed

+1
-60
lines changed

3 files changed

+1
-60
lines changed

internal/services/tem/blockedlist_test.go

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -44,35 +44,3 @@ func isBlockedEmailPresent(tt *acctest.TestTools, n string) resource.TestCheckFu
4444
return nil
4545
}
4646
}
47-
48-
func isBlockedEmailDestroyed(tt *acctest.TestTools) resource.TestCheckFunc {
49-
return func(state *terraform.State) error {
50-
for _, rs := range state.RootModule().Resources {
51-
if rs.Type != "scaleway_tem_blocked_list" {
52-
continue
53-
}
54-
55-
api, region, domainID, err := tem.NewAPIWithRegionAndID(tt.Meta, rs.Primary.Attributes["domain_id"])
56-
if err != nil {
57-
return err
58-
}
59-
60-
blockedEmail := rs.Primary.Attributes["email"]
61-
62-
blocklists, err := api.ListBlocklists(&temSDK.ListBlocklistsRequest{
63-
Region: region,
64-
DomainID: domainID,
65-
Email: scw.StringPtr(blockedEmail),
66-
}, scw.WithContext(context.Background()))
67-
if err != nil {
68-
return err
69-
}
70-
71-
if len(blocklists.Blocklists) > 0 {
72-
return fmt.Errorf("blocked email %s still present after deletion", blockedEmail)
73-
}
74-
}
75-
76-
return nil
77-
}
78-
}

internal/services/tem/domain_validation.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ func ResourceDomainValidationCreate(ctx context.Context, d *schema.ResourceData,
8585
if domainCheck == nil || domainCheck.Status == "pending" || domainCheck.Status == "unchecked" || domainCheck.Status == "autoconfiguring" {
8686
// Sleep to avoid busy-wait loop and reduce API load
8787
time.Sleep(15 * time.Second)
88+
8889
return retry.RetryableError(errors.New("retry"))
8990
}
9091

internal/services/tem/webhook_test.go

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -38,31 +38,3 @@ func isWebhookPresent(tt *acctest.TestTools, n string) resource.TestCheckFunc {
3838
return nil
3939
}
4040
}
41-
42-
func isWebhookDestroyed(tt *acctest.TestTools) resource.TestCheckFunc {
43-
return func(state *terraform.State) error {
44-
for _, rs := range state.RootModule().Resources {
45-
if rs.Type != "scaleway_tem_webhook" {
46-
continue
47-
}
48-
49-
api, region, id, err := tem.NewAPIWithRegionAndID(tt.Meta, rs.Primary.ID)
50-
if err != nil {
51-
return err
52-
}
53-
54-
_, err = api.GetWebhook(&temSDK.GetWebhookRequest{
55-
WebhookID: id,
56-
Region: region,
57-
}, scw.WithContext(context.Background()))
58-
errorCode := httperrors.Is404(err)
59-
_ = errorCode
60-
61-
if err != nil && !httperrors.Is404(err) {
62-
return err
63-
}
64-
}
65-
66-
return nil
67-
}
68-
}

0 commit comments

Comments
 (0)