Open mingzhaodotname 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
1.6.0
Use-cases
We want to test the behavior when an Update fails.
Currently, we can only use ExpectError to check the error message. However, if we want to check more things, e.g. what's the value of a given attributes in tfstate, it is not possible because "Check" function is not run when there are errors, see: https://github.com/hashicorp/terraform-plugin-sdk/blob/7f53d13be6bdb4b24d447c26d66bcf8888c5be90/helper/resource/testing_config.go#L99
Proposal
Run the Check function before returning the Update failures, e.g.