
Provider Test Patterns
This gives Claude the patterns for writing Terraform provider acceptance tests with terraform-plugin-testing and the Plugin Framework. It covers the test lifecycle (plan, apply, refresh, final plan check), modern ConfigStateChecks with statecheck implementations versus legacy TestCheckFunc patterns, import testing with ImportStateKind, sweepers, and ephemeral resource testing. The source includes actual code examples for test structure, config helpers with numbered format verbs, and scenario patterns like basic/update combinations and disappears tests. Use it when you're writing or reviewing provider tests and need to know how to structure assertions, verify import behavior, or understand why CompareValue exists for cross-step checks. It assumes you know Terraform providers but need the testing framework conventions.
- skills.sh installs
- 3.4K
- GitHub stars
- 924
- last updated
- Aug 21, 2026
Install
$ npx -y skills add hashicorp/agent-skills --skill provider-test-patterns --agent claude-codeInstalls into .claude/skills of the current project.
Files
Provider Acceptance Test Patterns
Patterns for writing acceptance tests using terraform-plugin-testing with the Plugin Framework.
Source: HashiCorp Testing Patterns
References (load when needed):
references/checks.md— statecheck, plancheck, knownvalue types, tfjsonpath, comparersreferences/sweepers.md— sweeper setup, TestMain, dependenciesreferences/ephemeral.md— ephemeral resource testing, echoprovider, multi-step patterns
Test Lifecycle
The framework runs each TestStep through: plan → apply → refresh → final
plan. If the final plan shows a diff, the test fails (unless
ExpectNonEmptyPlan is set). After all steps, destroy runs followed by
CheckDestroy. This means every test automatically verifies that
configurations apply cleanly and produce no drift — no assertions needed for
that.
Test Function Structure
Sponsors
Details
- Repository
- github.com/hashicorp/agent-skills
- Categories
- Testing & QA, DevOps & CI/CD, Documentation, AI & Agent Building, Debugging, Productivity & Planning, Cloud & Infrastructure
- First seen
- May 16, 2026
More from hashicorp/agent-skills
All 16- Provider Docs3.3K
- Aws Ami Builder3.3K
- Push To Registry3.1K
- Azure Image Builder2.8K
- Windows Builder2.8K
- Terraform Style Guide13.2K
- Terraform Test9.2K
- Refactor Module6.6K
- Terraform Stacks5.8K
- Terraform Search Import5.1K
- Provider Resources4.2K
- New Terraform Provider4K
- Provider Actions4K
- Run Acceptance Tests3.8K
- Azure Verified Modules3.4K