← Back to Pull requests

rocr-debug-agent: Build all tests from the top-level project #15995

Open
unknown opened this pull request with 423 lines diff across 5 files
View on GitHub
unknown unknown commented on Nov 17, 2026 12:34 UTC
Author

Motivation

The unit tests link the rocm-debug-agent-core object library, which only the top-level CMakeLists.txt defines, but they were added from test/, which TheRock configures as a separate project (rocr-debug-agent-tests). Configuring test/ on its own with ENABLE_UNIT_TESTS=ON fails with a FATAL_ERROR, so TheRock cannot build the unit test binary, and a CPU-only test job has nothing to run (ROCm/TheRock#9357).

Together with ROCm/TheRock#10041, which builds the tests from the top-level project, this makes the top-level project the only way to build the tests.

Merge order

ROCm/TheRock#10041 must merge first, and this PR second. This PR removes the standalone test/ configure that TheRock uses today, so merging it first would break TheRock's build. ROCm/TheRock#10041 builds the tests from the top-level project and works against both layouts: with the current rocm-systems pin (old layout) it builds and passes, except --cpu-tests, which needs the unit binary this PR adds. After this PR lands, bump the pin.

Technical Details

  • One switch. ENABLE_TESTS (default ON) builds the integration tests, the unit tests and the CI wrapper together. test/unit is added from the same if(ENABLE_TESTS) block as test/. CPU and GPU jobs are still run separately through the wrapper's --cpu-tests and --gpu-tests.

  • HIP is only enabled when ENABLE_TESTS is ON.

  • test/ is no longer a standalone project. project(), cmake_minimum_required(), include(GNUInstallDirs) and the duplicate ENABLE_TESTS option are removed, and the ctest target is always added with the integration tests.

  • Direct configure is rejected. test/ and test/unit/ fail with a clear message if configured on their own.

  • GoogleTest is required when ENABLE_TESTS is ON, so a default configure now needs it. Install it or pass -DENABLE_TESTS=OFF. This is noted in CHANGELOG.md.

  • TESTING.md describes the single option and the GoogleTest requirement.

  • The pre-commit gersemi hook was skipped because it also reformats existing lines in CMakeLists.txt and test/unit/CMakeLists.txt that this change does not touch.
  • Issue Tracking

    JIRA ID: AIROCGDB-635

    Test Plan

    Standalone configure and build of projects/rocr-debug-agent on a gfx90a machine:

    1. Defaults, with build and install.
    2. -DENABLE_TESTS=OFF with no usable HIP compiler and GoogleTest hidden (-DCMAKE_DISABLE_FIND_PACKAGE_GTest=ON).
    3. Defaults, with GoogleTest hidden: must fail.
    4. Configure test/ and test/unit/ directly: must hit the guard.

    TheRock build with ROCm/TheRock#10041 and this branch as the rocm-systems submodule, then test_rocr-debug-agent.py with no flags, --cpu-tests and --gpu-tests.

    Test Result

  • 1: configures, builds and installs; tests/rocm-debug-agent/ has the unit binary, the integration test binary, the .hipfb files and the CI wrapper. ctest lists 8 tests.

  • 2: configures and builds without HIP or GoogleTest; no test/ directory and 0 ctest tests.

  • 3: fails with "GoogleTest not found".

  • 4: test/ and test/unit/ both fail with the guard error.

  • TheRock build: succeeds with ROCm/TheRock#10041 and this branch as the rocm-systems submodule. The wrapper passes with no flags, --cpu-tests and --gpu-tests on gfx90a.
  • Diff: 423 lines (+317 / -106) across 5 files Reviewer: amd-bfilipov Review duration: 20788m
    All Vouch review confidence checks passed
    Residual risk 0.24 = Change Risk (0.45) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.45 · 423 lines diff across 5 files
    0.45
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.362
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #15995"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 45.1% (MEDIUM) · Higher = larger blast radius
    45.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 24% · Safe to merge
    24%