terraform-plugin-sdk icon indicating copy to clipboard operation
terraform-plugin-sdk copied to clipboard

Modify Underlying Logic Behind `TestStep.Taint` To Call The `terraform taint` Command

Open bendbennett opened this issue 3 years ago • 0 comments

SDK version

v2.20.0

Use-cases

When running tests that include TestStep.Taint resources do not appear to be tainted and do not undergo a destroy-create cycle.

Proposal

This issue results from the fact that the underlying logic behind Taint was never migrated to call the terraform taint command via terraform-exec when the rest of the testing framework was migrated to actual Terraform commands.

A (*WorkingDir)Taint() func could be added to https://github.com/hashicorp/terraform-plugin-sdk/blob/v2.20.0/internal/plugintest/working_dir.go and then the testStepTaint() func can be modified to accept *plugintest.WorkingDir so that wd.Taint() can be called within testStepTaint().

References

  • #625

bendbennett avatar Aug 12 '22 08:08 bendbennett