Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(domain): domain basic2 test subdomain name collide with basic #1322

Merged
merged 7 commits into from
Jun 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions scaleway/resource_domain_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -534,11 +534,11 @@ func resourceScalewayDomainRecordDelete(ctx context.Context, d *schema.ResourceD

if !hasRecords {
_, err = waitForDNSZone(ctx, domainAPI, d.Get("dns_zone").(string), d.Timeout(schema.TimeoutDelete))
if err != nil && !ErrCodeEquals(err, domain.ErrCodeNoSuchDNSZone) {
if is404Error(err) {
if err != nil {
if errorCheck(err, domain.ErrCodeNoSuchDNSZone) {
return nil
}
return diag.FromErr(err)
return diag.FromErr(fmt.Errorf("failed to wait for dns zone before deleting: %w", err))
}

_, err = domainAPI.DeleteDNSZone(&domain.DeleteDNSZoneRequest{
Expand Down
4 changes: 2 additions & 2 deletions scaleway/resource_domain_record_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ func TestAccScalewayDomainRecord_Basic2(t *testing.T) {
tt := NewTestTools(t)
defer tt.Cleanup()

testDNSZone := fmt.Sprintf("test-basic.%s", testDomain)
testDNSZone := fmt.Sprintf("test-basic2.%s", testDomain)
l.Debugf("TestAccScalewayDomainRecord_Basic: test dns zone: %s", testDNSZone)

recordType := "A"
Expand Down Expand Up @@ -694,7 +694,7 @@ func testAccCheckScalewayDomainRecordDestroy(tt *TestTools) resource.TestCheckFu
}

if err != nil {
return err
return fmt.Errorf("failed to check if domain zone exists: %w", err)
}

if listDNSZones.TotalCount > 0 {
Expand Down
758 changes: 313 additions & 445 deletions scaleway/testdata/domain-record-basic.cassette.yaml

Large diffs are not rendered by default.

917 changes: 376 additions & 541 deletions scaleway/testdata/domain-record-basic2.cassette.yaml

Large diffs are not rendered by default.

290 changes: 112 additions & 178 deletions scaleway/testdata/domain-record-geo-ip.cassette.yaml

Large diffs are not rendered by default.

295 changes: 131 additions & 164 deletions scaleway/testdata/domain-record-http-service.cassette.yaml

Large diffs are not rendered by default.

262 changes: 131 additions & 131 deletions scaleway/testdata/domain-record-view.cassette.yaml

Large diffs are not rendered by default.

295 changes: 131 additions & 164 deletions scaleway/testdata/domain-record-weighted.cassette.yaml

Large diffs are not rendered by default.