Skip to content

Technical debt: Replace PlanOnly acceptance tests (services g - w) #43184

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 32 commits into from
Jul 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
251905e
glacier: Replace 'PlanOnly' acceptance test steps with 'plancheck's.
ewbankkit Jun 25, 2025
bd6c474
glue: Replace 'PlanOnly' acceptance test steps with 'plancheck's.
ewbankkit Jun 25, 2025
aa0860a
iot: Replace 'PlanOnly' acceptance test steps with 'plancheck's.
ewbankkit Jun 25, 2025
9189bf9
kendra: Replace 'PlanOnly' acceptance test steps with 'plancheck's.
ewbankkit Jun 26, 2025
8d18095
iam: Replace 'PlanOnly' acceptance test steps with 'plancheck's.
ewbankkit Jun 27, 2025
34c7a78
Merge branch 'main' into td-replace-PlanOnly-test-steps-2
ewbankkit Jun 27, 2025
5be8b3d
iam: Replace 'PlanOnly' acceptance test steps with 'plancheck's.
ewbankkit Jun 27, 2025
8a5666c
kms: Replace 'PlanOnly' acceptance test steps with 'plancheck's.
ewbankkit Jun 29, 2025
a9c1d09
lambda: Replace 'PlanOnly' acceptance test steps with 'plancheck's.
ewbankkit Jun 29, 2025
86458f2
opensearch: Replace 'PlanOnly' acceptance test steps with 'plancheck's.
ewbankkit Jun 30, 2025
2507e0f
opensearchserverless: Replace 'PlanOnly' acceptance test steps with '…
ewbankkit Jun 30, 2025
f5faecf
Fix terrafmt errors.
ewbankkit Jun 30, 2025
ef2fae7
osis: Replace 'PlanOnly' acceptance test steps with 'plancheck's.
ewbankkit Jun 30, 2025
7c5be3d
rds: Replace 'PlanOnly' acceptance test steps with 'plancheck's.
ewbankkit Jun 30, 2025
b337117
redshift: Replace 'PlanOnly' acceptance test steps with 'plancheck's.
ewbankkit Jun 30, 2025
7518720
redshiftserverless: Replace 'PlanOnly' acceptance test steps with 'pl…
ewbankkit Jun 30, 2025
8a66617
route53: Replace 'PlanOnly' acceptance test steps with 'plancheck's.
ewbankkit Jun 30, 2025
1667947
s3: Replace 'PlanOnly' acceptance test steps with 'plancheck's.
ewbankkit Jun 30, 2025
d517d47
sagemaker: Replace 'PlanOnly' acceptance test steps with 'plancheck's.
ewbankkit Jun 30, 2025
1baabfa
securityhub: Replace 'PlanOnly' acceptance test steps with 'plancheck's.
ewbankkit Jun 30, 2025
6a42f45
ses: Replace 'PlanOnly' acceptance test steps with 'plancheck's.
ewbankkit Jun 30, 2025
f17e4cc
sns: Replace 'PlanOnly' acceptance test steps with 'plancheck's.
ewbankkit Jun 30, 2025
21eef8f
sqs: Replace 'PlanOnly' acceptance test steps with 'plancheck's.
ewbankkit Jun 30, 2025
d3e54f6
ssm: Replace 'PlanOnly' acceptance test steps with 'plancheck's.
ewbankkit Jun 30, 2025
79b6f79
transfer: Replace 'PlanOnly' acceptance test steps with 'plancheck's.
ewbankkit Jun 30, 2025
a79eb73
vpclattice: Replace 'PlanOnly' acceptance test steps with 'plancheck's.
ewbankkit Jul 1, 2025
f1eec23
wafv2: Replace 'PlanOnly' acceptance test steps with 'plancheck's.
ewbankkit Jul 1, 2025
f70e4a8
Add semgrep rule 'replace-planonly-checks'.
ewbankkit Jul 1, 2025
d76e561
generate/tagstests: Replace 'PlanOnly' with 'plancheck's.
ewbankkit Jul 1, 2025
b593cf8
Run 'make gen'.
ewbankkit Jul 1, 2025
5f44bc7
Run semgrep 'replace-planonly-checks' only on service acceptance tests.
ewbankkit Jul 1, 2025
af9c3f1
ec2: Replace 'PlanOnly' acceptance test steps with 'plancheck's.
ewbankkit Jul 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .ci/semgrep/acctest/checks/planonly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
rules:
- id: replace-planonly-checks
languages: [go]
message: Replace `PlanOnly` acceptance test steps with `plancheck`s
paths:
include:
- "internal/service/*/*_test.go"
patterns:
- pattern: |
{
...,
PlanOnly: true,
...
}
severity: ERROR
20 changes: 16 additions & 4 deletions internal/generate/tagstests/resource_test.go.gtpl
Original file line number Diff line number Diff line change
Expand Up @@ -492,8 +492,14 @@ func {{ template "testname" . }}_tags_null(t *testing.T) {
acctest.CtResourceTags: nil,
{{ template "AdditionalTfVars" . }}
},
PlanOnly: true,
ExpectNonEmptyPlan: false,
ConfigPlanChecks: resource.ConfigPlanChecks{
PreApply: []plancheck.PlanCheck{
plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop),
},
PostApplyPostRefresh: []plancheck.PlanCheck{
plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop),
},
},
},
{{- end }}
},
Expand Down Expand Up @@ -567,8 +573,14 @@ func {{ template "testname" . }}_tags_EmptyMap(t *testing.T) {
acctest.CtResourceTags: nil,
{{ template "AdditionalTfVars" . }}
},
PlanOnly: true,
ExpectNonEmptyPlan: false,
ConfigPlanChecks: resource.ConfigPlanChecks{
PreApply: []plancheck.PlanCheck{
plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop),
},
PostApplyPostRefresh: []plancheck.PlanCheck{
plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop),
},
},
},
{{- end }}
},
Expand Down
17 changes: 17 additions & 0 deletions internal/sdkv2/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ var IAMPolicyDocumentSchemaOptionalComputed = sync.OnceValue(jsonDocumentSchemaO
// IAMPolicyDocumentSchemaRequired returns the standard schema for a required IAM policy JSON document.
var IAMPolicyDocumentSchemaRequired = sync.OnceValue(jsonDocumentSchemaRequiredFunc(SuppressEquivalentIAMPolicyDocuments))

// IAMPolicyDocumentSchemaRequiredForceNew returns the standard schema for a required, force-new IAM policy JSON document.
var IAMPolicyDocumentSchemaRequiredForceNew = sync.OnceValue(jsonDocumentSchemaRequiredForceNewFunc(SuppressEquivalentIAMPolicyDocuments))

// JSONDocumentSchemaOptionalForceNew returns the standard schema for an optional, force-new JSON document.
var JSONDocumentSchemaOptionalForceNew = sync.OnceValue(jsonDocumentSchemaOptionalForceNewFunc(SuppressEquivalentJSONDocuments))

Expand Down Expand Up @@ -136,3 +139,17 @@ func jsonDocumentSchemaRequiredFunc(diffSuppressFunc schema.SchemaDiffSuppressFu
}
}
}

func jsonDocumentSchemaRequiredForceNewFunc(diffSuppressFunc schema.SchemaDiffSuppressFunc) func() *schema.Schema {
return func() *schema.Schema {
return &schema.Schema{
Type: schema.TypeString,
Required: true,
ForceNew: true,
ValidateFunc: validation.StringIsJSON,
DiffSuppressFunc: diffSuppressFunc,
DiffSuppressOnRefresh: true,
StateFunc: NormalizeJsonStringSchemaStateFunc,
}
}
}
20 changes: 16 additions & 4 deletions internal/service/accessanalyzer/analyzer_tags_gen_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 16 additions & 4 deletions internal/service/acm/certificate_tags_gen_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 16 additions & 4 deletions internal/service/acmpca/certificate_authority_tags_gen_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 16 additions & 4 deletions internal/service/amp/rule_group_namespace_tags_gen_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 16 additions & 4 deletions internal/service/amp/workspace_tags_gen_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 16 additions & 4 deletions internal/service/amplify/app_tags_gen_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 16 additions & 4 deletions internal/service/amplify/branch_tags_gen_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 16 additions & 4 deletions internal/service/apigateway/api_key_tags_gen_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 16 additions & 4 deletions internal/service/apigateway/client_certificate_tags_gen_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading