terraform-run-acceptance-tests

Runs and diagnoses Terraform provider acceptance tests using Go test with TF_ACC.

Updated Jun 13, 2026
One-click install
npx skills add https://github.com/jenreh/project-kit-template --skill terraform-run-acceptance-tests-jenreh
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: terraform-run-acceptance-tests
Source: https://github.com/jenreh/project-kit-template/tree/main/.agents/agent-skills/skills/terraform-run-acceptance-tests
Command: npx skills add https://github.com/jenreh/project-kit-template --skill terraform-run-acceptance-tests-jenreh

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Running Terraform provider acceptance tests requires specific environment variables, Go test flags, and diagnostic steps that are easy to get wrong, leading to cached results, false negatives, or hard-to-debug failures. ## Core Features & Use Cases - Focused Test Execution: Run a single acceptance test (functions prefixed with TestAcc) with go test -run and the required TF_ACC=1 environment variable. - Progressive Diagnosis: Escalate through cumulative debugging options: -count=1 to bypass caching, -v for verbose output, TF_LOG=debug for debug logging, and TF_ACC_WORKING_DIR_PERSIST=1 to preserve the test workspace. - False Negative Detection: "Flip" a passing test by intentionally breaking a TestCheckFunc to confirm the test actually validates the expected behavior. - Use Case: A provider developer's TestAccInstanceBasic test passes suspiciously fast; use this Skill to re-run it uncached, enable debug logging, and flip the test to verify it genuinely checks the resource. ## Quick Start Run the acceptance test TestAccFeatureHappyPath and help me diagnose why it is failing.

Frequently Asked Questions about terraform-run-acceptance-tests

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

FAQPage Schema
How do I run a single Terraform acceptance test?

Run a single acceptance test with `go test -run=TestAccFeatureHappyPath` and set the environment variable `TF_ACC=1`. Acceptance tests are Go test functions with the `TestAcc` prefix, and non-verbose output is the default.

Why does my Terraform acceptance test use cached results?

Go test caches passing results, so re-running may not actually execute the test. Use the `-count=1` flag to force `go test` to bypass the cache and run the test fresh.

How do I debug a failing Terraform acceptance test?

Debug cumulatively: first re-run with `-count=1`, then add `-v` for verbose output, then set `TF_LOG=debug` for debug-level logging, and finally set `TF_ACC_WORKING_DIR_PERSIST=1` to persist the test's Terraform workspace for inspection.

What environment variables are needed for Terraform acceptance tests?

`TF_ACC=1` is required to enable acceptance tests. Provider-specific tests may need additional environment variables for credentials or endpoints; if test output reports missing variables, configure them securely before re-running.

How do I verify a passing acceptance test is not a false negative?

Flip the test: edit one TestCheckFunc value in a TestStep so the test should fail, then re-run it. If it fails, undo the edit to confirm the test genuinely validates behavior; if it still passes, the test is not checking correctly.