Index of every page on this site: llms.txt
All skills
datadog-labs avatar

/dd-instrument-test-optimization

@618fae3 official
Run it yourself

Sets up Datadog Test Optimization (CI test visibility, per-test traces, flaky test detection) in a repo's CI pipeline for Node.js, Python, Java/JVM, Go, Ruby, .NET, Swift, or JUnit XML. Configures CI auto-instrumentation or manual test tracers, forwards container variables, and checks that test events arrive. Use when asked to add, set up, enable or verify Test Optimization or CI test visibility. Not for triaging flaky tests or unblocking a failing PR; use triage-flaky-test or unblock-pr.

Use this Skill: https://skilld.dev/gh/datadog-labs/agent-skills/dd-instrument-test-optimization

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesjunit-xml.md

≈486 tokens on demand. Your agent reads this file only when SKILL.md points to it.

JUnit XML Report Upload

Open this in step 3 when the project uses an unsupported language or test runner (and the user chose JUnit XML reporting over migrating to a supported runner), or when the user explicitly asked for JUnit XML upload.

How it works

  1. The test runner must emit a valid JUnit XML file (<testsuite> / <testcase> elements with test names, durations, and <failure> / <error> child nodes on failed tests).
  2. Install @datadog/datadog-ci in the CI job (npm install -g @datadog/datadog-ci, yarn global add @datadog/datadog-ci, or download the standalone datadog-ci binary from https://github.com/DataDog/datadog-ci/releases/latest/ when Node.js is not present). Do not use a third-party or deprecated GitHub Action for JUnit uploads; invoke datadog-ci junit upload directly.
  3. Run datadog-ci junit upload even when the test step fails, while preserving the test step's exit code so a failing test suite still fails the CI job:
    • GitHub Actions: add if: ${{ !cancelled() }} on the upload step.
    • GitLab CI / Travis CI: run the upload in after_script:.
    • Bitbucket Pipelines: run the upload in after-script: (with a hyphen).
    • CircleCI: add when: always on the upload step.
    • Other providers: capture exit_code=$? under set +e, upload, and exit $exit_code.

Example (GitHub Actions)

      - name: Run tests
        run: npm test
      - name: Upload test results to Datadog
        if: ${{ !cancelled() }}
        run: npx --yes @datadog/datadog-ci junit upload --service <service_name> --env ci ./junit.xml
        env:
          DD_SITE: <SITE>
          DD_API_KEY: ${{ secrets.DD_API_KEY }}

Keep each XML report under 250 MiB. Note in the final summary that JUnit XML upload provides test results and failure tracking in Datadog, but does not provide runtime span traces or automatic Test Impact Analysis test skipping.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts7d3 checks · Risk SAFE
  • Gen Agent Trust Hub8d

    This skill automates the configuration of Datadog Test Optimization in various CI/CD pipelines. It downloads official Datadog tracers, scripts, and CLI tools from verified vendor repositories on GitHub and Datadog's official domains. The skill follows security best practices by providing SHA256 checksum validation for remote scripts and instructing users to manage credentials via CI provider secret stores rather than hardcoding them.

  • Socket8d

    No alerts

  • Snyk7d

    Risk: LOW · No issues

Signed by skilld at 618fae3. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 3 days ago.

Activeupdated last week
Other metadata
metadata
{
  "version": "0.1.0",
  "author": "datadog-labs",
  "repository": "https://github.com/datadog-labs/agent-skills",
  "tags": "datadog,test-optimization,ci-visibility,ci,testing,flaky-tests,instrumentation",
  "alwaysApply": "false"
}

README badge

README badge for datadog-labs/agent-skills/dd-instrument-test-optimization