Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions apps/rocm/src/examine_report_text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//! Relocated from `main.rs` with no behavior change (see
//! `docs/architecture.md`). The `rocm model` catalog renderer used to live
//! here too; it moved to `model_catalog_text.rs`, which this module does not
//! call into outside its own tests.
//! call into.
//!
//! This module owns: the launch-summary/examine text surfaces
//! (`render_launch_summary`, `render_examine_text`,
Expand Down Expand Up @@ -49,11 +49,9 @@
//! The regression tests for these surfaces live in this module's own
//! `mod tests`, reaching the shared `test_paths` fixture through
//! `crate::tests::` and `write_test_pip_runtime` through
//! `crate::test_support::`. One of them,
//! `linux_only_engine_runtime_status_is_explicit_on_native_windows`, also
//! calls `model_catalog_text.rs`'s `model_registry_adapter_availability_note`,
//! which is `pub(crate)` for that reason; its primary subject is
//! `engine_runtime_status_label`, so it stays here.
//! `crate::test_support::`. The note the `rocm model --verbose` listing prints
//! for a rule-out engine is tested in `model_catalog_text.rs`, next to the
//! renderer that prints it.

use std::fmt::Write as _;
use std::path::PathBuf;
Expand Down Expand Up @@ -578,7 +576,6 @@ mod tests {
use std::fs;

use super::*;
use crate::model_catalog_text::model_registry_adapter_availability_note;
use crate::runtimes_cmd::runtime_manifest_path;
use crate::test_support::write_test_pip_runtime;
use crate::tests::test_paths;
Expand Down Expand Up @@ -891,13 +888,8 @@ mod tests {
engine_runtime_status_label("vllm", &detect),
"unsupported_native_windows"
);
assert!(
model_registry_adapter_availability_note("vllm", &|| true)
.is_some_and(|note| note.contains("unsupported_native_windows"))
);
} else {
assert_eq!(engine_runtime_status_label("vllm", &detect), "not found");
assert!(model_registry_adapter_availability_note("vllm", &|| true).is_none());
}
}

Expand Down
23 changes: 19 additions & 4 deletions apps/rocm/src/model_catalog_text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
//!
//! The two renderers and `format_bytes` are `pub(crate)`; `main.rs` imports them
//! and `chat.rs`, `storage.rs` and `automations.rs` reach them as
//! `crate::<name>`. `model_registry_adapter_availability_note` is `pub(crate)`
//! only so the engine-status test that stays in `examine_report_text.rs` can
//! call it. Every other item is private.
//! `crate::<name>`. Every other item is private.

use std::collections::BTreeMap;
use std::fmt::Write as _;
Expand Down Expand Up @@ -819,7 +817,7 @@ fn append_model_engine_support_lines(
}

#[allow(dead_code)]
pub(crate) fn model_registry_adapter_availability_note(
fn model_registry_adapter_availability_note(
engine: &str,
docker_reachable: &dyn Fn() -> bool,
) -> Option<&'static str> {
Expand Down Expand Up @@ -1407,4 +1405,21 @@ mod tests {
assert!(!rendered.contains("CPU fallback"));
assert!(rendered.contains("engine_action: use /engine install <engine>"));
}

/// The adapter-availability note the verbose listing appends for vLLM: a
/// native Windows host gets the explicit `unsupported_native_windows`
/// status, every other host gets no note. Moved here from the
/// `engine_runtime_status_label` test in `examine_report_text.rs`, which
/// keeps the `runtime:` label half of the same check.
#[test]
fn vllm_adapter_availability_note_is_explicit_on_native_windows() {
if cfg!(windows) {
assert!(
model_registry_adapter_availability_note("vllm", &|| true)
.is_some_and(|note| note.contains("unsupported_native_windows"))
);
} else {
assert!(model_registry_adapter_availability_note("vllm", &|| true).is_none());
}
}
}
Loading
Loading