Announcing the Terraform Plugin Testing module

terraform-plugin-testing is a new Go module for testing Terraform providers. Terraform acceptance tests use real Terraform configurations to exercise the code in real plan, apply, refresh, and destroy life cycles. Terraform’s provider testing framework compiles the current provider in-memory and executes the provided configuration in developer-defined steps, managing infrastructure along the way similar to real world changes.

The Go packages for provider testing were originally part of the terraform-plugin-sdk Go module, but with the release of terraform-plugin-framework 1.0, they have been promoted to a separate Github repository to reduce potential confusion. Migrating existing provider testing code to use the Terraform Plugin Testing module should be relatively straightforward, generally only requiring updates to Go import paths without any expected changes to functionality.

The initial version was released as v1.0.0 without any additional changes from the original source. v1.1.0 adds a new feature to persist Terraform files generated during each test step. All new testing features and enhancements will appear in terraform-plugin-testing, although bug fixes may be applied to the original Go packages in terraform-plugin-sdk as well.

While both terraform-plugin-framework and terraform-plugin-sdk providers can safely use this module, we encourage the use of the Plugin Framework for all new provider development. Additional information about the Framework’s benefits over the prior SDK can be found in the website documentation.

Cheers -
Dave Parfitt

Manager, Terraform Developer Experience

2 Likes