Skip to content

Commit

Permalink
fix(domain): domain basic2 test subdomain name collide with basic (#1322
Browse files Browse the repository at this point in the history
)

Co-authored-by: Rémy Léone <rleone@scaleway.com>
  • Loading branch information
Codelax and remyleone committed Jun 7, 2022
1 parent 93f5c03 commit 3d6bf9c
Show file tree
Hide file tree
Showing 8 changed files with 1,199 additions and 1,628 deletions.
6 changes: 3 additions & 3 deletions scaleway/resource_domain_record.go
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
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.

0 comments on commit 3d6bf9c

Please sign in to comment.