Support configurations in JSON syntax in the provider test framework #721
Labels
enhancement
New feature or request
subsystem/tests
Issues and feature requests related to the testing framework.
Milestone
SDK version
Use-cases
The end goal is being able to use the JSON syntax when authoring provider tests.
Currently, you're forced to write the test configurations in the native syntax (see resource.TestStep.Config).
We're generating our Terraform configuration in JSON syntax. Having the feature would simplify testing the generated JSON with Terraform CLI directly (which is what resource.Test does), rather than passing the configuration through a conversion before feeding it to the test framework.
Attempted Solutions
As stated above, converting from the native syntax to JSON would work, but that adds a conversion layer that is not present outside of the tests. Outside of the tests, the JSON configuration is fed to Terraform CLI directly via
*.tf.json
files.Proposal
(This is a revised proposal and now incorporates suggestions from this comment.)
Auto-detect whether resource.TestStep.Config contains valid JSON. When it does, the test framework will write out a
.tf.json
file, rather than a.tf
one, before running the Terraform CLI.I have a PR that achieves this: #722
References
The text was updated successfully, but these errors were encountered: