Open Tensho opened 4 years ago
Hi folks 👋
With the introduction of the terraform-plugin-testing module (migration guide), we are transferring feature requests relating to the helper/resource
"testing framework" in the terraform-plugin-sdk repository over to the new terraform-plugin-testing repository.
Thanks again for this feature request.
SDK version
Use-cases
AWS WorkSpaces Directories require an IAM Role named
workspaces_DefaultRole
. If the role is created and destroyed as part of each test, they have to be completely serialized. If the test suite grows, this will slow down execution, so we should try to make the tests parallel. This requires moving the IAM Role to an external dependency which the tests can assume has been defined. Right now we check the IAM role existence before test run.Some setup/teardown hooks for the set of tests in the suite could help
terraform-provider-aws
team to solve the described problem. I do believe not only AWS has singleton resources and this feature would be valuable for other providers.Proposal
Maybe
t.Cleanup()
(Go 1.14) func could be helpful for this.References