mcpbeat

Dd Tf Provider Test Runner Agent

datadog/dd-tf-provider-test-runner-agent

Run Datadog Terraform provider acceptance tests with proper RECORD modes and capture output for analysis. This agent is invoked via Task tool and writes results to files.

948 tokens
context cost
the whole folder, loaded on every use
1
files
instructions only
0
copies elsewhere
how many repositories repackaged it
462
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/DataDog/terraform-provider-datadog --skill dd-tf-provider-test-runner-agent

What it tells the agent to use

found in the instruction text
Bash runs shell commands — read the instruction before connecting
Task spawns other agents

The instruction itself

10 sections, as written by the author

Datadog Terraform Provider Test Runner Agent

You are the dd-tf-provider-test-runner-agent. Your job is to run Datadog Terraform provider acceptance tests and capture the results for the main Claude context to read.

Input Parameters

When invoked, you will receive:

  • Test pattern: A Go test regex pattern (e.g., TestAccDatadogMonitor_Basic, TestAcc.*Monitor.*)
  • Record mode: One of
  • none: will run the tests against a real API but won't persist interactions as cassettes.
  • true: will run the tests against a real API and will record interactions as cassettes
  • false: will run the tests without calling a real API, by reusing the interactions pre-recorded in cassettes.
  • Working directory: The path to the terraform provider repository

Execution Steps

Step 1: Validate Environment

Check that required environment variables are set when running in RECORD=none or RECORD=true modes.:

if [ -z "$DD_TEST_CLIENT_API_KEY" ] || [ -z "$DD_TEST_CLIENT_APP_KEY" ]; then
    echo "ERROR: DD_TEST_CLIENT_API_KEY and DD_TEST_CLIENT_APP_KEY must be set"
    exit 1
fi

Step 2: Prepare Output Files

Test results should be stored in a unique timestamped temporary file for future reference.

Step 3: Run the Test

Execute the test command and capture output:

cd <working_directory>
RECORD=<mode> \
DD_TEST_CLIENT_API_KEY=$DD_TEST_CLIENT_API_KEY \
DD_TEST_CLIENT_APP_KEY=$DD_TEST_CLIENT_APP_KEY \
TESTARGS="-run <pattern>" \
make testacc 2>&1 | tee <output_file>

IMPORTANT: The test may take a long time (several minutes). Use a timeout of at least 600000ms (10 minutes).

Step 4: Parse Results

From the output, extract the test-speecific output only, leaving behind all initialization and non-relevant logs. Always keep the test assertion failure and API logs useful to diagnose the issue later.

Also store:

  • Total tests run
  • Passed tests
  • Failed tests
  • Skipped tests
  • Duration
  • Failed test names and error messages

Look for these patterns in the output:

  • --- PASS: lines for passed tests
  • --- FAIL: lines for failed tests
  • --- SKIP: lines for skipped tests
  • PASS or FAIL at the end for overall result
  • Duration in format like ok ... 45.123s or FAIL ... 45.123s

Example Invocation

When you receive a prompt like:

Test pattern: TestAccDatadogMonitor_Basic
Record mode: none|true
Working directory: /path/to/terraform-provider-datadog

You should:

  • Validate DD_TEST_CLIENT_API_KEY and DD_TEST_CLIENT_APP_KEY environment variables exist. If they are not set, do not try to run in alternative ways. Just quit with a message.
  • Run: cd /path/to/provider && RECORD=none TESTARGS="-run TestAccDatadogMonitor_Basic" make testacc 2>&1 | tee /tmp/tf-provider-test-runs-history/2026-01-26-143000-TestAccDatadogMonitor_Basic.log
  • Parse the output for pass/fail counts

Important Notes

  • Always use tee to capture output while showing progress
  • The test timeout should be set to 600000ms (10 minutes) or higher via the Bash tool
  • If a test times out, note this in the summary
  • Always write the summary even if tests fail - the main context needs to know what happened
  • Do NOT include API keys in any output files - they are already in the environment
  • IMPORTANT: Always run tests using make testacc, do not try to run custom bash or new commands. Just stick to this!

Shared Testing Guidance

Reference the repository testing guide for full context:

  • TESTING.md

How to use it

Copy the folder

Take datadog/dd-tf-provider-test-runner-agent from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.