terraform-provider-tests

Analyze Terraform provider tests and migrate legacy checks to terraform-plugin-testing patterns.

1|1|Updated Nov 19, 2025
One-click install
npx skills add https://github.com/hashi-demo-lab/terraform-provider-bcm --skill terraform-provider-tests
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: terraform-provider-tests
Source: https://github.com/hashi-demo-lab/terraform-provider-bcm/tree/main/.claude/skills/terraform-provider-tests
Command: npx skills add https://github.com/hashi-demo-lab/terraform-provider-bcm --skill terraform-provider-tests

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill analyzes and modernizes Terraform provider tests by applying terraform-plugin-testing v1.13.3+ patterns to identify coverage gaps, migrate legacy checks to state-based validations, and guide improvements for drift, import, and idempotency tests. It also collects actionable insights and templates to streamline test modernization work.

Core Features & Use Cases

  • Gap analysis and reporting: automatically detect legacy patterns and missing tests, generating prioritized recommendations.
  • Modern pattern guidance: convert legacy Check blocks to ConfigStateChecks, add idempotency and drift tests, and implement ImportState flows.
  • ID consistency and test quality: track Resource IDs across steps, verify import and drift behavior, and validate test coverage metrics.
  • Example testing integration: coordinate with example testing workflows to ensure provider examples stay accurate and reliable.

Quick Start

Run automated gap analysis on your Terraform provider tests with the included analyze_gap.py script to generate a timestamped report.

Frequently Asked Questions about terraform-provider-tests

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

FAQPage Schema
How do I detect coverage gaps in my Terraform provider tests?

Migrate legacy Terraform provider test checks by converting outdated Check blocks to terraform-plugin-testing ConfigStateChecks. This modern pattern enforces state-based validations, replacing fragile assertions with robust state verification to improve overall test reliability and coverage.

How do I add idempotency and drift tests to a Terraform provider?

Add idempotency and drift tests to a Terraform provider by applying terraform-plugin-testing patterns that track Resource IDs across steps. This verifies import behavior, validates state consistency, and ensures applying the same configuration twice yields no unexpected infrastructure changes.

Can I use this to modernize tests for any Terraform provider codebase?

Yes, the automated analysis and modernization patterns are adaptable to various Terraform provider codebases. It targets internal provider tests and example testing workflows, applying consistent state checks and ID consistency tracking regardless of the specific provider implementation.

What is the best way to automate Terraform import state test coverage?

The best way to automate Terraform import state test coverage is implementing ImportState flows using terraform-plugin-testing patterns. This verifies that imported resources match their configured state, tracking ID consistency to ensure reliable import behavior across your provider.