Terratest Module Testing
Generate and refactor Go Terratest suites for Terraform modules, including CI-safe patterns, staged tests, and negative-path validation.
- Type
- Subagent
- Repository
- github/awesome-copilot
- GitHub stars
- 39.4k
- License
- MIT
- Repo last updated
- Sep 27, 2026
- Source file
- agents/terratest-module-testing.agent.md
- Model
- gpt-5
What Terratest Module Testing is
Terratest Module Testing is a subagent published in the github/awesome-copilot repository on GitHub, which has about 39.4k stars. The repository describes itself as: “Community-contributed instructions, agents, skills, and configurations to help you make the most of GitHub Copilot.”
A subagent is a specialist assistant that Claude can hand part of a task to. It is a markdown file whose frontmatter sets a name, a description that tells Claude when to delegate, and optionally the tools and model it may use; the body becomes the subagent's own system prompt.
Because a subagent works in its own context, it keeps the main conversation focused: Claude can send a narrow job, such as a review or a specialised analysis, to Terratest Module Testing and get back a compact result.
It is set up to use these tools: codebase, terminalCommand. Limiting tools is a good sign: the subagent can only do what those tools allow.
How to install Terratest Module Testing
Claude Code
- Download terratest-module-testing.agent.md from the repository.
- Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control.
- Claude Code watches these folders, so the subagent is usually available right away. Ask Claude to use it by name, or @-mention it to make sure it runs.
Claude Cowork
- Cowork loads subagents through plugins. If the repository is packaged as a plugin marketplace, add it under Customize → Plugins → Add marketplace and install the plugin that contains this subagent.
- Otherwise, bundle the file into your own plugin's agents/ folder and upload it from Customize → Plugins.
New to extending Cowork? Our plugins guide and Customize guide explain how skills, plugins, and connectors fit together.
Inside the source file
An excerpt from agents/terratest-module-testing.agent.md, shared under the repository's MIT license. Read the full file on GitHub.
You are a senior DevOps engineer focused on Terraform module testing with Terratest.
Your Expertise
- Go Terratest design for Terraform modules and module consumers
- CI-safe Terraform testing patterns for pull request workflows
- Negative-path testing with terraform.InitAndApplyE
- Staged test design using test_structure for setup/validate/teardown flows
- Workflow wrapper architecture that delegates implementation to governance repositories
Your Approach
- Identify test intent first: success-path, negative-path, or staged E2E.
- Prefer deterministic CI behavior and avoid cloud apply unless explicitly requested.
- Generate compile-ready Go tests with explicit imports and clear assertions.
- Keep tests focused on module contracts (outputs, validation messages, behavior), not internals.
- Align workflow edits with repository governance patterns (wrappers vs direct implementation).
Guidelines
- Prefer test files under tests/terraform with _test.go suffix.
- Use t.Parallel() for independent tests.
- Use terraform.WithDefaultRetryableErrors for resilient cloud/provider interactions.
- Use terraform.InitAndApplyE and assert expected error substrings for negative tests.
- Use staged tests only when setup/teardown reuse provides clear value.
- Keep cleanup explicit in apply-based tests.
- Prefer backend-free validate flows for PR CI checks when Terraform Cloud or cloud credentials are not available.
- If a repository uses workflow wrappers, do not add direct implementation steps to local wrappers.
CI Preferences
- Prefer setting Go version from go.mod (or pin explicitly when required by org standards).
- Prefer go test -v ./... -count=1 -timeout 30m for Terraform test runs.
- Prefer JUnit output and always-on summary publishing in CI (if: always()), so failures are easy to triage.
Terratest Best Practices Addendum
- Namespacing: use unique test identifiers for resources that require globally unique names.
- Error handling: prefer *E Terratest variants when asserting expected failures.
- Idempotency: when relevant, include an idempotency check (second apply/plan behavior) for module stability.
- Test stages: for staged tests, support stage skipping during local iteration.
- Debuggability: for noisy parallel logs, prefer parsed/structured Terratest log output in CI artifacts.
Evaluation Checklist
- go test -count=1 -v ./tests/terraform/... passes in the module test directory.
- Tests do not share mutable Terraform working state across parallel execution.
- Negative tests fail for the intended reason and assert stable error substrings.
- Terraform CLI usage matches command behavior (validate vs plan/apply expectations).
Constraints
- Do not introduce direct main branch workflow logic if the repository uses governance wrappers.
- Do not rely on secrets or cloud credentials unless the user explicitly asks for integration tests requiring them.
- Do not silently skip cleanup logic in apply-based tests.
Trigger Examples
- "Create Terratest coverage for infra outputs."
- "Add a negative Terratest for invalid Terraform inputs."
- "Convert this Terraform test workflow to a governance wrapper."
Before you install
- Read the whole file first. Skills, commands, and subagents are instructions Claude will follow, so make sure they match what you want.
- Check which tools, scripts, or MCP servers it uses. Local servers and scripts run with your permissions.
- Try it in a test project or a copy of your files before pointing it at real work.
- Pin the version you tested, and review changes before updating.
- Watch for instructions that fetch web content or run shell commands; those are where prompt injection risks start. See our prompt injection guide.
FAQ
What is Terratest Module Testing?
Terratest Module Testing is a subagent for Claude Code and Claude Cowork from the github/awesome-copilot repository on GitHub. Generate and refactor Go Terratest suites for Terraform modules, including CI-safe patterns, staged tests, and negative-path validation.
How do I install Terratest Module Testing in Claude Code?
Download terratest-module-testing.agent.md from the repository. Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control. Claude Code watches these folders, so the subagent is usually available right away. Ask Claude to use it by name, or @-mention it to make sure it runs.
Can I use Terratest Module Testing in Claude Cowork?
Cowork loads subagents through plugins. If the repository is packaged as a plugin marketplace, add it under Customize → Plugins → Add marketplace and install the plugin that contains this subagent. Otherwise, bundle the file into your own plugin's agents/ folder and upload it from Customize → Plugins.
Is Terratest Module Testing safe to install?
It is a third-party community resource, not reviewed by Anthropic or this site. Read the source file first, check which tools and connectors it uses, and install only from sources you trust.
Similar resources
- Azure SaaS Architect mode instructions Provide expert Azure SaaS Architect guidance focusing on multitenant applications using Azure Well-Architected SaaS principles and Microsoft best practices. Subagent · github/awesome-copilot
- Azure Logic Apps Expert Mode Expert guidance for Azure Logic Apps development focusing on workflow design, integration patterns, and JSON-based Workflow Definition Language. Subagent · github/awesome-copilot
- Bicep Planning Act as implementation planner for your Azure Bicep Infrastructure as Code task. Subagent · github/awesome-copilot
- Bicep Specialist Act as an Azure Bicep Infrastructure as Code coding specialist that creates Bicep templates. Subagent · github/awesome-copilot
- Thinking Beast Mode A transcendent coding agent with quantum cognitive architecture, adversarial intelligence, and unrestricted creative freedom. Subagent · github/awesome-copilot
- Terraform IaC Reviewer Terraform-focused agent that reviews and creates safer IaC changes with emphasis on state safety, least privilege, module patterns, drift detection, and plan/apply discipline Subagent · github/awesome-copilot
- TypeScript MCP Server Expert Expert assistant for developing Model Context Protocol (MCP) servers in TypeScript Subagent · github/awesome-copilot
- Terraform Agent Terraform infrastructure specialist with automated HCP Terraform workflows. Leverages Terraform MCP server for registry integration, workspace management, and run orchestration. Generates compliant code using latest provider/module versions, manages private registries, automates variable sets, and orchestrates infrastructure deployments with proper validation and security practices. Subagent · github/awesome-copilot