terraform-provider-tests

Analyze Terraform provider test coverage gaps and run acceptance tests in parallel.

1|1|Updated Dec 30, 2025
One-click install
npx skills add https://github.com/anyscale/terraform-provider-anyscale --skill terraform-provider-tests-anyscale
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: terraform-provider-tests
Source: https://github.com/anyscale/terraform-provider-anyscale/tree/main/.claude/skills/terraform-provider-tests
Command: npx skills add https://github.com/anyscale/terraform-provider-anyscale --skill terraform-provider-tests-anyscale

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Terraform provider test suites often accumulate legacy assertion patterns, missing drift/import/idempotency tests, and slow sequential execution. This Skill automates coverage gap analysis of Go acceptance tests and runs large test suites concurrently, cutting execution time by 4x-8x compared to sequential go test. ## Core Features & Use Cases - Coverage Gap Analysis: Scans Go test files to detect legacy Check blocks, missing drift detection, import, and idempotency tests, plus ID consistency tracking issues, producing a graded markdown report with prioritized findings. - Parallel Test Execution: Runs acceptance tests concurrently per file with configurable concurrency, filtering by pattern, file, or resource/data-source type. - Fast Compile Verification: Runs go test -c to catch syntax and import errors in seconds after test edits. - Use Case: After modernizing a provider's test files to use statecheck and plancheck, run the gap analyzer to measure progress, verify compilation, then execute the full suite in parallel to confirm all tests pass. ## Quick Start Run the coverage gap analyzer on my provider's test directory and summarize the overall grade, top findings, and recommended next action.

Frequently Asked Questions about terraform-provider-tests

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

FAQPage Schema
How do I find missing drift and import tests in a Terraform provider?▼

Run the analyze_gap.py script against your test directory to generate a markdown report. It detects missing drift detection, import, and idempotency tests, legacy Check blocks, and ID tracking gaps, with an overall A/B/C grade and prioritized recommendations.

How to run Terraform acceptance tests in parallel?▼

Use the run_tests_parallel.sh script, which executes Go acceptance tests concurrently per file with configurable concurrency, typically achieving 4x-8x speedup over sequential go test. It supports filtering by pattern, file, or resource versus data source tests.

What environment variables are required for Terraform acceptance tests?▼

Set TF_ACC=1 to enable acceptance tests, plus valid provider credentials such as ANYSCALE_CLI_TOKEN for this repository. The parallel runner warns if TF_ACC is unset and falls back to xargs when GNU parallel is unavailable.

Why do I get undefined: statecheck or plancheck errors?▼

These errors mean the test file is missing the required imports for the terraform-plugin-testing statecheck and plancheck packages. Add the standard import block, then run verify_compilation.sh to confirm the test files compile in a few seconds.

Can I customize the gap analyzer's false positive rules?▼

Yes, edit the .gap-analyzer.yaml file at the skill root to adjust domain name allowlists, severity overrides, and rule thresholds without modifying the Python script. PyYAML must be installed for custom config files to load.