Skip to content

Commit eaff88f

Browse files
Fix data source test dependencies (#114)
1 parent d0f0efa commit eaff88f

7 files changed

+9
-0
lines changed

gen/templates/data_source_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,9 @@ func testAccDataSourceCc{{camelCase .Name}}Config() string {
222222
{{.TfName}} = {{if .TestValue}}{{.TestValue}}{{else}}{{if eq .Type "String"}}"{{.Example}}"{{else if isStringListSet .}}["{{.Example}}"]{{else if isInt64ListSet .}}[{{.Example}}]{{else}}{{.Example}}{{end}}{{end}}
223223
{{- end}}
224224
{{- end}}
225+
{{- if .DataSourceNoId}}
226+
depends_on = [catalystcenter_{{snakeCase $name}}.test]
227+
{{- end}}
225228
}
226229
`
227230
return config

internal/provider/data_source_catalystcenter_anycast_gateway_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ func testAccDataSourceCcAnycastGatewayConfig() string {
117117
fabric_id = catalystcenter_fabric_site.test.id
118118
virtual_network_name = catalystcenter_virtual_network_to_fabric_site.test.virtual_network_name
119119
ip_pool_name = catalystcenter_ip_pool_reservation.test.name
120+
depends_on = [catalystcenter_anycast_gateway.test]
120121
}
121122
`
122123
return config

internal/provider/data_source_catalystcenter_assign_templates_to_tag_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ func testAccDataSourceCcAssignTemplatesToTagConfig() string {
8787
config += `
8888
data "catalystcenter_assign_templates_to_tag" "test" {
8989
tag_id = catalystcenter_tag.test.id
90+
depends_on = [catalystcenter_assign_templates_to_tag.test]
9091
}
9192
`
9293
return config

internal/provider/data_source_catalystcenter_fabric_device_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ func testAccDataSourceCcFabricDeviceConfig() string {
8989
data "catalystcenter_fabric_device" "test" {
9090
network_device_id = "5e6f7b3a-2b0b-4a7d-8b1c-0d4b1cd5e1b1"
9191
fabric_id = catalystcenter_fabric_site.test.id
92+
depends_on = [catalystcenter_fabric_device.test]
9293
}
9394
`
9495
return config

internal/provider/data_source_catalystcenter_fabric_provision_device_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ func testAccDataSourceCcFabricProvisionDeviceConfig() string {
7575
data "catalystcenter_fabric_provision_device" "test" {
7676
site_id = catalystcenter_area.test.id
7777
network_device_id = "4cb565d3-1944-42be-be9f-a87cff79e831"
78+
depends_on = [catalystcenter_fabric_provision_device.test]
7879
}
7980
`
8081
return config

internal/provider/data_source_catalystcenter_tag_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ func testAccDataSourceCcTagConfig() string {
6060
config += `
6161
data "catalystcenter_tag" "test" {
6262
name = "Tag1"
63+
depends_on = [catalystcenter_tag.test]
6364
}
6465
`
6566
return config

internal/provider/data_source_catalystcenter_transit_peer_network_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ func testAccDataSourceCcTransitPeerNetworkConfig() string {
6262
config += `
6363
data "catalystcenter_transit_peer_network" "test" {
6464
transit_peer_network_name = "TRANSIT_1"
65+
depends_on = [catalystcenter_transit_peer_network.test]
6566
}
6667
`
6768
return config

0 commit comments

Comments
 (0)