Skip to content

Commit 531b250

Browse files
authored
Merge pull request #43665 from hashicorp/td-test-gen-init-formatting
Generated Tests: Updates test formatting to consolidate templates
2 parents e291c50 + 2f3d60d commit 531b250

File tree

310 files changed

+4528
-16
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

310 files changed

+4528
-16
lines changed

internal/generate/identitytests/resource_test.go.gtpl

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
// Code generated by internal/generate/identitytests/main.go; DO NOT EDIT.
22

3-
{{ define "Init" }}
4-
ctx := acctest.Context(t)
5-
{{ if .ExistsTypeName }}
6-
var v {{ .ExistsTypeName }}
7-
{{ end -}}
8-
{{ template "commonInit" . }}
9-
{{ end }}
10-
113
{{/* This can be removed when the Exists check supports enhanced region support */}}
124
{{ define "InitRegionOverride" }}
135
ctx := acctest.Context(t)

internal/generate/tagstests/resource_test.go.gtpl

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
// Code generated by internal/generate/tagstests/main.go; DO NOT EDIT.
22

3-
{{ define "Init" }}
4-
ctx := acctest.Context(t)
5-
{{ if .ExistsTypeName -}}
6-
var v {{ .ExistsTypeName }}
7-
{{ end -}}
8-
{{ template "commonInit" . }}
9-
{{ end }}
10-
113
{{ define "TestCaseSetupNoProviders" -}}
124
{{ template "CommonTestCaseChecks" . }}
135
CheckDestroy: {{ if .CheckDestroyNoop }}acctest.CheckDestroyNoop{{ else }}testAccCheck{{ .Name }}Destroy(ctx{{ if .DestroyTakesT }}, t{{ end }}){{ end }},

internal/generate/tests/data_source_test.go.gtpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ dataSourceName := "data.{{ .TypeName}}.test"
88

99
{{ define "Init" }}
1010
ctx := acctest.Context(t)
11+
1112
{{ template "commonInit" . }}
1213
{{ end }}

internal/generate/tests/resource_test.go.gtpl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,12 @@
55
{{ define "targetName" -}}
66
resourceName := "{{ .TypeName}}.test"
77
{{- end }}
8+
9+
{{ define "Init" }}
10+
ctx := acctest.Context(t)
11+
12+
{{ if .ExistsTypeName -}}
13+
var v {{ .ExistsTypeName }}
14+
{{ end -}}
15+
{{ template "commonInit" . }}
16+
{{ end }}

internal/service/accessanalyzer/analyzer_tags_gen_test.go

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/service/acm/certificate_data_source_tags_gen_test.go

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)