
Run Acceptance Tests
Guide for running Terraform provider acceptance tests and diagnosing failures with escalating debug options.
- CCM score
- 75 of 100
- skills.sh installs
- 3.9K
- GitHub stars
- 941
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers running a focused
TestAcctest withTF_ACC=1, an explicit-timeout, and environment variables for the single invocation - Includes steps to discover required credentials via
PreCheckfunctions,os.Getenvsearches, README files, and theConfiguremethod - Enforces a pre-run check that credentials target a test account, since tests create real, possibly costly infrastructure
- Escalates diagnosis through
-count=1,-v,TF_LOG=debug, andTF_ACC_WORKING_DIR_PERSIST=1, plus a method for flipping false-passing tests
Install
$ npx -y skills add hashicorp/agent-skills --skill run-acceptance-tests -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
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
Details
- Repository
- github.com/hashicorp/agent-skills
- Category
- Testing & QA
More from hashicorp/agent-skills
All 16- Azure Verified Modules3.5K
- Provider Test Patterns3.5K
- Provider Docs3.4K
- Aws Ami Builder3.4K
- Push To Registry3.2K
- Azure Image Builder2.9K
- Windows Builder2.9K
- Terraform Style Guide13.8K
- Terraform Test9.5K
- Refactor Module6.9K
- Terraform Stacks5.9K
- Terraform Search Import5.2K
- Provider Resources4.3K
- New Terraform Provider4.1K
- Provider Actions4.1K
Similar to Run Acceptance Tests
More Testing & QA
terraform-testhashicorp/agent-skills9.5K installsGuide for writing Terraform tests: .tftest.hcl files, run blocks, assertions, mocks, and module output checks.
provider-test-patternshashicorp/agent-skills3.5K installsTest structure, check functions, and scenario patterns for Terraform provider acceptance tests built on terraform-plugin-testing and the Plugin Framework.
terraform-skillantonbabenko/terraform-skill8.3K installsDiagnose-first Terraform and OpenTofu guidance covering identity churn, secrets, blast radius, CI drift, and state corruption.
promptfoo-evaluationdaymade/claude-code-skills1.6K installsStructured Promptfoo evaluation guide covering configs, prompts, Python assertions, and llm-rubric grading for prompt and model testing.
wizardmattpocock/skills666.1K installsInteractive bash wizard that walks a human through manual setup, credentials, and cutover steps.
terraform-engineerjeffallan/claude-skills5.9K installsTerraform skill with validation, plan-review, and apply-approval workflow for AWS, Azure, and GCP infrastructure.