A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.hashicorp.com/terraform/plugin/testing below:

Plugin Development - Testing | Terraform

The testing framework for Terraform providers,terraform-plugin-testing, uses standard Go features such as the go test command and the standard library testing package. In addition to this documentation, refer to the generated Go documentation.

This section introduces strategies for testing provider functionality with acceptance tests and unit tests.

Acceptance tests for Terraform providers are a feature of the terraform-plugin-testing framework. The testing framework uses standard Go features such as the go test command. It runs a local Terraform binary to perform real plan, apply, refresh, and destroy operations, and enables developers to make assertions about what happens during those actions.

Refer to Acceptance Testing to learn more.

Testing plugin code in small, isolated units is distinct from Acceptance Tests, and does not require network connections. Unit tests are commonly used for testing helper methods that expand or flatten API response data into data structures for storage into state by Terraform. This section covers the specifics of writing Unit Tests for Terraform Plugin code.

For a given plugin, Unit Tests can be run from the root of the project by using a common make task:

Refer to Unit Testing to learn more.

Terraform developers are encouraged to write acceptance tests that create real resource to verify the behavior of plugins, ensuring a reliable and safe way to manage infrastructure. In Testing Patterns we cover some basic acceptance tests that almost all resources should have to validate not only the functionality of the resource, but that the resource behaves as Terraform would expect.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4