run-acceptance-tests

Run Terraform provider acceptance tests with TF_ACC and go test.

Updated Jul 30, 2024
One-click install
npx skills add https://github.com/twidxuga/dotfiles --skill run-acceptance-tests-twidxuga
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: run-acceptance-tests
Source: https://github.com/twidxuga/dotfiles/tree/main/opencode/dot-config/opencode/skills/terraform-run-acceptance-tests
Command: npx skills add https://github.com/twidxuga/dotfiles --skill run-acceptance-tests-twidxuga

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps teams run Terraform provider acceptance tests in a deterministic, reproducible manner by guiding environment setup, test execution, and diagnosis.

Core Features & Use Cases

  • Focused TestAcc execution: run a specific acceptance test function (TestAcc...) to verify provider behavior.
  • Environment and output controls: enables TF_ACC, TF_LOG, and optional verbosity (-v), and workspace management during testing.
  • Workflow guidance: includes steps to diagnose failing tests, flip outcomes, and persist workspaces when needed.

Quick Start

Run the acceptance test by setting TF_ACC=1 and invoking go test with the targeted TestAcc function to execute the desired acceptance scenario.

Frequently Asked Questions about run-acceptance-tests

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

FAQPage Schema
How do I run Terraform provider acceptance tests deterministically?

Run Terraform provider acceptance tests deterministically by setting the TF_ACC environment variable to 1 and invoking go test with your targeted TestAcc function to execute the desired scenario.

What environment variables are required for Terraform acceptance testing?

Terraform acceptance testing requires the TF_ACC environment variable to be enabled. Optional flags include TF_LOG for logging controls and -v or -count for test verbosity and iterations.

How do I execute a focused TestAcc scenario for a Terraform provider?

Execute a focused TestAcc scenario by applying environment setup and invoking go test with the specific TestAcc function name to verify provider behavior reliably.

Why do my Terraform provider acceptance tests fail intermittently?

Intermittent acceptance test failures can be diagnosed using workflow guidance that includes checking environment variables, managing workspaces during testing, and applying logging controls for observable results.

Can I control verbosity and logging when running Terraform acceptance tests?

Control verbosity and logging during Terraform acceptance tests by applying the -v flag for verbose output and setting TF_LOG environment variables to capture deterministic, observable test results.

Do I need to set TF_ACC to run Terraform provider tests?

Yes, setting TF_ACC=1 is required to enable Terraform provider acceptance tests. This environment variable ensures tests execute against real infrastructure resources for deterministic verification.