forked from hashicorp/terraform-provider-aws
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests/provider: Introduce shared disappears TestCheckFunc, refactor B…
…ackup testing to implement and verify (hashicorp#12864) * tests/provider: Introduce shared disappears TestCheckFunc, refactor Backup testing to implement and verify A common problem in Terraform Providers is the need to verify that a Terraform Resource will successfully remove itself from the Terraform state when externally deleted. In an effort to test this functionality, the Terraform AWS Provider has implemented testing, commonly named `_disappears` in each resource's acceptance testing, where each test includes a `TestCheckFunc` that manually reimplements the deletion functionality of the resource. This change proposes the introduction of a shared `TestCheckFunc` that can prevent the necessity of manually reimplementing the resource deletion code in a `TestCheckFunc` for each resource. If acceptable, a GitHub issue will be created outlining a refactoring and documentation proposal for the provider codebase. It is worth noting that in the future, the Terraform Plugin SDK's acceptance testing framework could introduce native functionality for this type of common testing, but this shared `TestCheckFunc` is an effort to reduce a current development pain point. Output from acceptance testing: ``` --- PASS: TestAccAwsBackupVault_disappears (13.75s) --- PASS: TestAccAwsBackupPlan_disappears (18.15s) --- PASS: TestAccAwsBackupSelection_disappears (24.02s) ``` * tests/provider: Remove extra colon in testAccCheckResourceDisappears error message Reference: hashicorp#12864 (review)
- Loading branch information
Showing
4 changed files
with
22 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters