hashicorp/terraform-test
Built-in testing framework for Terraform configurations with .tftest.hcl files
Open source
Description
terraform-test is an agent skill from HashiCorp that covers Terraform's built-in testing framework for writing and running tests against Terraform configurations. Tests are written in .tftest.hcl files with run blocks, assert conditions and optional mock providers, so module behavior can be checked without external test tools. The page compares it with third-party tools such as Terratest, noting that terraform test runs natively with no extra binaries, supports mock providers that avoid cloud costs, and fits into existing CI workflows with a single command. Example jobs from the page are writing .tftest.hcl files to check module outputs before changes are merged, running plan-mode unit tests locally without provisioning real resources, mocking AWS or Azure providers to test conditional logic without credentials, catching variable validation regressions with expect_failures in CI, and testing for_each resource counts. It suits Terraform module authors who want fast checks in their pipeline. Install it with npx skills add https://github.com/hashicorp/agent-skills --skill terraform-test. HashiCorp publishes it in its agent-skills repository on GitHub, and the page labels it official.…
Highlights
- Tests in .tftest.hcl files with run blocks
- Mock providers avoid cloud costs
- Plan-mode unit tests without real resources
- expect_failures for validation checks
- Runs in CI with a single command
Ratings & Reviews
No ratings yet
Be the first to rate hashicorp/terraform-test.
People also visit
hashicorp/provider-test-patterns
Acceptance test patterns for Terraform providers using terraform-plugin-testing
hashicorp/run-acceptance-tests
Run acceptance tests for Terraform providers using Go's test runner

provider-test-patterns
Terraform provider acceptance test patterns using terraform-plugin-testing
hashicorp/terraform-test FAQ
What does terraform-test do?
It writes and runs tests for Terraform configurations using the built-in test framework and .tftest.hcl files.
How do I install it?
Run npx skills add https://github.com/hashicorp/agent-skills --skill terraform-test.
Does it need extra tools?
No. The page says terraform test runs natively with no extra binaries, unlike Terratest.
Can tests run without cloud access?
Yes. The page describes mock providers and plan-mode tests that run without provisioning real resources.
Who publishes it?
HashiCorp, in its agent-skills repository on GitHub. The page labels it official.
What are the best hashicorp/terraform-test alternatives?
Popular alternatives to hashicorp/terraform-test include terraform-test, hashicorp/provider-test-patterns and run-acceptance-tests. See all hashicorp/terraform-test alternatives





