hashicorp avatar

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-code

Installs 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:

  1. Run go test -run=TestAccFeatureHappyPath -timeout 60m with the following environment variables:

    • TF_ACC=1

    Default to non-verbose test output. Always pass an explicit -timeout: go test kills any test run after 10 minutes by default, and acceptance tests routinely exceed that.

  2. The acceptance tests may require additional environment variables for specific providers. To discover which ones:

    • Read the test's PreCheck / testAccPreCheck function and search the test files: grep -rn "os.Getenv" --include="*_test.go".
    • Check the repository's README, CONTRIBUTING, or .env.example for documented test setup.
    • The provider's Configure method shows how credentials are resolved; use the provider-configuration skill (if available) to understand a credential provider chain.

Sponsors

Details

Repository
github.com/hashicorp/agent-skills
Categories
Testing & QA, DevOps & CI/CD, Documentation, AI & Agent Building, Cloud & Infrastructure

More from hashicorp/agent-skills

All 16
1yaklang avatarhash-attack-techniquesyaklang/hack-skillsHash attack playbook. Use when exploiting length extension, MD5/SHA1 collisions, HMAC timing leaks, birthday attacks, or hash-based proof of work in CTF and aut3.8Kskills.sh installs
2yaklang avatarprototype-pollutionyaklang/hack-skillsPrototype pollution testing for JavaScript stacks. Use when user input is merged into objects (query parsers, JSON bodies, deep assign), when configuring librar3.8Kskills.sh installs
3yaklang avatardns-rebinding-attacksyaklang/hack-skillsDNS rebinding attack playbook. Use when testing applications that trust DNS resolution for origin checks, interact with internal services from browser context, 3.8Kskills.sh installs
4yaklang avataremail-header-injectionyaklang/hack-skillsEmail header injection and spoofing playbook. Use when testing contact forms, email APIs, password reset flows, or any feature that constructs SMTP messages wit3.8Kskills.sh installs
5dpearson2699 avatartipkitdpearson2699/swift-ios-skillsImplement and review Apple TipKit feature-discovery UI for iOS 17+ apps. Use when adding or auditing in-app tips, contextual help, coach marks, Tip, TipView, po3.8Kskills.sh installs
6langgenius avatarcomponent-refactoringlanggenius/difyRefactor high-complexity React components in Dify frontend. Use when `pnpm analyze-component --json` shows complexity > 50 or lineCount > 300, when the user ask3.7Kskills.sh installs