-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Document, Standardize, and Potentially Lint for Parent Resource Disappears Test Naming #16591
Comments
Example - id: acceptance-test-naming-parent-disappears
languages: [go]
message: Prefer naming acceptance tests with _disappears_Parent suffix
paths:
include:
- 'aws/*_test.go'
patterns:
- pattern: func $FUNCNAME(t *testing.T) { ... }
- metavariable-regex:
metavariable: "$FUNCNAME"
regex: "^TestAcc[^_]+_[a-zA-Z]+[dD]isappears$"
severity: WARNING
|
…esting of parent resources Reference: #16591
This has been released in version 3.21.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks! |
…appears_RouteTable' (hashicorp#16591).
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Community Note
Description
We currently document disappears testing for the simplest case (the resource itself) in the Contributing Guide, however there is not documentation for how to handle disappears testing designed for children resources where the test is meant to verify that removing the parent resource occurs in a recreation plan rather than an error, e.g. for verifying VPC deletion for a Route 53 Zone Association
There are also two current styles for naming these tests, where the first should be preferred due to higher prevalence:
We can document the preferred style and example implementation in the Contributing Guide. We may also be able to create a
semgrep
rule that reports these.Affected Resource(s)
aws/resource_aws_backup_selection_test.go
aws/resource_aws_emr_instance_group_test.go
aws/resource_aws_lambda_event_source_mapping_test.go
aws/resource_aws_launch_configuration_test.go
aws/resource_aws_msk_scram_secret_association_test.go
aws/resource_aws_network_acl_rule_test.go
aws/resource_aws_s3_access_point_test.go
aws/resource_aws_s3_bucket_public_access_block_test.go
aws/resource_aws_wafv2_web_acl_logging_configuration_test.go
References
The text was updated successfully, but these errors were encountered: