Consider introducing statecheck
support for Import test mode
#365
Labels
enhancement
New feature or request
statecheck
support for Import test mode
#365
terraform-plugin-testing version
Use cases
terraform-plugin-testing
currently supports a new method of asserting values in Terraform state duringConfig
mode with thestatecheck
package and the(TestStep).ConfigStateChecks
field.The
Import
mode for testing also has the(TestStep).ImportStateCheck
field for performing state checks after, see:terraform-plugin-testing/helper/resource/testing_new_import_state.go
Lines 152 to 177 in 9501a02
Proposal
We could introduce a similar state check implementation to
ConfigStateChecks
, with a new field(TestStep).ImportStateChecks
. This implementation should be equivalent to theConfig
mode, since they both useterraform show
to grab the JSON state representation.We could also consider adjusting these tests and our documentation to use the import block, where we would then switch to using the
plancheck
package for checking values.References
statecheck
package and value comparers terraform-provider-random#599The text was updated successfully, but these errors were encountered: