terraform-test

Execute Terraform tests with custom .tftest.hcl files and mock providers.

Updated Apr 19, 2026
One-click install
npx skills add https://github.com/Avihai-H/infraops --skill terraform-test-avihai-h
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: terraform-test
Source: https://github.com/Avihai-H/infraops/tree/main/.github/skills/terraform-test
Command: npx skills add https://github.com/Avihai-H/infraops --skill terraform-test-avihai-h

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires terraform, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill streamlines the creation and execution of Terraform tests, making it easy to validate and verify your infrastructure configurations.

Core Features & Use Cases

  • Automated Testing: Run unit and integration tests against your Terraform configurations automatically.
  • Mock Providers: Simulate Azure provider behavior without API calls for faster local development and testing.
  • Use Case: For a developer working on a new Azure resource module, use this Skill to create unit tests to validate resource configurations before moving to integration tests with real Azure resources.

Quick Start

Use the terraform test command in the directory containing your Terraform code to run tests.

Frequently Asked Questions about terraform-test

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run Terraform tests for infrastructure as code configurations?

Terraform tests validate infrastructure as code by executing custom `.tftest.hcl` files against your configurations. You can run tests using plan and apply modes to verify expected outputs before deploying actual resources.

Can I test Azure infrastructure configurations without making real API calls?

Yes, you can test Azure configurations without API calls by using mock providers. Mock providers simulate Azure provider behavior locally, enabling faster unit testing without provisioning actual cloud resources.

What Terraform version do I need for mock providers and test blocks?

You need Terraform version 1.6 or later for test blocks, and version 1.7 or later for mock providers. These versions enable the local testing capabilities required to validate configurations and simulate provider behavior.

How do I automate Terraform test execution in a CI pipeline?

Automate Terraform test execution by integrating the `terraform test` command into your continuous integration pipeline. This runs `.tftest.hcl` files in plan and apply modes to validate infrastructure configurations automatically.

What is the best way to validate a new Azure resource module before integration testing?

The best way to validate an Azure resource module is writing unit tests with mock providers. This simulates Azure provider behavior locally, allowing you to verify resource configurations before running integration tests with real Azure resources.