docker/skills-cache/provider-test-speed/SKILL.md
--- name: "provider-test-speed" description: "Analyze and optimize Terraform provider acceptance test execution for maximum speed with 100% pass rate. Use when the user wants to run tests faster, analyze test timing, find slow tests, parallelize test execution, or optimize their test suite's throughput. Also use when the user mentions "test speed", "slow tests", "parallel tests", "test performance", "speed up tests", or asks why tests take so long." source: image --- # Provider Test Speed Produ
npx skillsauth add agentdevsl/agentpane docker/skills-cache/provider-test-speedInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Produce a parallel execution script that runs Terraform provider acceptance tests at maximum speed while maintaining a 100% pass rate.
The grouping strategy is resource-type-aware, not pure time-balancing. A naive approach (LPT/bin-packing by duration) mixes all test types across groups for perfect time balance — but in practice this causes backend saturation because every group hammers the same async job queue simultaneously. Resource-type grouping keeps related tests together so each group hits a different API surface, avoiding contention:
After grouping by resource type, balance group sizes so no single group dominates wall time. Merge small independent resource groups together.
Find all acceptance tests (functions prefixed TestAcc):
# Find the test package
find . -name '*_test.go' -path '*/internal/*' | head -5
# List all acceptance tests
grep -rn 'func TestAcc.*\(t \*testing.T\)' <test-package>/ --include='*_test.go'
Build a test inventory: test name, file, resource type (inferred from file name or test prefix).
Parse --- PASS / --- FAIL lines from prior test output to extract
per-test durations. Calculate total wall time, sum of durations, and
parallelism ratio (sum / wall_time; 1.0 = sequential).
Target 4-5 consolidated groups. This range is the sweet spot:
Client.Timeout exceeded while awaiting headers.Consolidation strategy:
Produce a self-contained bash script with these requirements:
Pre-compiled test binary (critical):
Compile the test binary ONCE with go test -c -o <binary>, then run that
binary directly for each group. Each group invokes the binary with
-test.* flags (NOT go test with standard flags). This avoids N
parallel compilations and I/O contention:
# Step 1: Compile once
TEST_BINARY="${LOG_DIR}/provider.test"
go test -c -o "$TEST_BINARY" ./internal/provider/
# Step 2: Run the BINARY (not go test) for each group
TF_ACC=1 "$TEST_BINARY" \
-test.count=1 \
-test.timeout 30m \
-test.run "^TestAccResource_|^TestAccResourceAction_" \
-test.v \
> "$LOG_DIR/group_1.log" 2>&1 &
The binary uses -test.run, -test.count, -test.timeout, -test.v
(with test. prefix). Standard go test flags like -run, -count,
-timeout do NOT work on the compiled binary.
Exponential backoff retry for transient failures: Under parallel load, connection timeouts and server contention cause transient failures. Include a retry wrapper that:
Additional script requirements:
TF_ACC=1 on every test processTiming parser note: grep interprets patterns starting with --- as
flags. Always use grep -oE -e 'pattern' (with explicit -e) when the
pattern starts with dashes.
Save the script to testing/run-parallel.sh and make it executable.
Execute the parallel script and verify:
If any group fails, check for connection timeouts first. Timeouts usually mean too many parallel groups. Reduce group count by merging the smallest groups together and retry.
If failures persist after reducing groups, re-run the failing group alone to confirm whether the failure is a parallelism conflict or a pre-existing issue.
Report results as:
## Test Execution Results
| Metric | Sequential | Parallel | Speedup |
|---------------------|------------|----------|---------|
| Wall time | Xs | Ys | N.Nx |
| Tests passed | N/N | N/N | - |
| Groups | 1 | G | - |
go test to run the groups — always use the compiled binary
with -test.* flags.development
AWS security assessment domains, risk rating framework, CIS/NIST reference baselines, and evidence-based finding format. Use when reviewing AWS security posture, assessing risk, or applying CIS/NIST baselines to Terraform configurations.
testing
--- name: "tf-runtask" description: "Retrieve and display Terraform Cloud/Enterprise run task results for a given run. Use this skill whenever the user asks about run task results, run task checks, task stage statuses, or wants to inspect what run tasks reported for a Terraform Cloud/Enterprise run. Triggers on phrases like "check the run tasks", "what did the run tasks say", "show run task results", "get task results for run-xxx", or any reference to run task outcomes on a specific run." source
devops
Research strategies for AWS documentation, provider docs, and public registry patterns. Use when researching AWS services, investigating provider resources, or studying public registry modules for design patterns.
development
Validation results summary template for Phase 4 output. Provides the format for reporting terraform test, validate, fmt, tflint, pre-commit, trivy, and security checklist results.