Terratest as acceptance test framework in provider development #539
-
|
Hi Team, We are in a process of developing terraform provider for one of our internal products and plan to publish the provider to terraform registry. We are using terraform's latest plugin framework and we do not find any acceptance framework available in it. So we are planning to use terratest as our acceptance test framework. Thanks in advance, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
As far as I know, none of the providers rely on Terratest for provider testing, as Terratest is more optimized for Terraform module testing. We don't offer first class support for provider acceptance testing, so you might find it rather limiting if you try to go down this route. That is, Terratest doesn't offer setup and teardown functions that spawn an in-dev provider - it relies on As an alternative...
It's not well documented, but I would recommend using the official framework for writing the provider tests, as the community is more used to using those framework for testing, and it maintains consistency with the official documentation on testing providers. Using the official SDK as a framework, you could however consider using Terratest for the other aspects of testing, like validating the deployed resource within the provider acceptance testing framework (if you find it useful). |
Beta Was this translation helpful? Give feedback.
As far as I know, none of the providers rely on Terratest for provider testing, as Terratest is more optimized for Terraform module testing. We don't offer first class support for provider acceptance testing, so you might find it rather limiting if you try to go down this route. That is, Terratest doesn't offer setup and teardown functions that spawn an in-dev provider - it relies on
terraform initto pull down the providers, so you would need to write the test code that builds and installs the provider in a way thatterraformcan find it, which is an awkward setup process for provider testing.As an alternative...