Skip to content

debug-tools: Build and package amd-dbgapi test suite - #8943

Open
lumachad wants to merge 2 commits into
mainfrom
users/lumachad/dbgapi-tests
Open

lumachad wants to merge 2 commits into
mainfrom
users/lumachad/dbgapi-tests

Conversation

@lumachad

@lumachad lumachad commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

rocdbgapi now builds a unit test suite upstream, gated by ENABLE_TESTS and ENABLE_UNIT_TESTS, and installs the test binaries under a dedicated test install component. THEROCK_BUILD_TESTING is wired through to ENABLE_TESTS so the suite is built whenever testing is enabled, and therock-googletest is added as a build dependency only in that case.

The test binaries are folded into the existing amd-dbgapi artifact as a new test component rather than a separate artifact, matching the pattern already used by rocgdb. They are excluded from the dev component so they only ship once. build_tools/packaging/linux/package.json was updated so the new component is covered by the amdrocm-debugger-test package.

The committed consumer graph was updated with the new amd-dbgapi to therock-googletest build dependency edge.

This PR only builds and packages the tests. Running them in CI is left for a follow-up.

ISSUE ID: AIROCGDB-634

🤖 Generated with Claude Code

@lumachad
lumachad marked this pull request as ready for review October 12, 2026 16:29
@lumachad
lumachad requested review from a team as code owners October 12, 2026 16:29
@therock-pr-bot

therock-pr-bot Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

✅ All Checks Passed — Ready for Review

Check Status Details
📝 PR Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ✅ Pass —
🔎 pre-commit ✅ Pass —
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —
🤖 therock-pr-bot ✅ Pass —

🎉 All checks passed! This PR is ready for review.

📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

🙋 Wish to Override Policy?

@therock-pr-bot therock-pr-bot Bot added the Not ready to Review PR has unresolved policy failures — reviews blocked label Oct 12, 2026
@therock-pr-bot

therock-pr-bot Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

🎉 All checks passed! This PR is ready for review.

@lumachad
lumachad requested a review from marbre October 12, 2026 16:30
@therock-pr-bot therock-pr-bot Bot removed the Not ready to Review PR has unresolved policy failures — reviews blocked label Oct 12, 2026

@amd-bfilipov amd-bfilipov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good, thanks.

@marbre marbre left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

------------------------------ Captured log call -------------------------------
ERROR    test_artifact_structure:test_artifact_structure.py:452 MISSING package coverage: amd-dbgapi [test] (amd-dbgapi_test_generic.tar.zst)
=========================== short test summary info ============================
FAILED tests/test_artifact_structure.py::TestArtifactStructure::test_artifacts_covered_by_packages - Failed: Found 1 artifact component(s) not covered by package.json:
  amd-dbgapi [test] (amd-dbgapi_test_generic.tar.zst)
========================= 1 failed, 2 passed in 10.46s =========================

Can you please address this @lumachad?

@lumachad

Copy link
Copy Markdown
Contributor Author
------------------------------ Captured log call -------------------------------
ERROR    test_artifact_structure:test_artifact_structure.py:452 MISSING package coverage: amd-dbgapi [test] (amd-dbgapi_test_generic.tar.zst)
=========================== short test summary info ============================
FAILED tests/test_artifact_structure.py::TestArtifactStructure::test_artifacts_covered_by_packages - Failed: Found 1 artifact component(s) not covered by package.json:
  amd-dbgapi [test] (amd-dbgapi_test_generic.tar.zst)
========================= 1 failed, 2 passed in 10.46s =========================

Can you please address this @lumachad?

Will do. Thanks for spotting that.

@lumachad
lumachad marked this pull request as draft October 20, 2026 10:21
@lumachad
lumachad force-pushed the users/lumachad/dbgapi-tests branch from 40e8201 to 7770bec Compare October 20, 2026 12:51
@lumachad lumachad changed the title debug-tools: Build and package amd-dbgapi test suite debug-tools: Build amd-dbgapi test suite and wire up placeholder CI jobs Oct 20, 2026
@lumachad
lumachad force-pushed the users/lumachad/dbgapi-tests branch from 7770bec to 5d19d13 Compare October 23, 2026 08:46
@lumachad
lumachad force-pushed the users/lumachad/dbgapi-tests branch from 5d19d13 to 8d84836 Compare October 26, 2026 09:49

@motokultivator motokultivator left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks good to me.

amd-bfilipov pushed a commit that referenced this pull request Oct 27, 2026
Split rocr-debug-agent CI configuration into CPU and GPU test jobs,
following the pattern established for amd-dbgapi in #8943.

- rocr-debug-agent-cpu: CPU runner, placeholder test script
- rocr-debug-agent-gpu: GPU runner, placeholder test script

Both jobs use echo placeholders that always pass until the test wrapper
script is updated with --cpu-tests and --gpu-tests flags.

Added rocr-debug-agent to TEST_LABEL_GROUPS so test:rocr-debug-agent
label triggers both variants.

JIRA ID: AIROCGDB-635
lumachad pushed a commit that referenced this pull request Oct 27, 2026
Split rocr-debug-agent CI configuration into CPU and GPU test jobs,
following the pattern established for amd-dbgapi in #8943.

- rocr-debug-agent-cpu: CPU runner, placeholder test script
- rocr-debug-agent-gpu: GPU runner, placeholder test script

Both jobs use echo placeholders that always pass until the test wrapper
script is updated with --cpu-tests and --gpu-tests flags.

Added rocr-debug-agent to TEST_LABEL_GROUPS so test:rocr-debug-agent
label triggers both variants.

JIRA ID: AIROCGDB-635
@lumachad
lumachad force-pushed the users/lumachad/dbgapi-tests branch 2 times, most recently from 0bbf069 to 0d65574 Compare October 29, 2026 08:54
@lumachad
lumachad marked this pull request as ready for review October 29, 2026 08:54

@nunnikri nunnikri left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@lumachad
lumachad force-pushed the users/lumachad/dbgapi-tests branch from 0d65574 to 79a2f53 Compare October 30, 2026 10:27
@lumachad
lumachad force-pushed the users/lumachad/dbgapi-tests branch from 79a2f53 to e790c61 Compare October 30, 2026 15:48
@lumachad
lumachad force-pushed the users/lumachad/dbgapi-tests branch from e790c61 to 48b1085 Compare October 30, 2026 15:49
@peymanr

peymanr commented Oct 30, 2026

Copy link
Copy Markdown

PR Pundit review

(Testing PR Pundit Code Review agent. Not all comments may be relevant. This is a one-time automated pass: please address what is useful, no need to request a re-review. A quick reply per point (useful or not, and why) helps us calibrate the agent. Reach out to @peymanr for suggestions and feedback.)

# Finding Where
1 🟠 Echo-only amd-dbgapi placeholder jobs scheduled by default, wasting GPU runners: this PR added ungated matrix entries build_tools/github_actions/configure_multi_arch_ci.py:188
2 🟠 amd-dbgapi Windows jobs fetch nonexistent artifact patterns: this PR added Windows to Linux-only _rocgdb_common jobs build_tools/github_actions/fetch_test_configurations.py:555-570
3 🟠 Unit test pins placeholder echo script, forcing edits when real runner lands: this PR asserts on placeholder text build_tools/github_actions/tests/fetch_test_configurations_test.py:1285

1. 🟠 Should fix: Echo-only amd-dbgapi placeholder jobs scheduled by default, wasting GPU runners: this PR added ungated matrix entries

build_tools/github_actions/configure_multi_arch_ci.py:188

amd-dbgapi-cpu/amd-dbgapi-gpu only run echo and always pass, yet nothing gates them (no test_types, include_family, or label), so every default CI run (PROJECTS_TO_TEST='*') schedules them on every Linux and Windows family. amd-dbgapi-gpu has no linux_cpu_runner, so it occupies a scarce GPU runner (e.g. linux-gfx942-1gpu-ccs-csp-ossci-rocm, windows-gfx1151-gpu-rocm) just to download --debug-tools --tests artifacts and print a message, adding a green check with zero coverage. It also drops rocgdb-gpu's gfx125X-dcgpu exclude_family that a real runner will need. Gate them to label-only (or omit amd-dbgapi-gpu) until a real runner script exists.

Who is affected: Every Linux and Windows CI test run with debug-tools artifacts schedules two no-op jobs per GPU family.

Checked against the code by an independent pass.

Related past reviews: #2231 on debug-tools/CMakeLists.txt, #2859 on build_tools/github_actions/test_executable_scripts/test_rocr-debug-agent.py, #4260 on build_tools/github_actions/test_executable_scripts/test_rocr-debug-agent.py

2. 🟠 Should fix: amd-dbgapi Windows jobs fetch nonexistent artifact patterns: this PR added Windows to Linux-only _rocgdb_common jobs

build_tools/github_actions/fetch_test_configurations.py:555-570

amd-dbgapi-cpu/-gpu reuse the Linux-oriented _rocgdb_common (rocgdb Ubuntu image, --cap-add=SYS_PTRACE, --debug-tools --tests) and override platform to ['linux','windows'] without a comment. On Windows the container settings are discarded, as they are for every job. --debug-tools also requests rocgdb/rocr-debug-agent* artifacts that are not built on Windows (disable_platforms=['windows']); missing patterns are skipped silently. amd-dbgapi itself does build on Windows, so enabling Windows is plausible. A short comment explaining the Windows opt-in, or narrowing the fetch args, would make the intent clear.

Who is affected: Windows CI runs that select the debug-tools stage or test:amd-dbgapi; they schedule placeholder jobs that just echo and pass.

Checked against the code by an independent pass.

Related past reviews: #2540 on build_tools/install_rocm_from_artifacts.py, #2797 on build_tools/fetch_sources.py, #2051 on debug-tools/CMakeLists.txt, #3379 on build_tools/github_actions/fetch_test_configurations.py, #6436 on build_tools/github_actions/fetch_test_configurations.py, #8689 on build_tools/github_actions/configure_multi_arch_ci.py, #8710 on build_tools/github_actions/configure_multi_arch_ci.py, #8768 on build_tools/github_actions/configure_multi_arch_ci.py

3. 🟠 Should fix: Unit test pins placeholder echo script, forcing edits when real runner lands: this PR asserts on placeholder text

build_tools/github_actions/tests/fetch_test_configurations_test.py:1285

test_amd_dbgapi_cpu_job_runs_on_cpu_runner_with_placeholder_script asserts assertIn('echo', job['test_script']), which pins the temporary placeholder script. Anyone replacing the placeholder with a real runner must also delete this assertion. Its only other check is linux_cpu_runner=True, a static flag. That flag is already exercised for CPU-only jobs by test_cpu_only_components_run_without_gpu_runner. Consider dropping the script-text assertion, or folding the CPU-runner check into that existing test.

Who is affected: Maintainers who later wire up a real amd-dbgapi test runner; no CI or user behaviour is affected.

Checked against the code by an independent pass.

Related past reviews: #8319 on build_tools/github_actions/tests/configure_multi_arch_ci_test.py, #4616 on build_tools/github_actions/tests/configure_multi_arch_ci_test.py, #8169 on build_tools/github_actions/tests/configure_multi_arch_ci_test.py

Shared from a pilot of PR Pundit, an agentic code reviewer that builds and tests the change and reads the project's past reviews. Reviewed at 79a2f53e; findings checked and posted by @peymanr; points already raised on this PR are left out.

@lumachad lumachad added the ci:skip Skip all CI builds/tests for this PR label Oct 30, 2026
@lumachad
lumachad force-pushed the users/lumachad/dbgapi-tests branch from 48b1085 to c52ed31 Compare November 2, 2026 12:42
@lumachad lumachad changed the title debug-tools: Build amd-dbgapi test suite and wire up placeholder CI jobs debug-tools: Build and package amd-dbgapi test suite Nov 2, 2026
@lumachad

lumachad commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

PR Pundit review

(Testing PR Pundit Code Review agent. Not all comments may be relevant. This is a one-time automated pass: please address what is useful, no need to request a re-review. A quick reply per point (useful or not, and why) helps us calibrate the agent. Reach out to @peymanr for suggestions and feedback.)

Finding Where

1 🟠 Echo-only amd-dbgapi placeholder jobs scheduled by default, wasting GPU runners: this PR added ungated matrix entries build_tools/github_actions/configure_multi_arch_ci.py:188
2 🟠 amd-dbgapi Windows jobs fetch nonexistent artifact patterns: this PR added Windows to Linux-only _rocgdb_common jobs build_tools/github_actions/fetch_test_configurations.py:555-570
3 🟠 Unit test pins placeholder echo script, forcing edits when real runner lands: this PR asserts on placeholder text build_tools/github_actions/tests/fetch_test_configurations_test.py:1285

1. 🟠 Should fix: Echo-only amd-dbgapi placeholder jobs scheduled by default, wasting GPU runners: this PR added ungated matrix entries

build_tools/github_actions/configure_multi_arch_ci.py:188

amd-dbgapi-cpu/amd-dbgapi-gpu only run echo and always pass, yet nothing gates them (no test_types, include_family, or label), so every default CI run (PROJECTS_TO_TEST='*') schedules them on every Linux and Windows family. amd-dbgapi-gpu has no linux_cpu_runner, so it occupies a scarce GPU runner (e.g. linux-gfx942-1gpu-ccs-csp-ossci-rocm, windows-gfx1151-gpu-rocm) just to download --debug-tools --tests artifacts and print a message, adding a green check with zero coverage. It also drops rocgdb-gpu's gfx125X-dcgpu exclude_family that a real runner will need. Gate them to label-only (or omit amd-dbgapi-gpu) until a real runner script exists.

Who is affected: Every Linux and Windows CI test run with debug-tools artifacts schedules two no-op jobs per GPU family.

Checked against the code by an independent pass.

Related past reviews: #2231 on debug-tools/CMakeLists.txt, #2859 on build_tools/github_actions/test_executable_scripts/test_rocr-debug-agent.py, #4260 on build_tools/github_actions/test_executable_scripts/test_rocr-debug-agent.py

2. 🟠 Should fix: amd-dbgapi Windows jobs fetch nonexistent artifact patterns: this PR added Windows to Linux-only _rocgdb_common jobs

build_tools/github_actions/fetch_test_configurations.py:555-570

amd-dbgapi-cpu/-gpu reuse the Linux-oriented _rocgdb_common (rocgdb Ubuntu image, --cap-add=SYS_PTRACE, --debug-tools --tests) and override platform to ['linux','windows'] without a comment. On Windows the container settings are discarded, as they are for every job. --debug-tools also requests rocgdb/rocr-debug-agent* artifacts that are not built on Windows (disable_platforms=['windows']); missing patterns are skipped silently. amd-dbgapi itself does build on Windows, so enabling Windows is plausible. A short comment explaining the Windows opt-in, or narrowing the fetch args, would make the intent clear.

Who is affected: Windows CI runs that select the debug-tools stage or test:amd-dbgapi; they schedule placeholder jobs that just echo and pass.

Checked against the code by an independent pass.

Related past reviews: #2540 on build_tools/install_rocm_from_artifacts.py, #2797 on build_tools/fetch_sources.py, #2051 on debug-tools/CMakeLists.txt, #3379 on build_tools/github_actions/fetch_test_configurations.py, #6436 on build_tools/github_actions/fetch_test_configurations.py, #8689 on build_tools/github_actions/configure_multi_arch_ci.py, #8710 on build_tools/github_actions/configure_multi_arch_ci.py, #8768 on build_tools/github_actions/configure_multi_arch_ci.py

3. 🟠 Should fix: Unit test pins placeholder echo script, forcing edits when real runner lands: this PR asserts on placeholder text

build_tools/github_actions/tests/fetch_test_configurations_test.py:1285

test_amd_dbgapi_cpu_job_runs_on_cpu_runner_with_placeholder_script asserts assertIn('echo', job['test_script']), which pins the temporary placeholder script. Anyone replacing the placeholder with a real runner must also delete this assertion. Its only other check is linux_cpu_runner=True, a static flag. That flag is already exercised for CPU-only jobs by test_cpu_only_components_run_without_gpu_runner. Consider dropping the script-text assertion, or folding the CPU-runner check into that existing test.

Who is affected: Maintainers who later wire up a real amd-dbgapi test runner; no CI or user behaviour is affected.

Checked against the code by an independent pass.

Related past reviews: #8319 on build_tools/github_actions/tests/configure_multi_arch_ci_test.py, #4616 on build_tools/github_actions/tests/configure_multi_arch_ci_test.py, #8169 on build_tools/github_actions/tests/configure_multi_arch_ci_test.py

Shared from a pilot of PR Pundit, an agentic code reviewer that builds and tests the change and reads the project's past reviews. Reviewed at 79a2f53e; findings checked and posted by @peymanr; points already raised on this PR are left out.

Fair enough. I'm leaving the test enablement in CI for a follow-up.

@ScottTodd
ScottTodd removed their request for review November 2, 2026 19:28
@lumachad lumachad removed the ci:skip Skip all CI builds/tests for this PR label Nov 3, 2026
@lumachad
lumachad force-pushed the users/lumachad/dbgapi-tests branch from c52ed31 to b9209a5 Compare November 3, 2026 14:11
@lumachad

lumachad commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

I'd like to merge this reduced scope PR later today. Do let me know if you have objections.

amd-llvm
CMAKE_ARGS
-DTHE_ROCK_BUILD=ON
"-DENABLE_TESTS=${THEROCK_BUILD_TESTING}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the changes @lumachad, can ENABLE_TESTS stay off until an upstream unit test actually exercises amd-dbgapi? For my understanding: the new binary dbgapi_smoke_test only links GTest::gtest_main and GTest::gmock. It does not call amd-dbgapi. Does the follow-up add that unit test, or does it only run this smoke binary?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

can ENABLE_TESTS stay off until an upstream unit test actually exercises amd-dbgapi?

I'd rather leave the ENABLE_TESTS gated on THEROCK_BUILD_TESTING, as that means we always go through the infra to build these and install the files. That way we'll always test this path when we bump rocm-systems, even though we don't have a complete set of unit tests or invoke them.

For my understanding: the new binary dbgapi_smoke_test only links GTest::gtest_main and GTest::gmock. It does not call amd-dbgapi. Does the follow-up add that unit test, or does it only run this smoke binary?

The follow-up will start running these CPU-based smoke tests first, then the set will be expanded to do real CPU-based tests. Then we will eventually have GPU-based ones.

Enablement of the unit tests is taking place in parallel, and will be done in incremental steps.

Does that answer your questions?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you . This explains why ENABLE_TESTS stays tied to THEROCK_BUILD_TESTING.
And reconfirms The smoke binary, the missing amd-dbgapi unit test, and the later GPU tests are expected in follow-up

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@lumachad at this time dbgapi_smoke_test is included in packaging, but not getting tested with CI, right?
Would you have a link to dbgapi_smoke_test test results to make sure it runs fine?

@lumachad lumachad Nov 5, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@dileepr1 That's correct. I did the validation locally on Linux. The Windows runners had some hiccups that prevented running it. I think I can put up a second temporary commit to at least confirm the smoke test runs fine on both Windows and Linux. Would that be acceptable?

Once we see it working, I can drop the temporary patch and go with just building it but not running it in CI.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That would be great, thanks!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Pushed a temporary commit now.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@lumachad lumachad added ci:skip Skip all CI builds/tests for this PR and removed ci:skip Skip all CI builds/tests for this PR labels Nov 6, 2026
lumachad and others added 2 commits November 6, 2026 12:00
rocdbgapi now builds a unit test suite through ENABLE_TESTS and
ENABLE_UNIT_TESTS, installing the test binaries under a dedicated
install component. Wire THEROCK_BUILD_TESTING through to ENABLE_TESTS
so the suite is built whenever testing is enabled, add therock-googletest
as a build dependency when that's the case, and fold the test binaries
into the amd-dbgapi artifact as a new test component so they get staged
and distributed like everything else.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Temporary patch to try the dbgapi-cpu test job in CI. Adds a test
matrix entry on the rocgdb CPU container and a script that runs each
GoogleTest binary installed under tests/rocdbgapi. Not meant to merge
with the test build PR.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@lumachad
lumachad force-pushed the users/lumachad/dbgapi-tests branch from c505c71 to b9e5b8d Compare November 6, 2026 12:00

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: TODO

Development

Successfully merging this pull request may close these issues.

9 participants