# run-acceptance-tests

Runs and investigates Terraform provider acceptance tests with the TestAcc prefix. Use it for missing environment variables, failed runs, or tests that pass when they should not.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 3700 installs · ★ 909
- Author: hashicorp
- License: MPL-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/hashicorp/agent-skills/tree/HEAD/plugins/terraform/skills/run-acceptance-tests/SKILL.md
- Updated: 2026-10-05
- HTML: https://affpapa.org/en/nevibecode/skills/run-acceptance-tests

## What it does

This skill guides Go acceptance-test runs for Terraform providers when the test name starts with `TestAcc`. It uses `TF_ACC=1`, requires an explicit `-timeout`, and starts with normal test output. For a repeat investigation, it can add `-count=1`, then `-v`, `TF_LOG=debug`, and `TF_ACC_WORKING_DIR_PERSIST=1`.

It traces required environment variables through `PreCheck` or `testAccPreCheck`, searches for `os.Getenv` in `*_test.go` files, and checks README, CONTRIBUTING, or `.env.example`. The provider `Configure` method can also show the credential resolution chain. Secrets stay in a single command invocation rather than repository files.

These tests create real resources through the provider's live API and can incur costs. Check that credentials point to a test account before running them. The skill also explains how to flip a passing test by changing a test check, and suggests provider sweepers after an interrupted run.

## Requirements
- Works with: Terraform

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add hashicorp/agent-skills --skill run-acceptance-tests -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/run-acceptance-tests/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/run-acceptance-tests/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add hashicorp/agent-skills --skill run-acceptance-tests -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/run-acceptance-tests/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add hashicorp/agent-skills --skill run-acceptance-tests -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/run-acceptance-tests/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install hashicorp/agent-skills run-acceptance-tests
```

2. **Manually: put the files in place**
- File: `.github/skills/run-acceptance-tests/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add hashicorp/agent-skills --skill run-acceptance-tests -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/hashicorp/agent-skills --path plugins/terraform/skills/run-acceptance-tests
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/run-acceptance-tests/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add hashicorp/agent-skills --skill run-acceptance-tests -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/hashicorp/agent-skills/tree/HEAD/plugins/terraform/skills/run-acceptance-tests/SKILL.md

## When to use it
- run one `TestAcc` test with an explicit timeout
- locate missing test environment variables
- rerun a failed test without Go cache
- turn on Terraform debug logging
- check whether a passing test is a false negative

## Example prompts
- Run `TestAccFeatureHappyPath` as an acceptance test with `TF_ACC=1` and an explicit timeout.
- Find the environment variables required by this failing `TestAcc` test in `PreCheck` and `*_test.go` files.
- Flip `TestAccFeatureHappyPath` to verify that its checks can fail.

## Similar
- [323-frameworks-spring-boot-testing-acceptance-tests](https://affpapa.org/en/nevibecode/skills/323-frameworks-spring-boot-testing-acceptance-tests.md) — skill · 324 installs
- [133-java-testing-acceptance-tests](https://affpapa.org/en/nevibecode/skills/133-java-testing-acceptance-tests.md) — skill · 329 installs
- [cloud-run-alert-configuration](https://affpapa.org/en/nevibecode/skills/cloud-run-alert-configuration.md) — skill · 2300 installs
- [synthetic-monitoring-checks](https://affpapa.org/en/nevibecode/skills/synthetic-monitoring-checks.md) — skill · 2300 installs
- [verify-and-stop](https://affpapa.org/en/nevibecode/skills/verify-and-stop.md) — skill · 104900 installs
- [bigquery-basics](https://affpapa.org/en/nevibecode/skills/bigquery-basics.md) — skill · 17678 installs

From the same set: [hashicorp/agent-skills](https://affpapa.org/en/nevibecode/by/hashicorp/agent-skills.md) — 16 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
