Skip to content

Commit

Permalink
Merge pull request #353 from terraform-providers/paralellize_ds_tests
Browse files Browse the repository at this point in the history
Parallellize data source acc tests
  • Loading branch information
annakhm authored Jun 10, 2020
2 parents c3819e8 + a10e630 commit 42f554f
Show file tree
Hide file tree
Showing 36 changed files with 64 additions and 64 deletions.
2 changes: 1 addition & 1 deletion nsxt/data_source_nsxt_edge_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func TestAccDataSourceNsxtEdgeCluster_basic(t *testing.T) {
edgeClusterName := getEdgeClusterName()
testResourceName := "data.nsxt_edge_cluster.test"

resource.Test(t, resource.TestCase{
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) },
Providers: testAccProviders,
Steps: []resource.TestStep{
Expand Down
4 changes: 2 additions & 2 deletions nsxt/data_source_nsxt_firewall_section_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import (
)

func TestAccDataSourceNsxtFirewallSection_basic(t *testing.T) {
name := "terraform_test_firewall_section"
name := "terraform_ds_test_firewall_section"
testResourceName := "data.nsxt_firewall_section.test"

resource.Test(t, resource.TestCase{
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: func(state *terraform.State) error {
Expand Down
2 changes: 1 addition & 1 deletion nsxt/data_source_nsxt_ip_pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func TestAccDataSourceNsxtIPPool_basic(t *testing.T) {
}
testResourceName := "data.nsxt_ip_pool.test"

resource.Test(t, resource.TestCase{
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) },
Providers: testAccProviders,
Steps: []resource.TestStep{
Expand Down
2 changes: 1 addition & 1 deletion nsxt/data_source_nsxt_logical_tier0_router_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func TestAccDataSourceNsxtLogicalTier0Router_basic(t *testing.T) {
routerName := getTier0RouterName()
testResourceName := "data.nsxt_logical_tier0_router.test"

resource.Test(t, resource.TestCase{
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) },
Providers: testAccProviders,
Steps: []resource.TestStep{
Expand Down
4 changes: 2 additions & 2 deletions nsxt/data_source_nsxt_logical_tier1_router_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import (
)

func TestAccDataSourceNsxtLogicalTier1Router_basic(t *testing.T) {
routerName := "terraform_test_tier1"
routerName := "terraform_ds_test_tier1"
testResourceName := "data.nsxt_logical_tier1_router.test"

resource.Test(t, resource.TestCase{
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: func(state *terraform.State) error {
Expand Down
2 changes: 1 addition & 1 deletion nsxt/data_source_nsxt_mac_pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func TestAccDataSourceNsxtMacPool_basic(t *testing.T) {
macPoolName := getMacPoolName()
testResourceName := "data.nsxt_mac_pool.test"

resource.Test(t, resource.TestCase{
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) },
Providers: testAccProviders,
Steps: []resource.TestStep{
Expand Down
4 changes: 2 additions & 2 deletions nsxt/data_source_nsxt_ns_group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import (
)

func TestAccDataSourceNsxtNsGroup_basic(t *testing.T) {
groupName := "terraform_test_ns_group"
groupName := "terraform_ds_test_ns_group"
testResourceName := "data.nsxt_ns_group.test"

resource.Test(t, resource.TestCase{
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: func(state *terraform.State) error {
Expand Down
6 changes: 3 additions & 3 deletions nsxt/data_source_nsxt_ns_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import (
)

func TestAccDataSourceNsxtNsService_basic(t *testing.T) {
serviceName := "terraform_test_ns_service"
serviceName := "terraform_ds_test_ns_service"
testResourceName := "data.nsxt_ns_service.test"

resource.Test(t, resource.TestCase{
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: func(state *terraform.State) error {
Expand Down Expand Up @@ -46,7 +46,7 @@ func TestAccDataSourceNsxtNsService_systemOwned(t *testing.T) {
serviceName := "WINS"
testResourceName := "data.nsxt_ns_service.test"

resource.Test(t, resource.TestCase{
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
Steps: []resource.TestStep{
Expand Down
2 changes: 1 addition & 1 deletion nsxt/data_source_nsxt_policy_certificate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func TestAccDataSourceNsxtPolicyCertificate_basic(t *testing.T) {
name := getTestCertificateName(false)
testResourceName := "data.nsxt_policy_certificate.test"

resource.Test(t, resource.TestCase{
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() {
testAccOnlyLocalManager(t)
testAccPreCheck(t)
Expand Down
2 changes: 1 addition & 1 deletion nsxt/data_source_nsxt_policy_edge_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func TestAccDataSourceNsxtPolicyEdgeCluster_basic(t *testing.T) {
edgeClusterName := getEdgeClusterName()
testResourceName := "data.nsxt_policy_edge_cluster.test"

resource.Test(t, resource.TestCase{
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() {
testAccPreCheck(t)
testAccNSXGlobalManagerSitePrecheck(t)
Expand Down
2 changes: 1 addition & 1 deletion nsxt/data_source_nsxt_policy_edge_node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func TestAccDataSourceNsxtPolicyEdgeNode_basic(t *testing.T) {
edgeClusterName := getEdgeClusterName()
testResourceName := "data.nsxt_policy_edge_node.test"

resource.Test(t, resource.TestCase{
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() {
testAccPreCheck(t)
testAccNSXGlobalManagerSitePrecheck(t)
Expand Down
4 changes: 2 additions & 2 deletions nsxt/data_source_nsxt_policy_gateway_qos_profile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ import (
)

func TestAccDataSourceNsxtPolicyGatewayQosProfile_basic(t *testing.T) {
name := "terraform_test"
name := "terraform_ds_test"
testResourceName := "data.nsxt_policy_gateway_qos_profile.test"

resource.Test(t, resource.TestCase{
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "3.0.0") },
Providers: testAccProviders,
CheckDestroy: func(state *terraform.State) error {
Expand Down
4 changes: 2 additions & 2 deletions nsxt/data_source_nsxt_policy_ip_block_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import (
)

func TestAccDataSourceNsxtPolicyIpBlock_basic(t *testing.T) {
name := "terraform_test"
name := "terraform_ds_test"
testResourceName := "data.nsxt_policy_ip_block.test"

resource.Test(t, resource.TestCase{
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "3.0.0") },
Providers: testAccProviders,
CheckDestroy: func(state *terraform.State) error {
Expand Down
2 changes: 1 addition & 1 deletion nsxt/data_source_nsxt_policy_ip_discovery_profile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func TestAccDataSourceNsxtPolicyIPDiscoveryProfile_basic(t *testing.T) {
name := "default-ip-discovery-profile"
testResourceName := "data.nsxt_policy_ip_discovery_profile.test"

resource.Test(t, resource.TestCase{
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) },
Providers: testAccProviders,
Steps: []resource.TestStep{
Expand Down
4 changes: 2 additions & 2 deletions nsxt/data_source_nsxt_policy_ip_pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import (
)

func TestAccDataSourceNsxtPolicyIpPool_basic(t *testing.T) {
name := "terraform_test"
name := "terraform_ds_test"
testResourceName := "data.nsxt_policy_ip_pool.test"

resource.Test(t, resource.TestCase{
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: func(state *terraform.State) error {
Expand Down
4 changes: 2 additions & 2 deletions nsxt/data_source_nsxt_policy_ipv6_dad_profile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import (
)

func TestAccDataSourceNsxtPolicyIpv6DadProfile_basic(t *testing.T) {
name := "terraform_test"
name := "terraform_ds_test"
testResourceName := "data.nsxt_policy_ipv6_dad_profile.test"

resource.Test(t, resource.TestCase{
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: func(state *terraform.State) error {
Expand Down
4 changes: 2 additions & 2 deletions nsxt/data_source_nsxt_policy_ipv6_ndra_profile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import (
)

func TestAccDataSourceNsxtPolicyIpv6NdraProfile_basic(t *testing.T) {
name := "terraform_test"
name := "terraform_ds_test"
testResourceName := "data.nsxt_policy_ipv6_ndra_profile.test"

resource.Test(t, resource.TestCase{
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: func(state *terraform.State) error {
Expand Down
4 changes: 2 additions & 2 deletions nsxt/data_source_nsxt_policy_lb_app_profile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ import (
)

func TestAccDataSourceNsxtPolicyLBAppProfile_basic(t *testing.T) {
name := "terraform_test"
name := "terraform_ds_test"
testResourceName := "data.nsxt_policy_lb_app_profile.test"

resource.Test(t, resource.TestCase{
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: func(state *terraform.State) error {
Expand Down
4 changes: 2 additions & 2 deletions nsxt/data_source_nsxt_policy_lb_client_ssl_profile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import (
)

func TestAccDataSourceNsxtPolicyLBClientSslProfile_basic(t *testing.T) {
name := "terraform_test"
name := "terraform_ds_test"
testResourceName := "data.nsxt_policy_lb_client_ssl_profile.test"

resource.Test(t, resource.TestCase{
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: func(state *terraform.State) error {
Expand Down
4 changes: 2 additions & 2 deletions nsxt/data_source_nsxt_policy_lb_monitor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ import (
)

func TestAccDataSourceNsxtPolicyLBMonitor_basic(t *testing.T) {
name := "terraform_test"
name := "terraform_ds_test"
testResourceName := "data.nsxt_policy_lb_monitor.test"

resource.Test(t, resource.TestCase{
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: func(state *terraform.State) error {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
func TestAccDataSourceNsxtPolicyPolicyLbPersistenceProfile_basic(t *testing.T) {
testResourceName := "data.nsxt_policy_lb_persistence_profile.test"

resource.Test(t, resource.TestCase{
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) },
Providers: testAccProviders,
Steps: []resource.TestStep{
Expand Down
4 changes: 2 additions & 2 deletions nsxt/data_source_nsxt_policy_lb_server_ssl_profile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import (
)

func TestAccDataSourceNsxtPolicyLBServerSslProfile_basic(t *testing.T) {
name := "terraform_test"
name := "terraform_ds_test"
testResourceName := "data.nsxt_policy_lb_server_ssl_profile.test"

resource.Test(t, resource.TestCase{
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: func(state *terraform.State) error {
Expand Down
2 changes: 1 addition & 1 deletion nsxt/data_source_nsxt_policy_mac_discovery_profile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func TestAccDataSourceNsxtPolicyMacDiscoveryProfile_basic(t *testing.T) {
name := "default-mac-discovery-profile"
testResourceName := "data.nsxt_policy_mac_discovery_profile.test"

resource.Test(t, resource.TestCase{
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
Steps: []resource.TestStep{
Expand Down
4 changes: 2 additions & 2 deletions nsxt/data_source_nsxt_policy_qos_profile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ import (
)

func TestAccDataSourceNsxtPolicyQosProfile_basic(t *testing.T) {
name := "terraform_test"
name := "terraform_ds_test"
testResourceName := "data.nsxt_policy_qos_profile.test"

resource.Test(t, resource.TestCase{
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: func(state *terraform.State) error {
Expand Down
16 changes: 8 additions & 8 deletions nsxt/data_source_nsxt_policy_realization_info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import (

func TestAccDataSourceNsxtPolicyRealizationInfo_tier1DataSource(t *testing.T) {
resourceDataType := "nsxt_policy_tier1_gateway"
resourceName := "terraform_test_tier1"
resourceName := "terraform_test_tier1_1"
entityType := ""
testResourceName := "data.nsxt_policy_realization_info.realization_info"

resource.Test(t, resource.TestCase{
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccOnlyLocalManager(t) },
Providers: testAccProviders,
CheckDestroy: func(state *terraform.State) error {
Expand Down Expand Up @@ -46,11 +46,11 @@ func TestAccDataSourceNsxtPolicyRealizationInfo_tier1DataSource(t *testing.T) {

func TestAccDataSourceNsxtPolicyRealizationInfo_tier1DataSourceEntity(t *testing.T) {
resourceDataType := "nsxt_policy_tier1_gateway"
resourceName := "terraform_test_tier1"
resourceName := "terraform_test_tier1_2"
entityType := "RealizedLogicalRouter"
testResourceName := "data.nsxt_policy_realization_info.realization_info"

resource.Test(t, resource.TestCase{
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccOnlyLocalManager(t) },
Providers: testAccProviders,
CheckDestroy: func(state *terraform.State) error {
Expand Down Expand Up @@ -80,11 +80,11 @@ func TestAccDataSourceNsxtPolicyRealizationInfo_tier1DataSourceEntity(t *testing

func TestAccDataSourceNsxtPolicyRealizationInfo_tier1Resource(t *testing.T) {
resourceType := "nsxt_policy_tier1_gateway"
resourceName := "terraform_test_tier1"
resourceName := "terraform_test_tier1_3"
entityType := "RealizedLogicalRouter"
testResourceName := "data.nsxt_policy_realization_info.realization_info"

resource.Test(t, resource.TestCase{
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "3.0.0"); testAccOnlyLocalManager(t) },
Providers: testAccProviders,
Steps: []resource.TestStep{
Expand All @@ -107,7 +107,7 @@ func TestAccDataSourceNsxtPolicyRealizationInfo_tier1Resource(t *testing.T) {
func TestAccDataSourceNsxtPolicyRealizationInfo_errorState(t *testing.T) {
testResourceName := "data.nsxt_policy_realization_info.realization_info"

resource.Test(t, resource.TestCase{
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccOnlyLocalManager(t) },
Providers: testAccProviders,
Steps: []resource.TestStep{
Expand All @@ -131,7 +131,7 @@ func TestAccDataSourceNsxtPolicyRealizationInfo_gmServiceDataSource(t *testing.T
testResourceName := "data.nsxt_policy_realization_info.realization_info"
site := getTestSiteName()

resource.Test(t, resource.TestCase{
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() {
testAccPreCheck(t)
testAccEnvDefined(t, "NSXT_TEST_SITE_NAME")
Expand Down
2 changes: 1 addition & 1 deletion nsxt/data_source_nsxt_policy_segment_realization_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
func testAccDataSourceNsxtPolicySegmentRealization(t *testing.T, vlan bool) {
testResourceName := "data.nsxt_policy_segment_realization.test"

resource.Test(t, resource.TestCase{
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "3.0.0") },
Providers: testAccProviders,
Steps: []resource.TestStep{
Expand Down
6 changes: 3 additions & 3 deletions nsxt/data_source_nsxt_policy_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func TestAccDataSourceNsxtPolicyService_basic(t *testing.T) {
serviceName := "DNS"
testResourceName := "data.nsxt_policy_service.test"

resource.Test(t, resource.TestCase{
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
Steps: []resource.TestStep{
Expand All @@ -36,7 +36,7 @@ func TestAccDataSourceNsxtPolicyService_byId(t *testing.T) {
serviceID := "DNS"
testResourceName := "data.nsxt_policy_service.test"

resource.Test(t, resource.TestCase{
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
Steps: []resource.TestStep{
Expand All @@ -60,7 +60,7 @@ func TestAccDataSourceNsxtPolicyService_byPrefix(t *testing.T) {
servicePrefix := "Heart"
testResourceName := "data.nsxt_policy_service.test"

resource.Test(t, resource.TestCase{
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
Steps: []resource.TestStep{
Expand Down
2 changes: 1 addition & 1 deletion nsxt/data_source_nsxt_policy_site_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func TestAccDataSourceNsxtPolicySite_basic(t *testing.T) {
name := getTestSiteName()
testResourceName := "data.nsxt_policy_site.test"

resource.Test(t, resource.TestCase{
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() {
testAccPreCheck(t)
testAccOnlyGlobalManager(t)
Expand Down
2 changes: 1 addition & 1 deletion nsxt/data_source_nsxt_policy_spoofguard_profile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func TestAccDataSourceNsxtPolicySpoofGuardProfile_basic(t *testing.T) {
name := "default-spoofguard-profile"
testResourceName := "data.nsxt_policy_spoofguard_profile.test"

resource.Test(t, resource.TestCase{
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
Steps: []resource.TestStep{
Expand Down
Loading

0 comments on commit 42f554f

Please sign in to comment.