
Run Acceptance Tests
If you're working on Terraform providers and need to run Go acceptance tests (the ones prefixed with TestAcc), this walks Claude through the proper setup with TF_ACC=1 and structured debugging steps when things fail. It covers the basics like running focused tests, then escalates through increasingly verbose options: cache busting with count=1, verbose output, debug logging with TF_LOG=debug, and persisting workspaces. There's also a clever "flip test" procedure to catch false positives by deliberately breaking a check to verify the test actually validates what you think it does. It's MPL licensed and clearly built for the IBM provider ecosystem, but the patterns apply to any Terraform provider work.
- skills.sh installs
- 3.8K
- GitHub stars
- 924
- last updated
- Aug 21, 2026
Install
$ npx -y skills add hashicorp/agent-skills --skill run-acceptance-tests --agent claude-codeInstalls into .claude/skills of the current project.
Files
An acceptance test is a Go test function with the prefix TestAcc.
Before running: acceptance tests create real infrastructure against the provider's live API, which may incur cost. Confirm the configured credentials point at a test account before proceeding.
To run a focused acceptance test named TestAccFeatureHappyPath:
-
Run
go test -run=TestAccFeatureHappyPath -timeout 60mwith the following environment variables:TF_ACC=1
Default to non-verbose test output. Always pass an explicit
-timeout:go testkills any test run after 10 minutes by default, and acceptance tests routinely exceed that. -
The acceptance tests may require additional environment variables for specific providers. To discover which ones:
- Read the test's
PreCheck/testAccPreCheckfunction and search the test files:grep -rn "os.Getenv" --include="*_test.go". - Check the repository's README, CONTRIBUTING, or
.env.examplefor documented test setup. - The provider's
Configuremethod shows how credentials are resolved; use theprovider-configurationskill (if available) to understand a credential provider chain.
- Read the test's
Sponsors
Details
More from hashicorp/agent-skills
All 16- Azure Verified Modules3.4K
- Provider Test Patterns3.4K
- 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