Repository navigation
Collapse the bare/_at/_read three-entry-point split in openmpi.rs and driver_install.rs - #705
Conversation
There was a problem hiding this comment.
🔵 Needs a closer look
The reported verification could not be independently confirmed because the repository checkout was unavailable.
1 open finding
What changed in this PR
Completes #690 by removing redundant test-only wrappers and using the existing OsRelease-aware entry points.
Changes:
- Migrates driver-install and OpenMPI tests without changing their assertions.
- Deletes bare-text wrappers while preserving
_atimplementations. - Updates testing documentation and related comments.
| File | Description |
|---|---|
| docs/testing.md | Documents direct use of _read test entry points. |
| crates/rocm-core/src/openmpi.rs | Migrates hint tests and removes the bare-text wrapper. |
| apps/rocm/src/driver_install.rs | Migrates planner tests and adds an OsRelease fixture helper. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
tomastola
left a comment
There was a problem hiding this comment.
Approving: the migration is mechanical, every assertion is unchanged, _read delegates to _at, and a grep of the head finds no remaining references to the deleted functions. CI is green.
Two stale comments, non-blocking. The first is an inline suggestion on openmpi.rs:935. The second is outside the diff, so GitHub can't take it inline: crates/rocm-core/src/openmpi.rs:1510-1512, in the doc comment on a_fallback_reads_malformed_line_names_the_fallback_path. It says malformed-line tests "went through either the bare, hardcoded-/etc functions or OsRelease::found", but the bare functions no longer exist. Suggest: "Every malformed-line test before this one went through [crate::hardware_root::OsRelease::found] (which hardcodes /etc/os-release), so ...".
…nt split PR ROCm#675 added an OsRelease-aware `_read` seam alongside the existing bare-text and `_at` functions in driver_install.rs and openmpi.rs. That left three entry points per builder, with the bare-text ones kept only because tests had no OsRelease of their own to construct. Now that tests can build `OsRelease::found(text)` directly, migrate the 33 build_driver_install_plan call sites and 12 install_hint_for call sites to their _read equivalents, and delete the two now-unreferenced bare functions. The _at functions are untouched; they remain the real implementation both _read and any other path-aware caller route through. No behavior change. Fixes ROCm#690 Signed-off-by: Jussi Elo <jussi.elo@amd.com>
Addresses a review comment: a bare backtick path bypasses link validation, so a moved or deleted target would go unnoticed. Signed-off-by: Jussi Elo <jussi.elo@amd.com>
Co-authored-by: Tomas Saaristola <144015745+tomastola@users.noreply.github.com> Signed-off-by: Jussi Elo <jussi.elo@amd.com>
b1eaede to
152478d
Compare

What
PR #675 added an
OsRelease-aware_readseam (install_hint_for_read,build_driver_install_plan_read,plan_for_os_release_read) alongside the existing bare-text and_atfunctions incrates/rocm-core/src/openmpi.rsandapps/rocm/src/driver_install.rs, leaving three entry points per builder: a bare-text function (test-only), an_atfunction (path-aware, the real implementation), and a_readfunction (OsRelease-aware).Now that tests can construct
OsRelease::found(text)directly and call the_readseam, the bare-text middle layer is redundant. This migrates every bare-text test call site to the_readseam and deletes the two now-unreferenced bare functions.apps/rocm/src/driver_install.rs: migrated all 33 call sites ofbuild_driver_install_plantobuild_driver_install_plan_read, using a small#[cfg(test)]os_release_foundhelper (sincerocm_core::hardware_root::OsRelease::foundispub(crate)insiderocm-coreand not visible from this crate's tests). Deleted the now-deadbuild_driver_install_plan.crates/rocm-core/src/openmpi.rs: migrated all 12 call sites ofinstall_hint_fortoinstall_hint_for_readusingcrate::hardware_root::OsRelease::found. Deleted the now-deadinstall_hint_for.docs/testing.md: updated a passage that described the now-deleted bare functions as currently-existing test helpers._atfunctions are untouched — they remain the real implementation both_readand any other path-aware caller route through.This is a pure test/internal-API cleanup with no behavior change.
Fixes #690
Verification
cargo build --workspace --all-targets,cargo test --workspace --all-targets,cargo clippy --workspace --all-targets -- -D warnings, andpython scripts/smoke_local.pyall pass.cargo xtask coveragepasses with no floor regression;coverage-floors.tomlis untouched.origin/mainis clean.