Skip to content

Add prepare-local-build.sh helper for local tracer testing#6499

Open
bm1549 wants to merge 8 commits intomainfrom
brian.marks/prepare-local-build
Open

Add prepare-local-build.sh helper for local tracer testing#6499
bm1549 wants to merge 8 commits intomainfrom
brian.marks/prepare-local-build

Conversation

@bm1549
Copy link
Contributor

@bm1549 bm1549 commented Mar 13, 2026

Motivation

Running system-tests against locally checked-out tracer repos requires knowing the per-language binaries/ conventions (JARs for Java, volume-mount pointer files for Node.js/Python, shallow clones for Go/Ruby/Rust/C++, tarballs for .NET/PHP). This script automates that setup.

Changes

Adds utils/scripts/prepare-local-build.sh — a helper that handles the copy/clone/pointer-file step for each of the 9 supported languages.

Features:

  • prepare-local-build.sh <lang> [path] — prepares binaries/ for the given language
  • Path defaults to ~/dd/dd-trace-<lang> when omitted
  • prepare-local-build.sh --clean [lang] — removes binaries for one or all languages
  • prepare-local-build.sh --status — shows what's currently configured in binaries/
  • prepare-local-build.sh --list — lists supported languages and methods
  • prepare-local-build.sh --rebuild — forces a fresh build even if artifacts exist
  • --method flag for languages with multiple options (e.g., Node.js local vs clone, Python wheel vs pip)

Auto-build support (builds from source when artifacts are missing):

  • Java: Gradle (./gradlew :dd-java-agent:shadowJar :dd-trace-api:jar)
  • .NET: Nuke on Linux, Docker-based build on macOS
  • Python: scripts/ddtest wheel build (default method)
  • PHP: tooling/bin/build-debug-artifact

Follows the same shell style as utils/scripts/watch.sh (set -euo pipefail, error/die helpers).

Testing

Ran this locally to confirm that every language builds locally and runs against the parametric test: test_distributed_headers_extract_datadog_D001

Workflow

  1. ⚠️ Create your PR as draft ⚠️
  2. Work on you PR until the CI passes
  3. Mark it as ready for review
    • Test logic is modified? -> Get a review from RFC owner.
    • Framework is modified, or non obvious usage of it -> get a review from R&P team

🚀 Once your PR is reviewed and the CI green, you can merge it!

🛟 #apm-shared-testing 🛟

Reviewer checklist

  • Anything but tests/ or manifests/ is modified ? I have the approval from R&P team
  • A docker base image is modified? N/A
  • A scenario is added, removed or renamed? N/A

🤖 Generated with Claude Code

@github-actions
Copy link
Contributor

github-actions bot commented Mar 13, 2026

CODEOWNERS have been resolved as:

.claude/skills/system-tests-local.md                                    @DataDog/system-tests-core
utils/scripts/prepare-local-build.sh                                    @DataDog/system-tests-core

@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Mar 13, 2026

⚠️ Tests

Fix all issues with BitsAI or with Cursor

⚠️ Warnings

🧪 45 Tests failed

tests.debugger.test_debugger_inproduct_enablement.Test_Debugger_InProduct_Enablement_Exception_Replay.test_inproduct_enablement_exception_replay[spring-boot-openliberty] from system_tests_suite   View in Datadog   (Fix with Cursor)
AssertionError: Expected snapshots to be emitting after enabling exception replay
assert False
 +  where False = <tests.debugger.test_debugger_inproduct_enablement.Test_Debugger_InProduct_Enablement_Exception_Replay object at 0x7fc420f8b350>.er_explicit_enabled

self = <tests.debugger.test_debugger_inproduct_enablement.Test_Debugger_InProduct_Enablement_Exception_Replay object at 0x7fc420f8b350>

    def test_inproduct_enablement_exception_replay(self):
        self.assert_rc_state_not_error()
        self.assert_all_weblog_responses_ok(expected_code=500)
    
...
tests.debugger.test_debugger_pii.Test_Debugger_PII_Redaction.test_pii_redaction_method_full[poc] from system_tests_suite   View in Datadog   (Fix with Cursor)
AssertionError: The following probes are not emitting: {'log170aa-acda-4453-9111-1478a6method': 'INSTALLED'}
assert not {'log170aa-acda-4453-9111-1478a6method': 'INSTALLED'}

self = <tests.debugger.test_debugger_pii.Test_Debugger_PII_Redaction object at 0x7f323ab4f0e0>

    @slow
    def test_pii_redaction_method_full(self):
>       self._assert()

tests/debugger/test_debugger_pii.py:247: 
...
tests.debugger.test_debugger_probe_budgets.Test_Debugger_Probe_Budgets.test_log_line_budgets[poc] from system_tests_suite   View in Datadog   (Fix with Cursor)
ValueError: Snapshot log2622a-87f5-4583-8dc6-120c70ec4198 was not received.

self = <tests.debugger.test_debugger_probe_budgets.Test_Debugger_Probe_Budgets object at 0x7f49e41d7560>

    def test_log_line_budgets(self):
        self._assert()
>       self._validate_snapshots()

tests/debugger/test_debugger_probe_budgets.py:75: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
...
View all

ℹ️ Info

No other issues found (see more)

❄️ No new flaky tests detected

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 8b25788 | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback!

@bm1549 bm1549 force-pushed the brian.marks/prepare-local-build branch from f22786b to a52cb1e Compare March 16, 2026 21:13
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bm1549 bm1549 force-pushed the brian.marks/prepare-local-build branch from df0565d to e21b86e Compare March 23, 2026 19:02
bm1549 and others added 2 commits March 23, 2026 18:12
The volume-mount method fails because native C extensions (.so files) in the
local checkout are built for a different Python version than the container's.
The 'wheel' method (already the default) packages everything correctly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When auto-building Java JARs, resolve JAVA_HOME dynamically if the
current value points to a missing directory. Supports macOS
(/usr/libexec/java_home) and Linux (readlink on java binary). Fails
with a clear message if no JDK is found at all.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bm1549 bm1549 marked this pull request as ready for review March 23, 2026 22:29
@bm1549 bm1549 requested a review from a team as a code owner March 23, 2026 22:29
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7296675113

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

bm1549 and others added 5 commits March 23, 2026 18:34
Python s3 method takes a commit hash (not a directory) and pip doesn't
need a path at all. Skip directory validation and default-path resolution
for these methods so they work as documented.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds a .claude/skills/system-tests-local.md that teaches Claude Code
how to use prepare-local-build.sh to set up binaries/ and run parametric
tests against locally checked-out tracer repos.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant