
Description
terraform-test is an agent skill that guides the writing and running of Terraform tests. It covers Terraform's built-in testing framework, which checks that configuration changes do not introduce breaking changes, and it says tests run against temporary resources so existing infrastructure and state files are protected. The skill explains the core parts of a test: a test file in .tftest.hcl or .tftest.json format, run blocks that hold a single test scenario with optional variables, providers and assertions, and assert blocks that must hold for the test to pass. It describes two test modes, apply, which creates real resources, and plan, which only validates logic. For mocking, it covers mock providers, which need Terraform 1.7.0 or later, and it tells the agent to skip them on older versions. Reference files cover mock provider syntax, GitHub Actions and GitLab CI pipeline examples, and a complete example suite for a VPC module with unit, integration and mock tests. The skill suits engineers who maintain Terraform modules and want a checklist for test coverage. It is listed on skills.sh with about 8.7K installs.…
Highlights
- Guides Terraform test files, run blocks and assertions
- Explains plan and apply test modes
- Mock providers for Terraform 1.7.0 and later
- CI examples for GitHub Actions and GitLab
Ratings & Reviews
No ratings yet
Be the first to rate terraform-test.
People also visit
hashicorp/terraform-test
Built-in testing framework for Terraform configurations with .tftest.hcl files
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
terraform-test FAQ
What does the terraform-test skill do?
It helps an agent write and run Terraform tests, with run blocks, assertions, mock providers and CI pipeline examples.
How do I install it?
Run npx skills add https://github.com/hashicorp/agent-skills --skill terraform-test in your project.
Do the tests create real resources?
Tests run in apply mode by default, which creates real resources, or in plan mode, which only validates logic. Tests run against temporary resources, so existing infrastructure is protected.
Which Terraform versions do mocks need?
Mock providers need Terraform 1.7.0 or later, and the skill says to skip them for older versions.
Does it include CI examples?
Yes. Reference files show GitHub Actions and GitLab CI pipelines for running the tests.
What are the security audit results?
Gen Agent Trust Hub: Pass. Socket: Pass. Snyk: Pass.
What are the best terraform-test alternatives?
Popular alternatives to terraform-test include hashicorp/terraform-test, hashicorp/provider-test-patterns and run-acceptance-tests. See all terraform-test alternatives



