Repository navigation
rocr-debug-agent: Add unit test execution to CI wrapper script - #13375
Conversation
✅ All Policy Checks Passed
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
|
I'll go through this one. Thanks! |
73defc3 to
1313ecf
Compare
There was a problem hiding this comment.
-
Drop retry logic for unit tests.
run_unit_testsreuses themax_retries/retry_delaywrapper fromrun_tests. Unit tests are deterministic CPU-only tests, not GPU tests — retries mask real failures and waste CI time. Run once viasubprocess.run(cmd, cwd=..., env=..., check=True), exit non-zero on failure, nomax_retries/retry_delayparams. -
--skip-unitis redundant.--gpu-testsalone already skips unit tests — same code path. Drop--skip-unit. -
PR description doesn't match the code. Description says
--gou-only/--cpu-only; actual flags are--gpu-tests/--cpu-tests. Fix the description. -
TESTING.mdis stale. Still says "There is no CPU-only or unit-test tier" / lists unit tests under "Tiers that do not exist yet." Update it since this PR makes unit tests runnable via the CI wrapper. -
Minor:
args.gpu_tests or (not args.gpu_tests and not args.cpu_tests)simplifies toargs.gpu_tests or not args.cpu_tests.
🤖 This review was generated with assistance from Claude Code.
|
One more thing: TheRock's CI calls this script with no flags, assuming it only runs GPU integration tests. With this PR, the no-flags default now also runs unit tests. If the unit test binary isn't present/buildable in that CI path yet, or if adding ~unit test time to every GPU run isn't desired there, this changes TheRock's existing behavior without it opting in. Is there a fallback planned for that caller (e.g. keep default as GPU-only until TheRock passes 🤖 This review was generated with assistance from Claude Code. |
|
@amd-bfilipov Any updates on this one? |
1313ecf to
9287cf2
Compare
@lumachad Yes: The default (no flags) is back to GPU integration tests only, so TheRock's existing no-flag call is unchanged. Unit tests now run only with --cpu-tests; --gpu-tests --cpu-tests runs both. --cpu-tests exits 1 if the unit test binary is missing, so an opted-in job can't pass silently without it. The TheRock CPU/GPU jobs will pass the flags explicitly once the rocm-systems pin includes this PR.
|
Thanks. I've added a few bits and pieces on top. See if that makes sense please. |
Update test_rocr-debug-agent.py to run both integration and unit tests: - Modified get_default_paths() to discover unit test binary (flat install path) - Added run_unit_tests() function, which runs the unit tests once - Updated main() to execute unit tests after integration tests - Unit tests are optional (skipped if the binary is not found) Unit tests are deterministic CPU-only tests, so unlike the GPU integration tests they are not retried: a failure is a real failure. Unit tests are installed flat at tests/rocm-debug-agent/rocm-debug-agent-unit-tests (no unit/ subdirectory, matching the flat installation from CMakeLists.txt). Ticket: AIROCGDB-635
Add explicit flags to control which test suite runs: - --gpu-tests: Run GPU-based integration tests - --cpu-tests: Run CPU-based unit tests - Default (no flags): Run integration tests only - Both flags: Run both test suites The default is unchanged from before unit tests were added, so existing callers that pass no flags (e.g. TheRock CI) keep running only the GPU integration tests and opt in to unit tests explicitly. Passing --cpu-tests when the unit test binary is missing is an error. This enables separate CI job configurations for CPU-only workers (unit tests) and GPU workers (integration tests), allowing unit tests to run on cheaper infrastructure while GPU tests remain on specialized hardware. Update TESTING.md, which still stated that there is no CPU-only or unit-test tier, to describe both tiers and the wrapper flags. Ticket: AIROCGDB-635
Make the CI wrapper's binary requirements follow its flags:
- no flags: integration required, unit tests optional
(run if present, for compatibility)
- --gpu-tests: integration required, no unit tests
- --cpu-tests: unit test binary required, no GPU artifacts
- --gpu-tests --cpu-tests: both required
Previously --cpu-tests still exited if the GPU integration binary or
run-test.py was missing, and a missing unit test binary was only
detected after the integration tests had already run. Required paths
are now validated up front, based on the selected tiers.
Also:
- Report test launch failures (e.g. a non-executable binary) with a
"Failed to launch" error instead of a Python traceback. Launch
failures are not retried.
- Move the command logging, timing and launch handling shared by
run_tests and run_unit_tests into a _run_once helper. The retry
policy stays in run_tests and unit tests still run once.
- Update TESTING.md with a table of the flags and required binaries,
and describe the wrapper environment accurately: PATH and
LD_LIBRARY_PATH are prepended, ROCM_PATH is dropped unless
--try-rocm-path is given, and HSA_TOOLS_LIB is set by run-test.py
for the integration tests only.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
cd08c15 to
36b2b88
Compare
Yes, thank you. One nit: |
Hi @amd-bfilipov , |
TheRock Submodule Bump ActivityNewest first
|
Update
test_rocr-debug-agent.py(the CI wrapper) to run the CPU unit tests as well as the GPU integration tests.Changes
get_default_paths()discovers the unit test binary at its flat install path,tests/rocm-debug-agent/rocm-debug-agent-unit-tests(nounit/subdirectory, matching the flat installation fromCMakeLists.txt). Only the binaries needed by the selected tiers are required.run_unit_tests(). Unit tests are deterministic, so they run once, without retries. The integration tests keep their retry-with-backoff behavior.--gpu-testsand--cpu-testsflags to select which tiers run.Failed to launch ...and exits 1, instead of a Python traceback. Launch failures are not retried.TESTING.mddocuments the two test tiers, the flags and required binaries, and the environment the wrapper sets up.Flag behavior
--gpu-tests--cpu-tests--gpu-tests --cpu-testsRequired binaries are checked up front, before any test runs. The first failing tier stops the run.
Compatibility
With no flags the wrapper still requires the integration binary, so GPU-only runners keep working. The unit tests are optional in that mode "for now", for compatibility: they run if
rocm-debug-agent-unit-testswas built (ENABLE_UNIT_TESTS=ON) and are skipped with a warning otherwise. Note that a no-flag job on a build that ships the unit test binary now also runs the unit tests; use--gpu-teststo run only the integration tests.JIRA ID : AIROCGDB-635
🤖 Generated with Claude Code