From 490ee8c17d69ebc1c30f8e97b4787344c63b39e6 Mon Sep 17 00:00:00 2001 From: James Bardin Date: Wed, 17 May 2017 15:33:30 -0400 Subject: [PATCH 1/2] convert dns tests with external deps tyo ACC tests External network calls can fail, and shouldn't stop unit tests from running. --- builtin/providers/dns/data_dns_a_record_set_test.go | 2 +- builtin/providers/dns/data_dns_cname_record_set_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/providers/dns/data_dns_a_record_set_test.go b/builtin/providers/dns/data_dns_a_record_set_test.go index 9209b5f5c..34f72f6e7 100644 --- a/builtin/providers/dns/data_dns_a_record_set_test.go +++ b/builtin/providers/dns/data_dns_a_record_set_test.go @@ -43,7 +43,7 @@ func TestAccDataDnsARecordSet_Basic(t *testing.T) { for _, test := range tests { recordName := fmt.Sprintf("data.dns_a_record_set.%s", test.DataSourceName) - resource.UnitTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ Providers: testAccProviders, Steps: []resource.TestStep{ resource.TestStep{ diff --git a/builtin/providers/dns/data_dns_cname_record_set_test.go b/builtin/providers/dns/data_dns_cname_record_set_test.go index 21e8eeb77..1d59f9514 100644 --- a/builtin/providers/dns/data_dns_cname_record_set_test.go +++ b/builtin/providers/dns/data_dns_cname_record_set_test.go @@ -24,7 +24,7 @@ func TestAccDnsCnameRecordSet_Basic(t *testing.T) { } for _, test := range tests { - r.UnitTest(t, r.TestCase{ + r.Test(t, r.TestCase{ Providers: testAccProviders, Steps: []r.TestStep{ r.TestStep{ From 6254bb63879110d231fa7abe12853373358a8d2d Mon Sep 17 00:00:00 2001 From: James Bardin Date: Wed, 17 May 2017 15:35:04 -0400 Subject: [PATCH 2/2] don't rename imports except to avoid collisions --- .../dns/data_dns_cname_record_set_test.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/builtin/providers/dns/data_dns_cname_record_set_test.go b/builtin/providers/dns/data_dns_cname_record_set_test.go index 1d59f9514..6bbdbdfa0 100644 --- a/builtin/providers/dns/data_dns_cname_record_set_test.go +++ b/builtin/providers/dns/data_dns_cname_record_set_test.go @@ -3,7 +3,7 @@ package dns import ( "testing" - r "github.com/hashicorp/terraform/helper/resource" + "github.com/hashicorp/terraform/helper/resource" ) func TestAccDnsCnameRecordSet_Basic(t *testing.T) { @@ -24,19 +24,19 @@ func TestAccDnsCnameRecordSet_Basic(t *testing.T) { } for _, test := range tests { - r.Test(t, r.TestCase{ + resource.Test(t, resource.TestCase{ Providers: testAccProviders, - Steps: []r.TestStep{ - r.TestStep{ + Steps: []resource.TestStep{ + resource.TestStep{ Config: test.DataSourceBlock, - Check: r.ComposeTestCheckFunc( - r.TestCheckResourceAttr("data.dns_cname_record_set.foo", "cname", test.Expected), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("data.dns_cname_record_set.foo", "cname", test.Expected), ), }, - r.TestStep{ + resource.TestStep{ Config: test.DataSourceBlock, - Check: r.ComposeTestCheckFunc( - r.TestCheckResourceAttr("data.dns_cname_record_set.foo", "id", test.Host), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("data.dns_cname_record_set.foo", "id", test.Host), ), }, },